aports/testing/py3-blockdiag/0005-fix-warning-codecs.patch
mio 914b7cb193 testing/py3-blockdiag: rebuild against python 3.14
Fix `Failed: 'yield' keyword is allowed in fixtures, but not in tests`
error when running tests with pytest >=8.4.

Fix `ModuleNotFoundError: No module named 'pkg_resources'` error when
building with setuptools 82.

Fix `tests/diagrams/node_icon.diag-svg-options416]` test which failed
due to being unable to retrieve test data sources
`/usr/share/pixmaps/debian-logo.png` (non-existent path) and
`http://blockdiag.com/favicon.ico` (`urllib.error.HTTPError: HTTP Error
403: Forbidden`).

Fix deprecation warning from the use of `codecs.open`.

Ref: https://gitlab.alpinelinux.org/alpine/aports/-/issues/18025
2026-04-08 01:41:47 +00:00

21 lines
800 B
Diff

diff -rupN a/src/blockdiag/utils/bootstrap.py b/src/blockdiag/utils/bootstrap.py
--- a/src/blockdiag/utils/bootstrap.py 2021-12-06 16:43:47.000000000 +0000
+++ b/src/blockdiag/utils/bootstrap.py 2026-04-08 00:52:58.510000000 +0000
@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import codecs
import os
import re
import sys
@@ -82,7 +81,7 @@ class Application(object):
if self.code.startswith('\ufeff'): # strip BOM
self.code = self.code[1:]
else:
- fp = codecs.open(self.options.input, 'r', 'utf-8-sig')
+ fp = open(self.options.input, encoding='utf-8-sig')
self.code = fp.read()
return self.module.parser.parse_string(self.code)