Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Nov 13, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )


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

cho-m and others added 3 commits November 12, 2025 22:16
* gh-137109: refactor warning about threads when forking

This splits the OS API specific functionality to get the number of threads out
from the fallback Python method and warning raising code itself.  This way the
OS APIs can be queried before we've run
`os.register_at_fork(after_in_parent=...)` registered functions which
themselves may (re)start threads that would otherwise be detected.

This is best effort.  If the OS APIs are either unavailable or fail, the
warning generating code still falls back to looking at the Python threading
state after the CPython interpreter world has been restarted and the
after_in_parent calls have been made.  The common case for most Linux and macOS
environments should work today.

This also lines up with the existing TODO refactoring, we may choose to expose
this API to get the number of OS threads in the `os` module in the future.

* NEWS entry

* avoid "function-prototype" compiler warning?
@pull pull bot locked and limited conversation to collaborators Nov 13, 2025
@pull pull bot added the ⤵️ pull label Nov 13, 2025
@pull pull bot merged commit 781cc68 into TechPenguineer:main Nov 13, 2025
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants