Bug 2424297 - python-tomli fails to build with Python 3.15: /usr/lib/python3.15/site-packages/mypyc/lib-rt/pythonsupport.h:125:5: error: ‘_PyObject_GetAttrId’ is deprecated
Summary: python-tomli fails to build with Python 3.15: /usr/lib/python3.15/site-packag...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-tomli
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2025-12-22 14:31 UTC by Karolina Surma
Modified: 2026-04-09 09:11 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-04-09 09:11:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-tomli pull-request 28 0 None None None 2026-04-08 14:54:36 UTC

Description Karolina Surma 2025-12-22 14:31:08 UTC
python-tomli fails to build with Python 3.15.0a3.

This looks like it may not be an issue in tomli, but rather python-mypy?

  In file included from /usr/lib/python3.15/site-packages/mypyc/lib-rt/CPy.h:12,
                   from /usr/lib/python3.15/site-packages/mypyc/lib-rt/init.c:2,
                   from build/__native_5703180c3dd46e872cf3.c:1:
  /usr/lib/python3.15/site-packages/mypyc/lib-rt/pythonsupport.h: In function ‘init_subclass’:
  /usr/lib/python3.15/site-packages/mypyc/lib-rt/pythonsupport.h:125:5: error: ‘_PyObject_GetAttrId’ is deprecated [-Werror=deprecated-declarations]
    125 |     func = _PyObject_GetAttrId(super, &PyId___init_subclass__);
  In file included from build/__native_5703180c3dd46e872cf3.c:7:
  /usr/lib/python3.15/site-packages/mypyc/lib-rt/bytes_ops.c: In function ‘CPyBytes_Join’:
  /usr/lib/python3.15/site-packages/mypyc/lib-rt/bytes_ops.c:105:9: error: ‘_PyUnicode_FromId’ is deprecated [-Werror=deprecated-declarations]
    105 |         PyObject *name = _PyUnicode_FromId(&PyId_join); /* borrowed */
        |         ^~~~~~~~
  In file included from build/__native_5703180c3dd46e872cf3.c:8:
  /usr/lib/python3.15/site-packages/mypyc/lib-rt/list_ops.c: In function ‘CPyList_Clear’:
  /usr/lib/python3.15/site-packages/mypyc/lib-rt/list_ops.c:37:9: error: ‘_PyUnicode_FromId’ is deprecated [-Werror=deprecated-declarations]
     37 |         PyObject *name = _PyUnicode_FromId(&PyId_clear);
        |         ^~~~~~~~


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

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

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

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/

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 Miro Hrončok 2026-01-09 23:21:45 UTC
As a workaround, build --without mypyc.

Anyway, this might need a fix in mypy.

Comment 2 Victor Stinner 2026-02-04 13:18:03 UTC
> Anyway, this might need a fix in mypy.

mypy has been updated to avoid deprecated C APIs:
https://github.com/python/mypy/commit/c41dbd00718c1e873b7797ed7bf00126fd544df5

There is no release yet including this change.

Comment 3 Miro Hrončok 2026-02-09 17:35:48 UTC
That patch touches files that don't even exist in what we have packaged. I am waiting this out.

If desired, we can change the tomli bcond to be dependent on Python version.

Comment 4 Miro Hrončok 2026-04-08 14:54:37 UTC
I decided to disable mypyc on 3.15 in the spec file so we don't have to deal with this now. https://src.fedoraproject.org/rpms/python-tomli/pull-request/28


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