🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.rc
Article #1204

Bug#1151509: autopkg test failure with pillow 13.0.0

#1204
From: Matthias Klose
Date: Wed, 21 Oct 2026 07:00
157 lines
8748 bytes
Package: src:fpdf2
Version: 2.8.9-1
Severity: serious
Tags: sid forky

autopkg test failure seen with pillow 13.0.0:

[...]
=================================== FAILURES 
===================================
269s _____________________ test_image_with_explicit_dimensions 
______________________
269s
269s tmp_path = 
PosixPath('/tmp/pytest-of-test/pytest-0/test_image_with_explicit_dimen0')
269s
269s     def test_image_with_explicit_dimensions(tmp_path):
269s         pdf = FPDF()
269s         pdf.set_margin(0)
269s         pdf.add_page()
269s         pdf.image(
269s             HERE / "png_images/6c853ed9dacd5716bc54eb59cec30889.png",
269s             w=pdf.epw,
269s             dims=(500, 500),
269s         )
269s >       assert_pdf_equal(pdf, HERE / 
"image_with_explicit_dimensions.pdf", tmp_path)
269s
269s test/image/test_full_page_image.py:54:
269s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _
269s
269s actual = <fpdf.fpdf.FPDF object at 0x7f55b2f8a900>
269s expected = 
PosixPath('/tmp/autopkgtest.OAzmCQ/build.cKt/src/test/image/image_with_explicit_dimensions.pdf')
269s tmp_path = 
PosixPath('/tmp/pytest-of-test/pytest-0/test_image_with_explicit_dimen0')
269s linearize = False, at_epoch = True, generate = False, 
ignore_id_changes = False
269s ignore_original_obj_ids = False, ignore_xref_offsets = False
269s
269s     def assert_pdf_equal(
269s         actual,
269s         expected,
269s         tmp_path,
269s         linearize=False,
269s         at_epoch=True,
269s         generate=False,
269s         ignore_id_changes=False,
269s         ignore_original_obj_ids=False,
269s         ignore_xref_offsets=False,
269s     ):
269s         """
269s         This compare the output of a `FPDF` instance (or `Template` 
instance),
269s         with the provided PDF file.
269s
269s         The `CreationDate` of the newly generated PDF is fixed, so 
that it never triggers
269s         a diff.
269s
269s         If the `qpdf` command is available on the `$PATH`, it will 
be used to perform the
269s         comparison, as it greatly helps debugging diffs. Otherwise, 
a hash-based comparison
269s         logic is used as a fallback.
269s
269s         Args:
269s             actual: instance of `FPDF` or `Template`. The `output` 
or `render` method
269s               will be called on it.
269s             expected: instance of `FPDF`, `bytearray` or file path 
to a PDF file
269s               matching the expected output
269s             tmp_path (Path): temporary directory provided by pytest 
individually to the
269s               caller test function
269s             generate (bool): only generate `pdf` output to 
`rel_expected_pdf_filepath`
269s               and return. Useful to create new tests.
269s         """
269s         if isinstance(actual, Template):
269s             actual.render()
269s             actual_pdf = actual.pdf
269s         else:
269s             actual_pdf = actual
269s         if at_epoch:
269s             actual_pdf.creation_date = EPOCH
269s         if generate:
269s             assert isinstance(expected, pathlib.Path), (
269s                 "When passing `True` to `generate`"
269s                 "a pathlib.Path must be provided as the `expected` 
parameter"
269s             )
269s             actual_pdf.output(expected.open("wb"), linearize=linearize)
269s             return
269s         # Force ignore_id_changes when Python is linked against 
zlib-ng,
269s         # as the compressed data is not 100% identical to standard 
zlib.
269s         # https://github.com/python/cpython/pull/131438
269s         if USING_ZLIB_NG and QPDF_AVAILABLE:
269s             ignore_id_changes = True
269s         if isinstance(expected, pathlib.Path):
269s             expected_pdf_path = expected
269s         else:
269s             expected_pdf_path = tmp_path / "expected.pdf"
269s             with expected_pdf_path.open("wb") as pdf_file:
269s                 if isinstance(expected, (bytes, bytearray)):
269s                     pdf_file.write(expected)
269s                 else:
269s                     expected.set_creation_date(EPOCH)
269s                     expected.output(pdf_file, linearize=linearize)
269s         actual_pdf_path = tmp_path / "actual.pdf"
269s         with actual_pdf_path.open("wb") as pdf_file:
269s             actual_pdf.output(pdf_file, linearize=linearize)
269s         if QPDF_AVAILABLE:  # Favor qpdf-based comparison, as it 
helps a lot debugging:
269s             actual_qpdf = _qpdf(actual_pdf_path)
269s             expected_qpdf = _qpdf(expected_pdf_path)
269s             (tmp_path / "actual_qpdf.pdf").write_bytes(actual_qpdf)
269s             (tmp_path / "expected_qpdf.pdf").write_bytes(expected_qpdf)
269s             actual_lines = actual_qpdf.splitlines()
269s             expected_lines = expected_qpdf.splitlines()
269s             if ignore_id_changes:
269s                 actual_lines = filter_out_doc_id(actual_lines)
269s                 expected_lines = filter_out_doc_id(expected_lines)
269s             if ignore_original_obj_ids:
269s                 actual_lines = 
filter_out_original_obj_ids(actual_lines)
269s                 expected_lines = 
filter_out_original_obj_ids(expected_lines)
269s             if ignore_xref_offsets:
269s                 actual_lines = filter_out_xref_offsets(actual_lines)
269s                 expected_lines = 
filter_out_xref_offsets(expected_lines)
269s             if actual_lines != expected_lines:
269s                 # It is important to reduce the size of both list 
of bytes here,
269s                 # to avoid .assertSequenceEqual to take forever to 
finish, that itself calls difflib.ndiff,
269s                 # that has cubic complexity from this comment by 
Tim Peters: https://bugs.python.org/issue6931#msg223459
269s                 actual_lines = subst_streams_with_hashes(actual_lines)
269s                 expected_lines = 
subst_streams_with_hashes(expected_lines)
269s >           assert actual_lines == expected_lines
269s E           assert [b'%PDF-1.3',...1 0 obj', ...] == 
[b'%PDF-1.3',...1 0 obj', ...]
269s E
269s E             At index 99 diff: 
b"\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2}\xc0\xa2~\xc0\xa2~\xc0\xa2}\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2}\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa2~\xc0\xa...
269s E
269s E             ...Full output truncated (93558 lines hidden), use 
'-vv' to show
269s
269s test/conftest.py:172: AssertionError
Technical Details
Message-ID: <NQysN-6VHC-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Matthias Klose <doko@debian.org>
Newsgroups: linux.debian.bugs.rc
Subject: Bug#1151509: autopkg test failure with pillow 13.0.0
Date: Wed, 21 Oct 2026 09:00:01 +0200
Message-ID: <NQysN-6VHC-3@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-rc-request@lists.debian.org  Wed Oct 21 06:55:11 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.9
Reply-To: Matthias Klose <doko@debian.org>, 1151509@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: team+python@tracker.debian.org
X-Debian-Pr-Message: report 1151509
X-Debian-Pr-Package: src:fpdf2
X-Debian-Pr-Keywords: forky sid
X-Debian-Pr-Source: fpdf2
Old-X-Envelope-From: doko@debian.org
Old-X-Envelope-To: <submit@bugs.debian.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-rc@lists.debian.org> archive/latest/835334
List-ID: <debian-bugs-rc.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-rc/>
Approved: robomod@news.nic.it
Lines: 157
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 21 Oct 2026 08:54:23 +0200
X-Original-Message-ID: <c286a9da-fd81-4d20-813b-67c78d28d00d@debian.org>