Bug 2479755 - python-stdnum fails to build with Python 3.15: test failures related to changes in pprint output
Summary: python-stdnum fails to build with Python 3.15: test failures related to chang...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python-stdnum
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Horák
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2026-05-19 08:42 UTC by Karolina Surma
Modified: 2026-05-25 13:38 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-05-25 12:25:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2026-05-19 08:42:28 UTC
python-stdnum fails to build with Python 3.15.0b1.

____________________________ [doctest] stdnum.numdb ____________________________
046 [('0', {'prop1': 'foo'}), ('200', {'prop2': 'bar', 'prop3': 'baz'}), ('6', {})]
047 >>> pprint.pprint(dbfile.info('03456'))
048 [('0', {'prop1': 'foo'}), ('345', {'prop2': 'bar', 'prop3': 'baz'}), ('6', {})]
049 >>> pprint.pprint(dbfile.info('902006'))
050 [('90', {'prop1': 'booz'}), ('20', {'prop2': 'foo'}), ('06', {})]
051 >>> pprint.pprint(dbfile.info('909856'))
052 [('90', {'prop1': 'booz'}), ('985', {'prop2': 'fooz'}), ('6', {})]
053 >>> pprint.pprint(dbfile.info('9889'))
054 [('98', {'prop1': 'booz'}), ('89', {'prop2': 'foo'})]
055 >>> pprint.pprint(dbfile.info('633322'))
Expected:
    [('6', {'prop1': 'boo'}), ('333', {'prop2': 'bar', 'prop3': 'baz', 'prop4': 'bla'}), ('22', {})]
Got:
    [
        ('6', {'prop1': 'boo'}),
        ('333', {'prop2': 'bar', 'prop3': 'baz', 'prop4': 'bla'}),
        ('22', {}),
    ]

/builddir/build/BUILD/python-stdnum-2.2-build/python-stdnum-2.2/stdnum/numdb.py:55: DocTestFailure

https://docs.python.org/3.15/whatsnew/3.15.html:
pprint now uses modern defaults: indent=4, width=88, and the default compact=False output is now formatted similar to pretty-printed json.dumps(). (Contributed by Stefan Todoran, Semyon Moroz and Hugo van Kemenade in gh-112632 and gh-149189.)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15-b1/fedora-rawhide-x86_64/10477977-python-stdnum/

For all our attempts to build python-stdnum with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15-b1/package/python-stdnum/

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.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15-b1/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
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.

Comment 1 Karolina Surma 2026-05-25 08:16:51 UTC
This will be reverted in beta2: https://github.com/python/cpython/pull/150249 - I'll close the issue once verified.

Comment 2 Dan Horák 2026-05-25 12:48:28 UTC
Is there a way a user of the pprint module can stay compatible with future changes? I suppose upstream will attempt to change the defaults some time in future again.

Comment 3 Miro Hrončok 2026-05-25 13:25:39 UTC
My understanding is that they are reverting this exactly *not* to do that. There is no plan to change this in Python 3.16+. Instead, either they will change pprint.pp or introduce a new pprint function with new defaults (e.g. pprint2 or pprint_whatever).

Comment 4 Dan Horák 2026-05-25 13:38:00 UTC
Thanks for the info, Miro.


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