Bug 2359815 - python-pikepdf fails to build with Python 3.14: Test failures related to refcounting
Summary: python-pikepdf fails to build with Python 3.14: Test failures related to refc...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pikepdf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Elliott Sales de Andrade
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2025-04-15 17:45 UTC by Karolina Surma
Modified: 2025-06-11 22:43 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pikepdf pikepdf issues 655 0 None open refcount tests fail with Python 3.14.0a7 + b1 2025-06-11 22:43:57 UTC

Description Karolina Surma 2025-04-15 17:45:53 UTC
python-pikepdf fails to build with Python 3.14.0a7.

__________________________ test_copy_foreign_refcount __________________________
[gw1] linux -- Python 3.14.0 /usr/bin/python3

refcount = <built-in function getrefcount>
vera = <pikepdf.Pdf description='/builddir/build/BUILD/python-pikepdf-9.5.2-build/pikepdf-9.5.2/tests/resources/veraPDF test suite 6-2-10-t02-pass-a.pdf'>
outlines = <pikepdf.Pdf description='/builddir/build/BUILD/python-pikepdf-9.5.2-build/pikepdf-9.5.2/tests/resources/outlines.pdf'>

    def test_copy_foreign_refcount(refcount, vera, outlines):
>       assert refcount(outlines.Root.Names) == 2
E       assert 1 == 2
E        +  where 1 = <built-in function getrefcount>(<pikepdf.Dictionary({\n  "/Dests": {\n    "/Kids": [ {\n      "/Limits": [ "0", "1" ],\n      "/Names": [ "0", [ <Pdf.page...29'), Decimal('607.2'), None ] ]\n    }, {\n      "/Limits": [ "4", <...> ],\n      "/Names": <...>\n    }, <...> ]\n  }\n})>)
E        +    where <pikepdf.Dictionary({\n  "/Dests": {\n    "/Kids": [ {\n      "/Limits": [ "0", "1" ],\n      "/Names": [ "0", [ <Pdf.page...29'), Decimal('607.2'), None ] ]\n    }, {\n      "/Limits": [ "4", <...> ],\n      "/Names": <...>\n    }, <...> ]\n  }\n})> = <pikepdf.Dictionary(Type="/Catalog")({\n  "/Names": {\n    "/Dests": {\n      "/Kids": [ {\n        "/Limits": [ "0", "1" .../UseOutlines",\n  "/Pages": {\n    "/Count": <...>,\n    "/Kids": <...>,\n    "/Type": <...>\n  },\n  "/Type": "/Catalog"\n})>.Names
E        +      where <pikepdf.Dictionary(Type="/Catalog")({\n  "/Names": {\n    "/Dests": {\n      "/Kids": [ {\n        "/Limits": [ "0", "1" .../UseOutlines",\n  "/Pages": {\n    "/Count": <...>,\n    "/Kids": <...>,\n    "/Type": <...>\n  },\n  "/Type": "/Catalog"\n})> = <pikepdf.Pdf description='/builddir/build/BUILD/python-pikepdf-9.5.2-build/pikepdf-9.5.2/tests/resources/outlines.pdf'>.Root

tests/test_foreign.py:102: AssertionError
_______________________ TestStream.test_stream_refcount ________________________
[gw1] linux -- Python 3.14.0 /usr/bin/python3

self = <test_object.TestStream object at 0x7f981e890500>
refcount = <built-in function getrefcount>
outpdf = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_stream_refcount0/out.pdf')

    def test_stream_refcount(self, refcount, outpdf):
        pdf = pikepdf.new()
        stream = Stream(pdf, b'blahblah')
>       assert refcount(stream) == 2
E       assert 1 == 2
E        +  where 1 = <built-in function getrefcount>(<pikepdf.Stream(owner=<...>, data=b'blahblah', {\n  "/Length": 8\n})>)

tests/test_object.py:595: AssertionError
___________________________ test_evil_page_deletion ____________________________
[gw1] linux -- Python 3.14.0 /usr/bin/python3

refcount = <built-in function getrefcount>
resources = PosixPath('/builddir/build/BUILD/python-pikepdf-9.5.2-build/pikepdf-9.5.2/tests/resources')
outdir = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_evil_page_deletion0')

    def test_evil_page_deletion(refcount, resources, outdir):
        copy(resources / 'sandwich.pdf', outdir / 'sandwich.pdf')
    
        src = Pdf.open(outdir / 'sandwich.pdf')  # no with clause
        pdf = Pdf.open(resources / 'graph.pdf')
    
>       assert refcount(src) == 2
E       AssertionError: assert 1 == 2
E        +  where 1 = <built-in function getrefcount>(<pikepdf.Pdf description='/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_evil_page_deletion0/sandwich.pdf'>)


https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8905534/

For all our attempts to build python-pikepdf with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-pikepdf/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.


Note You need to log in before you can comment on or make changes to this bug.