Bug#1056475: python-imageio's autopkg tests fail with Python 3.12

Matthias Klose doko at debian.org
Wed Nov 22 14:02:23 GMT 2023


Package: src:python-imageio
Version: 2.33.0-1
Severity: important
Tags: sid trixie
User: debian-python at lists.debian.org
Usertags: python3.12

python-imageio's autopkg tests fail with Python 3.12:

[...]
269s =================================== FAILURES 
===================================
269s ___________________________________ test_gif 
___________________________________
269s
269s self = <PIL.GifImagePlugin.GifImageFile image mode= size=32x42 at 
0x7FAF51F23740>
269s fp = <_io.BufferedReader 
name='/tmp/pytest-of-ubuntu/pytest-0/test_gif0/test0.0.0.gif'>
269s filename = ''
269s
269s     def __init__(self, fp=None, filename=None):
269s         super().__init__()
269s
269s         self._min_frame = 0
269s
269s         self.custom_mimetype = None
269s
269s         self.tile = None
269s         """ A list of tile descriptors, or ``None`` """
269s
269s         self.readonly = 1  # until we know better
269s
269s         self.decoderconfig = ()
269s         self.decodermaxblock = MAXBLOCK
269s
269s         if is_path(fp):
269s             # filename
269s             self.fp = open(fp, "rb")
269s             self.filename = fp
269s             self._exclusive_fp = True
269s         else:
269s             # stream
269s             self.fp = fp
269s             self.filename = filename
269s             # can be overridden
269s             self._exclusive_fp = None
269s
269s         try:
269s             try:
269s >               self._open()
269s
269s /usr/lib/python3/dist-packages/PIL/ImageFile.py:117:
269s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _
269s /usr/lib/python3/dist-packages/PIL/GifImagePlugin.py:108: in _open
269s     self._seek(0)  # get ready to read first frame
269s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _
269s
269s self = <PIL.GifImagePlugin.GifImageFile image mode= size=32x42 at 
0x7FAF51F23740>
269s frame = 0, update_image = True
269s
269s     def _seek(self, frame, update_image=True):
269s         if frame == 0:
269s             # rewind
269s             self.__offset = 0
269s             self.dispose = None
269s             self.__frame = -1
269s             self._fp.seek(self.__rewind)
269s             self.disposal_method = 0
269s             if "comment" in self.info:
269s                 del self.info["comment"]
269s         else:
269s             # ensure that the previous frame was loaded
269s             if self.tile and update_image:
269s                 self.load()
269s
269s         if frame != self.__frame + 1:
269s             msg = f"cannot seek to frame {frame}"
269s             raise ValueError(msg)
269s
269s         self.fp = self._fp
269s         if self.__offset:
269s             # backup to last frame
269s             self.fp.seek(self.__offset)
269s             while self.data():
269s                 pass
269s             self.__offset = 0
269s
269s         s = self.fp.read(1)
269s         if not s or s == b";":
269s >           raise EOFError
269s E           EOFError
269s
269s /usr/lib/python3/dist-packages/PIL/GifImagePlugin.py:186: EOFError
269s
269s The above exception was the direct cause of the following exception:
269s
269s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_gif0')
269s
269s     @deprecated_test
269s     def test_gif(tmp_path):
269s         fnamebase = str(tmp_path / "test")
269s
269s         # The not-animated gif
269s
269s         for isfloat in (False, True):
269s             for crop in (0, 1, 2):
269s                 for colors in (0, 3, 4):
269s                     if colors > 1 and 
sys.platform.startswith("darwin"):
269s                         continue  # quantize fails, see also png
269s                     fname = fnamebase + "%i.%i.%i.gif" % (isfloat, 
crop, colors)
269s                     rim = get_ref_im(colors, crop, isfloat)
269s                     imageio.imsave(fname, rim, format="GIF-PIL")
269s >                   im = imageio.imread(fname, format="GIF-PIL")
269s
269s test_pillow_legacy.py:281:
269s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _
269s /usr/lib/python3/dist-packages/imageio/__init__.py:97: in imread
269s     return imread_v2(uri, format=format, **kwargs)
269s /usr/lib/python3/dist-packages/imageio/v2.py:360: in imread
269s     result = file.read(index=0, **kwargs)
269s 
/usr/lib/python3/dist-packages/imageio/core/legacy_plugin_wrapper.py:147: 
in read
269s     reader = self.legacy_get_reader(**kwargs)
269s 
/usr/lib/python3/dist-packages/imageio/core/legacy_plugin_wrapper.py:116: 
in legacy_get_reader
269s     return self._format.get_reader(self._request)
269s /usr/lib/python3/dist-packages/imageio/core/format.py:221: in 
get_reader
269s     return self.Reader(self, request)
269s /usr/lib/python3/dist-packages/imageio/core/format.py:312: in __init__
269s     self._open(**self.request.kwargs.copy())
269s 
/usr/lib/python3/dist-packages/imageio/plugins/pillow_legacy.py:287: in 
_open
269s     self._im = factory(self._fp, "")
269s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _
269s
269s self = <PIL.GifImagePlugin.GifImageFile image mode= size=32x42 at 
0x7FAF51F23740>
269s fp = <_io.BufferedReader 
name='/tmp/pytest-of-ubuntu/pytest-0/test_gif0/test0.0.0.gif'>
269s filename = ''
269s
269s     def __init__(self, fp=None, filename=None):
269s         super().__init__()
269s
269s         self._min_frame = 0
269s
269s         self.custom_mimetype = None
269s
269s         self.tile = None
269s         """ A list of tile descriptors, or ``None`` """
269s
269s         self.readonly = 1  # until we know better
269s
269s         self.decoderconfig = ()
269s         self.decodermaxblock = MAXBLOCK
269s
269s         if is_path(fp):
269s             # filename
269s             self.fp = open(fp, "rb")
269s             self.filename = fp
269s             self._exclusive_fp = True
269s         else:
269s             # stream
269s             self.fp = fp
269s             self.filename = filename
269s             # can be overridden
269s             self._exclusive_fp = None
269s
269s         try:
269s             try:
269s                 self._open()
269s             except (
269s                 IndexError,  # end of data
269s                 TypeError,  # end of data (ord)
269s                 KeyError,  # unsupported mode
269s                 EOFError,  # got header but not the first frame
269s                 struct.error,
269s             ) as v:
269s >               raise SyntaxError(v) from v
269s E               SyntaxError:
269s
269s /usr/lib/python3/dist-packages/PIL/ImageFile.py:125: SyntaxError
269s =============================== warnings summary 
===============================
269s test_fei_tiff.py::test_fei_file_fail
269s   /usr/lib/python3/dist-packages/imageio/plugins/tifffile.py:189: 
DeprecationWarning: ImageIO's vendored tifffile backend is deprecated 
and will be removed in ImageIO v3. Install the tifffile directly: `pip 
install imageio[tifffile]`
269s     warnings.warn(
269s
269s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
269s =========================== short test summary info 
============================
269s FAILED test_pillow_legacy.py::test_gif - SyntaxError:
269s = 1 failed, 80 passed, 11 skipped, 123 deselected, 1 xpassed, 1 
warning in 2.17s =
269s autopkgtest [18:42:59]: test command1: -----------------------]
270s command1             FAIL non-zero exit status 1



More information about the debian-science-maintainers mailing list