diff options
author | Gregory P. Smith <greg@krypto.org> | 2023-09-23 05:04:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 05:04:20 (GMT) |
commit | 5e7ea95d9d5c3b80a67ffbeebd76ce4fc327dd8e (patch) | |
tree | 3d36f943c6549c2aee80e8690b90e571cfcd049f /Doc/whatsnew/3.12.rst | |
parent | 0d20fc7477a21328dd353071eaa06384bb818f7b (diff) | |
download | cpython-5e7ea95d9d5c3b80a67ffbeebd76ce4fc327dd8e.zip cpython-5e7ea95d9d5c3b80a67ffbeebd76ce4fc327dd8e.tar.gz cpython-5e7ea95d9d5c3b80a67ffbeebd76ce4fc327dd8e.tar.bz2 |
gh-100228: Document the os.fork threads DeprecationWarning. (#109767)
Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs.
Many reviews and doc cleanup edits by Adam & Hugo. 🥳
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Diffstat (limited to 'Doc/whatsnew/3.12.rst')
-rw-r--r-- | Doc/whatsnew/3.12.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 4ee8797..22538a4 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1065,6 +1065,18 @@ Deprecated contain the creation time, which is also available in the new ``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.) +* :mod:`os`: On POSIX platforms, :func:`os.fork` can now raise a + :exc:`DeprecationWarning` when it can detect being called from a + multithreaded process. There has always been a fundamental incompatibility + with the POSIX platform when doing so. Even if such code *appeared* to work. + We added the warning to to raise awareness as issues encounted by code doing + this are becoming more frequent. See the :func:`os.fork` documentation for + more details. + + When this warning appears due to usage of :mod:`multiprocessing` or + :mod:`concurrent.futures` the fix is to use a different + :mod:`multiprocessing` start method such as ``"spawn"`` or ``"forkserver"``. + * :mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit Katriel in :gh:`102828`.) |