Package: src:python-qrcode
Version: 7.4.2-4
Severity: serious
Tags: sid trixie

qrcode fails its autopkg tests with pillow 10.3:

[...]
28s autopkgtest [21:55:27]: test qrcode: [-----------------------
28s ============================= test session starts ==============================
 28s platform linux -- Python 3.12.2, pytest-7.4.4, pluggy-1.4.0
 28s rootdir: /tmp/autopkgtest-lxc.js984avw/downtmp/autopkgtest_tmp
 28s collected 79 items
 28s
28s tests/test_example.py . [ 1%] 30s tests/test_qrcode.py ................................................... [ 65%] 31s ... [ 69%] 31s tests/test_qrcode_svg.py ...... [ 77%] 31s tests/test_release.py .... [ 82%] 31s tests/test_script.py .........F... [ 98%] 31s tests/test_util.py . [100%]
 31s
31s =================================== FAILURES =================================== 31s ____________________________ ScriptTest.test_piped _____________________________
 31s
 31s self = <tests.test_script.ScriptTest testMethod=test_piped>
 31s mock_stdout = <MagicMock name='stdout' id='139727054521984'>
 31s
 31s     @mock.patch("os.isatty", lambda *args: False)
 31s     @mock.patch("sys.stdout")
 31s     @unittest.skipIf(not Image, "Requires PIL")
 31s     def test_piped(self, mock_stdout):
 31s >       main(["testtext"])
 31s
 31s tests/test_script.py:33:
31s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 31s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:139: in main
 31s     img.save(sys.stdout.buffer)
 31s /usr/lib/python3/dist-packages/qrcode/image/pil.py:51: in save
 31s     self._img.save(stream, format=format, **kwargs)
31s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 31s
 31s self = <PIL.Image.Image image mode=1 size=290x290 at 0x7F14BD72F3E0>
31s fp = <MagicMock name='stdout.buffer' id='139727054534272'>, format = 'PNG'
 31s params = {}
31s filename = '/tmp/autopkgtest-lxc.js984avw/downtmp/autopkgtest_tmp/MagicMock/stdout.buffer/139727054534272'
 31s open_fp = True, save_all = False, filename_ext = '', ext = ''
 31s
 31s     def save(self, fp, format=None, **params) -> None:
 31s         """
 31s         Saves this image under the given filename.  If no format is
 31s         specified, the format to use is determined from the filename
 31s         extension, if possible.
 31s
 31s         Keyword options can be used to provide additional instructions
 31s         to the writer. If a writer doesn't recognise an option, it is
 31s         silently ignored. The available options are described in the
 31s         :doc:`image format documentation
 31s         <../handbook/image-file-formats>` for each writer.
 31s
 31s         You can use a file object instead of a filename. In this case,
 31s         you must always specify the format. The file object must
 31s         implement the ``seek``, ``tell``, and ``write``
 31s         methods, and be opened in binary mode.
 31s
31s :param fp: A filename (string), os.PathLike object or file object.
 31s         :param format: Optional format override.  If omitted, the
 31s            format to use is determined from the filename extension.
 31s            If a file object was used instead of a filename, this
 31s            parameter should always be used.
 31s         :param params: Extra parameters to the image writer.
 31s         :returns: None
31s :exception ValueError: If the output format could not be determined
 31s            from the file name.  Use the format option to solve this.
31s :exception OSError: If the file could not be written. The file
 31s            may have been created, and may contain partial data.
 31s         """
 31s
 31s         filename: str | bytes = ""
 31s         open_fp = False
 31s         if is_path(fp):
 31s             filename = os.path.realpath(os.fspath(fp))
 31s             open_fp = True
 31s         elif fp == sys.stdout:
 31s             try:
 31s                 fp = sys.stdout.buffer
 31s             except AttributeError:
 31s                 pass
 31s         if not filename and hasattr(fp, "name") and is_path(fp.name):
 31s             # only set the name for metadata purposes
 31s             filename = os.path.realpath(os.fspath(fp.name))
 31s
 31s         # may mutate self!
 31s         self._ensure_mutable()
 31s
 31s         save_all = params.pop("save_all", False)
 31s         self.encoderinfo = params
 31s         self.encoderconfig = ()
 31s
 31s         preinit()
 31s
 31s         filename_ext = os.path.splitext(filename)[1].lower()
31s ext = filename_ext.decode() if isinstance(filename_ext, bytes) else filename_ext
 31s
 31s         if not format:
 31s             if ext not in EXTENSION:
 31s                 init()
 31s             try:
 31s                 format = EXTENSION[ext]
 31s             except KeyError as e:
 31s                 msg = f"unknown file extension: {ext}"
 31s                 raise ValueError(msg) from e
 31s
 31s         if format.upper() not in SAVE:
 31s             init()
 31s         if save_all:
 31s             save_handler = SAVE_ALL[format.upper()]
 31s         else:
 31s             save_handler = SAVE[format.upper()]
 31s
 31s         created = False
 31s         if open_fp:
 31s             created = not os.path.exists(filename)
 31s             if params.get("append", False):
 31s                 # Open also for reading ("+"), because TIFF save_all
 31s                 # writer needs to go back and edit the written data.
 31s                 fp = builtins.open(filename, "r+b")
 31s             else:
 31s >               fp = builtins.open(filename, "w+b")
31s E FileNotFoundError: [Errno 2] No such file or directory: '/tmp/autopkgtest-lxc.js984avw/downtmp/autopkgtest_tmp/MagicMock/stdout.buffer/139727054534272'
 31s
 31s /usr/lib/python3/dist-packages/PIL/Image.py:2456: FileNotFoundError
31s =============================== warnings summary ===============================
 31s tests/test_script.py::ScriptTest::test_bad_factory
31s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
 31s     from pkg_resources import get_distribution
 31s
31s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 31s =========================== short test summary info ============================ 31s FAILED tests/test_script.py::ScriptTest::test_piped - FileNotFoundError: [Err... 31s =================== 1 failed, 78 passed, 1 warning in 2.82s ====================
 31s autopkgtest [21:55:30]: test qrcode: -----------------------]
31s autopkgtest [21:55:30]: test qrcode: - - - - - - - - - - results - - - - - - - - - -
 31s qrcode               FAIL non-zero exit status 1

Reply via email to