Bug#1119262: guidata autopkg tests fail with pillow 12.0 from unstable
Matthias Klose (Ubuntu)
m1 at klose.in-berlin.de
Tue Oct 28 12:39:20 GMT 2025
Package: src:guidata
Version: 3.6.2-3
Severity: serious
Tags: sid forky
guidata autopkg tests fail with pillow 12.0 from unstable, blocking the
migration of pillow:
[...]
95s =================================== FAILURES
===================================
95s ____________________________ test_collectionseditor
____________________________
95s
95s obj = array([[ 30, 54, 93, ..., 201, 136, 61],
95s [ 26, 81, 227, ..., 172, 162, 105],
95s [180, 233, 29, ..., 4..., 221, 74],
95s [ 85, 91, 89, ..., 126, 34, 203],
95s [209, 112, 188, ..., 145, 174, 184]], shape=(100, 100))
95s mode = 'P'
95s
95s def fromarray(obj: SupportsArrayInterface, mode: str | None =
None) -> Image:
95s """
95s Creates an image memory from an object exporting the array
interface
95s (using the buffer protocol)::
95s
95s from PIL import Image
95s import numpy as np
95s a = np.zeros((5, 5))
95s im = Image.fromarray(a)
95s
95s If ``obj`` is not contiguous, then the ``tobytes`` method
is called
95s and :py:func:`~PIL.Image.frombuffer` is used.
95s
95s In the case of NumPy, be aware that Pillow modes do not
always correspond
95s to NumPy dtypes. Pillow modes only offer 1-bit pixels,
8-bit pixels,
95s 32-bit signed integer pixels, and 32-bit floating point
pixels.
95s
95s Pillow images can also be converted to arrays::
95s
95s from PIL import Image
95s import numpy as np
95s im = Image.open("hopper.jpg")
95s a = np.asarray(im)
95s
95s When converting Pillow images to arrays however, only
pixel values are
95s transferred. This means that P and PA mode images will
lose their palette.
95s
95s :param obj: Object with array interface
95s :param mode: Optional mode to use when reading ``obj``.
Since pixel values do not
95s contain information about palettes or color spaces, this
can be used to place
95s grayscale L mode data within a P mode image, or read RGB
data as YCbCr for
95s example.
95s
95s See: :ref:`concept-modes` for general information about
modes.
95s :returns: An image object.
95s
95s .. versionadded:: 1.1.6
95s """
95s arr = obj.__array_interface__
95s shape = arr["shape"]
95s ndim = len(shape)
95s strides = arr.get("strides", None)
95s try:
95s typekey = (1, 1) + shape[2:], arr["typestr"]
95s except KeyError as e:
95s if mode is not None:
95s typekey = None
95s color_modes: list[str] = []
95s else:
95s msg = "Cannot handle this data type"
95s raise TypeError(msg) from e
95s if typekey is not None:
95s try:
95s > typemode, rawmode, color_modes =
_fromarray_typemap[typekey]
95s
^^^^^^^^^^^^^^^^^^^^^^^^^^^
95s E KeyError: ((1, 1), '<i8')
95s
95s /usr/lib/python3/dist-packages/PIL/Image.py:3285: KeyError
95s
95s The above exception was the direct cause of the following exception:
95s
95s def test_collectionseditor():
95s """Test Collections editor."""
95s with qt_app_context(exec_loop=True):
95s dialog = CollectionsEditor()
95s > dialog.setup(get_test_data())
95s ^^^^^^^^^^^^^^^
95s
95s tests/widgets/test_collectionseditor.py:120:
95s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
95s tests/widgets/test_collectionseditor.py:111: in get_test_data
95s image = PILImage.fromarray(np.random.randint(256, size=(100,
100)), mode="P")
95s
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
95s
95s obj = array([[ 30, 54, 93, ..., 201, 136, 61],
95s [ 26, 81, 227, ..., 172, 162, 105],
95s [180, 233, 29, ..., 4..., 221, 74],
95s [ 85, 91, 89, ..., 126, 34, 203],
95s [209, 112, 188, ..., 145, 174, 184]], shape=(100, 100))
95s mode = 'P'
95s
95s def fromarray(obj: SupportsArrayInterface, mode: str | None =
None) -> Image:
95s """
95s Creates an image memory from an object exporting the array
interface
95s (using the buffer protocol)::
95s
95s from PIL import Image
95s import numpy as np
95s a = np.zeros((5, 5))
95s im = Image.fromarray(a)
95s
95s If ``obj`` is not contiguous, then the ``tobytes`` method
is called
95s and :py:func:`~PIL.Image.frombuffer` is used.
95s
95s In the case of NumPy, be aware that Pillow modes do not
always correspond
95s to NumPy dtypes. Pillow modes only offer 1-bit pixels,
8-bit pixels,
95s 32-bit signed integer pixels, and 32-bit floating point
pixels.
95s
95s Pillow images can also be converted to arrays::
95s
95s from PIL import Image
95s import numpy as np
95s im = Image.open("hopper.jpg")
95s a = np.asarray(im)
95s
95s When converting Pillow images to arrays however, only
pixel values are
95s transferred. This means that P and PA mode images will
lose their palette.
95s
95s :param obj: Object with array interface
95s :param mode: Optional mode to use when reading ``obj``.
Since pixel values do not
95s contain information about palettes or color spaces, this
can be used to place
95s grayscale L mode data within a P mode image, or read RGB
data as YCbCr for
95s example.
95s
95s See: :ref:`concept-modes` for general information about
modes.
95s :returns: An image object.
95s
95s .. versionadded:: 1.1.6
95s """
95s arr = obj.__array_interface__
95s shape = arr["shape"]
95s ndim = len(shape)
95s strides = arr.get("strides", None)
95s try:
95s typekey = (1, 1) + shape[2:], arr["typestr"]
95s except KeyError as e:
95s if mode is not None:
95s typekey = None
95s color_modes: list[str] = []
95s else:
95s msg = "Cannot handle this data type"
95s raise TypeError(msg) from e
95s if typekey is not None:
95s try:
95s typemode, rawmode, color_modes =
_fromarray_typemap[typekey]
95s except KeyError as e:
95s typekey_shape, typestr = typekey
95s msg = f"Cannot handle this data type:
{typekey_shape}, {typestr}"
95s > raise TypeError(msg) from e
95s E TypeError: Cannot handle this data type: (1, 1), <i8
95s
95s /usr/lib/python3/dist-packages/PIL/Image.py:3289: TypeError
95s _________________________________ test_console
_________________________________
95s
95s def test_console():
95s """Test Console widget."""
95s with qt_app_context(exec_loop=True):
95s > widget = Console(debug=False, multithreaded=True)
95s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95s
95s tests/widgets/test_console.py:22:
95s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
95s
/usr/lib/python3/dist-packages/guidata/widgets/console/__init__.py:51:
in __init__
95s InternalShell.__init__(
95s
/usr/lib/python3/dist-packages/guidata/widgets/console/internalshell.py:208:
in __init__
95s self.start_interpreter(namespace)
95s
/usr/lib/python3/dist-packages/guidata/widgets/console/internalshell.py:241:
in start_interpreter
95s self.new_prompt(self.interpreter.p1)
95s
/usr/lib/python3/dist-packages/guidata/widgets/console/shell.py:255: in
new_prompt
95s if self.get_cursor_line_column()[1] != 0:
95s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
95s
95s self = <guidata.widgets.console.Console object at 0x7f1afc7b2330>
95s
95s def get_cursor_line_column(self):
95s """Return cursor (line, column) numbers"""
95s > cursor = self.textCursor()
95s ^^^^^^^^^^^^^^^^^
95s E RuntimeError: wrapped C/C++ object of type Console has
been deleted
95s
95s
/usr/lib/python3/dist-packages/guidata/widgets/console/mixins.py:202:
RuntimeError
95s =============================== warnings summary
===============================
95s tests/widgets/test_theme.py:71
95s
/tmp/autopkgtest-lxc.auymuc0z/downtmp/autopkgtest_tmp/tests/widgets/test_theme.py:71:
PytestCollectionWarning: cannot collect test class 'TestWidget' because
it has a __init__ constructor (from: tests/widgets/test_theme.py)
95s class TestWidget(BaseTestWidget):
95s
95s -- Docs:
https://docs.pytest.org/en/stable/how-to/capture-warnings.html
95s =========================== short test summary info
============================
95s FAILED
tests/widgets/test_collectionseditor.py::test_collectionseditor - Type...
95s FAILED tests/widgets/test_console.py::test_console - RuntimeError:
wrapped C/...
95s ============== 2 failed, 35 passed, 3 skipped, 1 warning in 1.54s
==============
96s autopkgtest [09:25:31]: test command1: -----------------------]
More information about the debian-science-maintainers
mailing list