cpython
cpython copied to clipboard
The Python programming language
This would have prevented the issue introduced in gh-138732 by catching the missing safe escape code: * Issue: gh-143394
**Summary** - Add free-threading regression coverage for `binascii` (gh-116738). - Assert that importing `binascii` does not enable the GIL when running with `-X gil=0`. - Add a multi-thread stress test...
Make the attributes in `lzma` module thread-safe on the free-threading build. Attributes (`check`, `eof`, `needs_input`, `unused_data`) are now stored atomically or accessed via mutex-protected getters. Even though the operations are...
The PyObject header reference count fields must be initialized using atomic operations because they may be concurrently read by another thread (e.g., from `_Py_TryIncref`). * Issue: gh-132070
# Bug report It's not safe to call `with self.subTest` from multiple threads concurrently. (See https://github.com/python/cpython/issues/131677) ``` ====================================================================== ERROR: test_ssl_in_multiple_threads (test.test_ssl.ThreadedTests.test_ssl_in_multiple_threads) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/pull_request.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/test/test_ssl.py", line...
### What happened? A custom `__length_hint__` can report zero to `bytearray_extend`, so it reuses the shared `_PyByteArray_empty_string`. The fill loop then writes user bytes into that static buffer, removing its...
When `__length_hint__()` returns 0 for non-empty iterator, the data can be written past the shared 0-terminated buffer, corrupting it. (cherry picked from commit 522563549a49d28e763635c58274a23a6055f041) * Issue: gh-143003
# Bug report Thread sanitizer reports a number of data races when running subinterpreter tests ### `InterpreterPoolMixin` (`test_concurrent_futures`) - [ ] `run_eval_code_obj`: see https://github.com/python/cpython/issues/128130 - [ ] [`posixmodule_exec`](https://github.com/python/cpython/blob/49bd47d5f14993d37b97aa2bbf257f5df16b96a9/Modules/posixmodule.c#L18014) modifies globals...
When __length_hint__() returns 0 for non-empty iterator, the data can be written past the shared 0-terminated buffer, corrupting it. (cherry picked from commit 522563549a49d28e763635c58274a23a6055f041) * Issue: gh-143003
Initialize the PyExc_OSError aliases statically to avoid data races. * Issue: gh-129824