Repository navigation
[3.14] gh-158893: Make os.strerror() thread-safe (#159120) - #159145
Merged
Merged
Conversation
* pythongh-157695: Parse also _Py_HAVE_xxx variables in sysconfig (python#158926) Add parse_config_h() tests to test_sysconfig. (cherry picked from commit 978a8be) * pythongh-158893: Make os.strerror() thread-safe (python#158927) Make os.strerror() thread-safe: use the reentrant strerror_r() function if available. * The configure script now checks if strerror_r() is supported. * Add a stress test to test_free_threading.test_os (new module). * Add a comment on decode_current_locale() assertion which fails if the input string is mutated. * Add an assertion to _Py_DecodeLocale() to detect if the input string was mutated during the function call. * pythongh-158893: Add internal _Py_strerror() function (python#158982) Add a new internal _Py_strerror() function to Python/fileutils.c. It uses strerror_r() if available, or use strerror() otherwise. Replace all strerror(code) calls with _Py_strerror(code). (cherry picked from commit 15dd735) (cherry picked from commit c774d15)
vstinner
requested review from
FFY00,
corona10,
erlend-aasland and
pablogsal
as code owners
October 10, 2026 20:25
This was referenced Oct 10, 2026
vstinner
enabled auto-merge (squash)
October 10, 2026 20:25
Member
Author
|
Note: the sysconfig backport doesn't strip quotes from variables (no behavior change), it's different from 3.15 and main branches. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Py#157695: Parse also _Py_HAVE_xxx variables in sysconfig (gh-157695: Parse also _Py_HAVE_xxx variables in sysconfig #158926)Add parse_config_h() tests to test_sysconfig.
(cherry picked from commit 978a8be)
Make os.strerror() thread-safe: use the reentrant strerror_r() function if available.
The configure script now checks if strerror_r() is supported.
Add a stress test to test_free_threading.test_os (new module).
Add a comment on decode_current_locale() assertion which fails if the input string is mutated.
Add an assertion to _Py_DecodeLocale() to detect if the input string was mutated during the function call.
Calling os.strerror() in parallel is not thread safe on FreeBSD #158893: Add internal _Py_strerror() function (gh-158893: Add internal _Py_strerror() function #158982)
Add a new internal _Py_strerror() function to Python/fileutils.c. It uses strerror_r() if available, or use strerror() otherwise.
Replace all strerror(code) calls with _Py_strerror(code).
(cherry picked from commit 15dd735) (cherry picked from commit c774d15)