GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-137210: Add a struct, slot & function for checking an extension's ABI by encukou · Pull Request #137212 · python/cpython

Conversation

@encukou

@encukou encukou commented Jul 29, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

See the issue.

  • Issue: Add a struct, slot & function for checking an extension's ABI #137210

📚 Documentation preview 📚: https://cpython-previews--137212.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
encukou added 9 commits July 29, 2025 17:13
@encukou
Add _PyUnicodeWriter_FormatV
894ef3d
@encukou
Add capi test file for modsupport
72349ba
@encukou
Add PyABIInfo
3b6aa96
@encukou
Add _Py_INTERNAL_ABI_SLOT (to _datetime for now)
c015606
@encukou
Add docs
c5740af
@encukou
Add to limited API manifest
da293e3
@encukou
Un-document PyABIInfo_FREETHREADING_AGNOSTIC for now
44df416
@encukou
Blurb & What's New
feb428d
@encukou
Fix docs
aa1eb4a
@encukou
encukou requested review from a team, abalkin, corona10, ericsnowcurrently, erlend-aasland and pganssle as code owners July 29, 2025 16:21
@bedevere-app bedevere-app Bot added the awaiting core review label Jul 29, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jul 29, 2025
Add a struct, slot & function for checking an extension's ABI #137210
Closed
@encukou
Remove duplicated test
b628d7d
@encukou encukou mentioned this pull request Jul 29, 2025
Add a struct, slot & function for checking an extension's ABI capi-workgroup/decisions#72
Closed
zooba
zooba reviewed Jul 29, 2025
View reviewed changes
Comment thread Doc/c-api/stable.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/stable.rst
Comment on lines +329 to +330
(except if :c:macro:`Py_LIMITED_API` is ``3``; use
:c:expr:`Py_PACK_VERSION(3, 2)` in that case).

@zooba zooba Jul 29, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems easier for us to just check this on our side than to expect users to get it right?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@zooba zooba Jul 29, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And isn't the legacy value 1 rather than 3?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@encukou encukou Jul 30, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, users should use PyABIInfo_DEFAULT_ABI_VERSION or PyABIInfo_VAR -- those are our side too.
I prefer the data to be simpler, but if you want, we can keep the exception in.

The legacy value is 3. (Not that it matters that much; it's always compared to a Python version.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/stable.rst
Specifies ABI specific to a particular build of CPython.
Internal use only.

Free-threading compatibility -- one of:

@zooba zooba Jul 29, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're still planning to get rid of these options once FT is merged, right? Maybe we ought to use abiflags here (i.e. a string) instead, for future extensibility? This isn't going to be checked anywhere that it needs to be bitflags.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@encukou encukou Jul 30, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you encode being compatible with both GIL and FT?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@encukou encukou Jul 30, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we can remove them when there are no GIL-only extensions around any more. That would be a lot of time after FT is the only option.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Include/modsupport.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Include/modsupport.h Outdated
#endif /* New in 3.5 */

/* ABI info & checking (new in 3.15) */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 15)

@zooba zooba Jul 29, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are all of these warnings about? Does _Py_PACK_VERSION do something funky?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@encukou encukou Jul 30, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. I'll need to check on a Windows box.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@encukou encukou Aug 7, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to figure it out. Something seems to be compiling modsupport.h outside of Python.h -- that is, without pymacro.h being included first: I get an error if I add this before the line:

#ifndef Py_PYMACRO_H
#error this should not happen
#endif

The error is currently quite impenetrable to me:

       ResourceCompile:
         C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\rc.exe /D "ORIGINAL_FILENAME=\\\"python315_d.dll\\\"" /D FIELD3=100 /D _DEBUG /l"0x0409" /IC:\Users\encukou\dev\cpython\PC /IC:\Users\encu 
         kou\dev\cpython\Include /IC:\Users\encukou\dev\cpython\PCbuild\obj\315amd64_Debug\pythoncore\ /nologo /fo"C:\Users\encukou\dev\cpython\PCbuild\obj\315amd64_Debug\pythoncore\python_nt.res" ..\PC\pyth 
         on_nt.rc
     3>C:\Users\encukou\dev\cpython\Include\modsupport.h(98): error RC2188: C:\Users\encukou\dev\cpython\PCbuild\obj\315amd64_Debug\pythoncore\RCa08340(52) : fatal error RC1116: RC terminating after preproce
       ssor errors [C:\Users\encukou\dev\cpython\PCbuild\pythoncore.vcxproj]

     3>Done Building Project "C:\Users\encukou\dev\cpython\PCbuild\pythoncore.vcxproj" (Build target(s)) -- FAILED.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@zooba zooba Aug 11, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it's being referenced from PC\python_ver_rc.h, which runs under the resource compiler rather than the C compiler. It's pretty much entirely compatible, but occasionally has some obscure/subtle differences.

I think it's just bypassing a lot of unnecessary includes here, assuming that modsupport.h stands alone. If that's not true, then the header needs updating and whatever constant it's referencing will have to move elsewhere.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@encukou encukou Aug 26, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched this PR to use 0x030f0000; I plan to switch to _Py_PACK_VERSION(3, 15) in a follow-up PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
encukou and others added 4 commits July 30, 2025 09:37
@encukou @zooba
Apply suggestions from code review
4800a5d
Co-authored-by: Steve Dower <[email protected]>
@encukou
Casts to avoid data loss warnings
4c9e918
@encukou
Use hex literal for 3.15
1b18761
@encukou
Merge in the main branch
814ac60
@encukou
encukou requested a review from AA-Turner as a code owner August 7, 2025 11:52
encukou added 4 commits August 26, 2025 11:21
@encukou
Merge in the main branch
f6f5b1d
@encukou
Add example of intended usage before the API documentation
2644080
@encukou
Restore changelog / comments for PYTHON_API_VERSION
cb0309f
@encukou
Merge branch 'main' into abiinfo-slot
7492e16
@encukou
encukou merged commit 0c74fc8 into python:main Sep 5, 2025
befeleme added a commit to befeleme/cpython that referenced this pull request Feb 9, 2026
@encukou @befeleme
00477: Raise an error when importing modules compiled for an older Py…
73b4b0b
…thon

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to befeleme/cpython that referenced this pull request Feb 9, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
6176ab6
…fferent Python

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to befeleme/cpython that referenced this pull request Feb 9, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
70108fb
…fferent Python

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to befeleme/cpython that referenced this pull request Feb 9, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
d3057db
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to befeleme/cpython that referenced this pull request Feb 9, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
d1f8902
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Feb 9, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
8c71d69
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Mar 26, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
665b7a2
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Mar 26, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
e572cac
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hrnciar pushed a commit to fedora-python/cpython that referenced this pull request Apr 8, 2026
@encukou @befeleme @hrnciar
00477: Raise an error when importing stdlib modules compiled for a di…
b55c2d9
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
stratakis pushed a commit to stratakis/cpython that referenced this pull request Apr 16, 2026
@encukou @befeleme @stratakis
00477: Raise an error when importing stdlib modules compiled for a di…
5ced795
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Apr 16, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
22fdb4b
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Apr 16, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
271ab0c
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Apr 17, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
4cdc29b
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request May 5, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
9327226
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request May 11, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
e057311
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Jun 11, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
d8fc6b6
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Jun 11, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
2cdbccb
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hrnciar pushed a commit to fedora-python/cpython that referenced this pull request Jul 10, 2026
@encukou @befeleme @hrnciar
00477: Raise an error when importing stdlib modules compiled for a di…
3844e4b
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Aug 12, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
8856587
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Aug 12, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
4ab11bf
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Aug 13, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
749a773
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Aug 13, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
a0ca88e
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Aug 18, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
525b5f1
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Aug 20, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
3611ac4
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Oct 1, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
a196f87
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Oct 1, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
12ba8ae
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Oct 22, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
dbba753
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Oct 22, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
b003cad
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Oct 26, 2026
@encukou @befeleme @hroncok
00477: Raise an error when importing stdlib modules compiled for a di…
4351ac5
…fferent Python version

This is a downstream workaround "implementing" python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
befeleme added a commit to fedora-python/cpython that referenced this pull request Oct 26, 2026
@encukou @befeleme
00477: Raise an error when importing stdlib modules compiled for a di…
683a6ba
…fferent Python version

This is a downstream workaround "implementing"
python#137212 -
the mechanism for the check exists in Python 3.15+, where it needs to be
added to the standard library modules.
In Fedora, we need it also in previous Python versions, as we experience
segmentation fault when importing stdlib modules after update while
Python is running.

_tkinter, _tracemalloc and readline are not calling PyModuleDef_Init,
which is modified with this patch, hence they need a
direct call to the check function.

Co-Authored-By: Karolina Surma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@zooba zooba zooba left review comments
@ZeroIntensity ZeroIntensity ZeroIntensity left review comments
@pganssle pganssle Awaiting requested review from pganssle pganssle is a code owner
@abalkin abalkin Awaiting requested review from abalkin
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@corona10 corona10 Awaiting requested review from corona10 corona10 is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@encukou @zooba @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.