cpython/Modules
Neil Schemenauer cdba68e563
[3.15] gh-159136: Avoid stop-the-world when setting function name attributes (gh-159269) (gh-159725)
Setting __name__, __qualname__, __doc__ or __module__ on a function
stopped the world in the free-threaded build since gh-154826 and
gh-154851, making functools.wraps() orders of magnitude slower with
multiple threads.

Use the per-object critical section and _PyObject_XSetRefDelayed()
instead, as gen_set_name() already does.  Use acquire loads in the
readers and hold strong references across error reporting, tracing, and
eval-frame recording that may execute Python or detach the thread.  The
__code__, __defaults__, __kwdefaults__ and __closure__ setters still
stop the world to clear func_version.

Document synchronization requirements for direct field access and the
lifetime of borrowed function attributes.

(cherry picked from commit 010bebbf9f)
2026-10-29 15:17:50 -07:00
..
_ctypes [3.15] Fix ignored error returns in sys initialization, _ctypes and _interpchannels (GH-160614) (#160711) 2026-10-26 19:49:41 +00:00
_decimal
_hacl
_io [3.15] gh-160781: Fix StringIO.truncate() rejecting sizes above 2**31 - 1 on Windows (GH-160784) (#160918) 2026-10-29 20:11:09 +00:00
_multiprocessing
_remote_debugging [3.15] gh-159739: Avoid destroying a remote unwinder cache twice (GH-159982) (#160023) 2026-10-21 11:53:05 -07:00
_sqlite [3.15] gh-159739: Keep SQLite list parameters alive while binding (GH-160192) (#160361) 2026-10-22 23:59:01 +00:00
_sre
_ssl [3.15] gh-160040: Distrust compromised eMudhra intermediate CA keys (CVE-2026-115557) (GH-160042) (#160568) 2026-10-24 00:17:15 -07:00
_testcapi [3.15] gh-159136: Avoid stop-the-world when setting function name attributes (gh-159269) (gh-159725) 2026-10-29 15:17:50 -07:00
_testinternalcapi [3.15] gh-151818: Fix double-free in _CALL_LIST_APPEND on allocation failure (GH-151826) (#160200) 2026-10-22 06:23:06 -07:00
_testlimitedcapi [3.15] gh-158585: Fix _PyBytes_Resize() if hash value is already computed (#159555) 2026-10-16 16:55:09 +00:00
_xxtestfuzz
_zstd [3.15] gh-160549: Fix crash when freeing a busy multi-threaded ZstdCompressor (GH-160550) (#160637) 2026-10-25 06:46:30 +00:00
cjkcodecs [3.15] gh-151126: Set MemoryError on allocation failure in CJK codec macros (GH-156292) (#160674) 2026-10-25 18:15:03 +00:00
clinic [3.15] gh-159739: Guard cProfile against reentry while processing an external timer (GH-160405) (#160566) 2026-10-24 13:44:10 -07:00
expat [3.15] gh-158876: Update bundled Expat to 2.9.0 (GH-158881) (#159921) 2026-10-20 18:49:27 +00:00
_abc.c [3.15] gh-159739: Keep the instance type alive during ABC subclass checks (GH-160198) (#160489) 2026-10-24 13:44:26 -07:00
_asynciomodule.c [3.15] gh-146065: Fix NULL dereference in FutureIter_am_send (GH-158468) (#159870) 2026-10-20 11:31:28 +00:00
_bisectmodule.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
_bz2module.c
_codecsmodule.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
_collectionsmodule.c [3.15] gh-159739: Preserve the full maxlen when copying deque subclasses (GH-159765) (#159896) 2026-10-20 11:18:12 -07:00
_csv.c gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106) 2026-04-11 15:18:02 -07:00
_curses_panel.c
_cursesmodule.c [3.15] gh-156953: Fix a reference leak in curses window.insnstr() (GH-156954) (GH-159108) 2026-10-10 10:44:59 +00:00
_datetimemodule.c [3.15] gh-159458: Fix free-threading data race in datetime strftime century normalization (GH-159520) (gh-159536) 2026-10-20 11:57:32 -07:00
_dbmmodule.c
_elementtree.c [3.15] Fix unchecked NULL returns in several C modules (GH-160213) (#160262) 2026-10-22 21:38:32 +01:00
_functoolsmodule.c
_gdbmmodule.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
_hashopenssl.c [3.15] gh-149816: fix a race when fetching OpenSSL digests (GH-153019) (#159997) 2026-10-21 01:44:09 +00:00
_heapqmodule.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
_interpchannelsmodule.c [3.15] Fix ignored error returns in sys initialization, _ctypes and _interpchannels (GH-160614) (#160711) 2026-10-26 19:49:41 +00:00
_interpqueuesmodule.c [3.15] gh-151763: Fix crash in _interpqueues.create on MemoryError (GH-152131) (#152158) 2026-06-25 07:32:24 +00:00
_interpreters_common.h
_interpretersmodule.c [3.15] gh-151126: Fix missing memory errors in _interpretersmodule.c (GH-151624) (#152169) 2026-06-25 10:35:45 +00:00
_json.c [3.15] gh-152052: Fix misleading json error for \uXXXX escape at the end of input (GH-152053) (#152283) 2026-06-26 14:15:21 +00:00
_localemodule.c [3.15] gh-155952: Fix <unrepresentable> Argument Clinic defaults in several signatures (GH-155954) (#156165) 2026-08-29 10:08:27 +03:00
_lsprof.c [3.15] gh-159739: Guard cProfile against reentry while processing an external timer (GH-160405) (#160566) 2026-10-24 13:44:10 -07:00
_lzmamodule.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
_math.h gh-122681: remove m_atan2()/c_atan2() helpers (#122715) 2024-08-17 13:48:16 +05:30
_opcode.c
_operator.c [3.15] gh-156762: Fix tp_clear slot signature for operator.methodcaller() (GH-156769) (#157448) 2026-09-15 16:43:57 +03:00
_pickle.c [3.15] gh-159739: Fully clear the unpickler memo (GH-160173) (#160328) 2026-10-22 15:22:04 -07:00
_posixsubprocess.c [3.15] gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404) (#151445) 2026-06-13 14:32:48 -07:00
_queuemodule.c [3.15] gh-159739: Keep SimpleQueue valid after buffer allocation fails (GH-160165) (#160288) 2026-10-22 15:20:17 -07:00
_randommodule.c [3.15] gh-149816: Fix a RC in _random.Random.__init__ method (GH-149824) (#149997) 2026-05-18 16:16:55 +00:00
_scproxy.c [3.15] gh-159739: Propagate macOS proxy conversion errors (GH-159750) (#159934) 2026-10-20 19:42:11 +00:00
_ssl.c [3.15] gh-160040: Distrust compromised eMudhra intermediate CA keys (CVE-2026-115557) (GH-160042) (#160568) 2026-10-24 00:17:15 -07:00
_ssl.h GH-103092: isolate _ssl (#104725) 2023-05-22 06:14:48 +05:30
_ssl_data_36.h [3.15] gh-156369: Update OpenSSL error ID data (GH-156380) (#156392) 2026-08-26 09:59:49 +09:00
_ssl_data_40.h
_ssl_data_111.h
_ssl_data_300.h [3.15] gh-156369: Update OpenSSL error ID data (GH-156380) (#156392) 2026-08-26 09:59:49 +09:00
_ssl_data_340.h gh-131423: Update OpenSSL data to 3.4.1 on Linux (#131618) 2025-04-25 10:26:58 +02:00
_stat.c
_statisticsmodule.c
_struct.c [3.15] gh-159739: Handle overlapping buffers in struct.pack_into (GH-159985) (#160101) 2026-10-22 08:27:11 -07:00
_suggestions.c
_sysconfig.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
_testbuffer.c gh-146151: memoryview supports 'F' and 'D' format types (complex) (#146241) 2026-03-26 15:26:34 +01:00
_testcapi_feature_macros.inc gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build (GH-92046) 2024-01-29 16:45:31 +01:00
_testcapimodule.c
_testclinic.c [3.15] gh-156219: Fix Argument Clinic for an optional argument with **kwds (GH-156220) (GH-156222) 2026-10-10 13:57:25 +03:00
_testclinic_limited.c gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
_testimportmultiple.c
_testinternalcapi.c [3.15] gh-159136: Avoid stop-the-world when setting function name attributes (gh-159269) (gh-159725) 2026-10-29 15:17:50 -07:00
_testlimitedcapi.c [3.15] gh-158445: Add C API tests on build information functions (#159515) 2026-10-16 11:15:23 +00:00
_testmultiphase.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
_testsinglephase.c gh-145921: Add "_DuringGC" functions for tp_traverse (GH-145925) 2026-04-08 09:15:11 +02:00
_threadmodule.c [3.15] gh-159739: Allocate thread-local state before constructing the object (GH-160166) (#160286) 2026-10-22 15:19:59 -07:00
_tkinter.c [3.15] gh-157672: Keep Python's signal handlers when Tk is initialized on macOS (GH-157673) (GH-157987) 2026-10-09 21:02:55 +03:00
_tracemalloc.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
_typesmodule.c
_typingmodule.c
_uuidmodule.c
_weakref.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
_winapi.c [3.15] gh-151929: Get machine ID and uptime on Windows in pythoninfo (#152146) (#152187) 2026-06-25 12:34:16 +00:00
_zoneinfo.c
addrinfo.h gh-114917: add support for AI_NUMERICSERV in getaddrinfo emulation (#114918) 2025-03-18 11:26:51 +01:00
arraymodule.c [3.15] gh-142083: Document the 'w' type code in the array.array docstring (#158040) (#158575) 2026-10-12 17:20:25 +00:00
atexitmodule.c
binascii.c [3.15] gh-134837: Correct and improve base85 documentation for base64 and binascii modules (GH-145843) (GH-149742) 2026-05-12 20:25:28 +00:00
blake2module.c [3.15] gh-155830: properly initialize BLAKE-2 objects before GC tracking (GH-155831) (#159732) 2026-10-19 12:28:23 -07:00
cmathmodule.c [3.15] gh-155526: Don't check errno in abs(complex) (GH-155527) (#157341) 2026-09-15 16:45:12 +03:00
config.c.in
errnomodule.c gh-126585: Add EHWPOISON error code (#126586) 2024-12-03 12:45:50 +00:00
faulthandler.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
fcntlmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
gc_weakref.txt GH-135552: Make the GC clear weakrefs later (GH-136189) 2025-08-07 16:32:17 -07:00
gcmodule.c [3.15] gh-157377: Don't flush the thread-local allocation count in gc.get_count (GH-157381) (#157505) 2026-09-16 11:13:28 +03:00
getaddrinfo.c [3.15] gh-159739: Propagate fallback getaddrinfo allocation failures (GH-159984) (#160099) 2026-10-22 07:43:00 -07:00
getbuildinfo.c [3.15] gh-158445: Add C API tests on build information functions (#159515) 2026-10-16 11:15:23 +00:00
getnameinfo.c [3.15] gh-159739: Account for NUL terminators in fallback getnameinfo (GH-159991) (#160091) 2026-10-21 19:45:40 +00:00
getpath.c [3.15] Fix unchecked NULL returns in several C modules (GH-160213) (#160262) 2026-10-22 21:38:32 +01:00
getpath.py [3.15] gh-106045: Keep searching from venv home when the resolved base executable has no stdlib (GH-160123) (#160354) 2026-10-22 23:28:49 +00:00
getpath_noop.c [3.15] gh-157142: Fix linking _freeze_module with built-in test modules (GH-157143) (GH-157148) 2026-10-10 13:33:29 +03:00
grpmodule.c [3.15] gh-159739: Track group records for cyclic garbage collection (GH-159778) (#159904) 2026-10-20 11:13:56 -07:00
hashlib.h
hmacmodule.c [3.15] gh-159786: Convert HACL* update() errors in _hmac after releasing the lock (GH-159805) (#159825) 2026-10-20 19:49:56 +00:00
itertoolsmodule.c [3.15] gh-153908: Fix data race in itertools.count.__repr__ (GH-153917) (GH-153951) 2026-07-18 15:18:04 +00:00
ld_so_aix.in Issue #10656: Fix out-of-tree building on AIX 2016-11-20 07:56:37 +00:00
main.c
makesetup [3.15] GH-138800: Fix variable substitution in python3.pc for Android (GH-144776) (#155107) 2026-08-03 15:30:27 +08:00
makexp_aix bpo-42087: Remove support for AIX 5.3 and below (GH-22830) 2020-11-16 16:16:10 +01:00
mathintegermodule.c [3.15] Fix a stale link to the math.integer.isqrt() correctness proof (GH-154685) (#154698) 2026-07-25 15:17:11 +00:00
mathmodule.c [3.15] gh-160208: Add a private wrapper around __STDC_VERSION__ (GH-160376) (GH-160437) 2026-10-23 20:31:48 +02:00
md5module.c [3.15] gh-155833: GC-untrack MD5/SHA* objects before freeing the HACL* state (GH-155834) (#159789) 2026-10-21 21:39:31 +00:00
mmapmodule.c [3.15] gh-157335: Fix out-of-bounds write in mmap.mmap.__setitem__ (GH-157438) (#158026) 2026-09-28 18:57:50 +03:00
overlapped.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
posixmodule.c [3.15] Fix unchecked NULL returns in several C modules (GH-160213) (#160262) 2026-10-22 21:38:32 +01:00
posixmodule.h gh-85283: Convert grp extension to the limited C API (#116611) 2024-03-12 00:46:53 +00:00
pwdmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
pyexpat.c [3.15] gh-159739: Handle pyexpat configuration changes during callbacks (GH-160399) (#160475) 2026-10-24 13:42:35 -07:00
readline.c [3.15] Fix unchecked NULL returns in several C modules (GH-160213) (#160262) 2026-10-22 21:38:32 +01:00
README
resource.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
rotatingtree.c gh-116181: Remove Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE in rotatingtree.c (#121260) 2024-07-03 13:05:05 +05:30
rotatingtree.h
selectmodule.c [3.15] gh-154836: Fix Popen.wait() with very large timeouts on the pidfd/kqueue wait paths (GH-154837) (#154891) 2026-07-29 18:16:55 +00:00
Setup [3.15] gh-158683: Fix missing source files for _zstd in Modules/Setup (GH-158672) (#159056) 2026-10-11 10:54:07 -07:00
Setup.bootstrap.in gh-136421: Load _datetime static types during interpreter initialization (GH-136583) 2025-07-21 13:47:26 -04:00
Setup.stdlib.in [3.15] gh-158445: Add C API tests on build information functions (#159515) 2026-10-16 11:15:23 +00:00
sha1module.c
sha2module.c [3.15] gh-155833: GC-untrack MD5/SHA* objects before freeing the HACL* state (GH-155834) (#159789) 2026-10-21 21:39:31 +00:00
sha3module.c [3.15] gh-155833: GC-untrack MD5/SHA* objects before freeing the HACL* state (GH-155834) (#159789) 2026-10-21 21:39:31 +00:00
signalmodule.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
socketmodule.c
socketmodule.h
symtablemodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
syslogmodule.c
termios.c [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) 2026-05-24 22:31:19 +03:00
timemodule.c [3.15] gh-155787: Harmonize parameter names in the time module documentation and docstrings (GH-155790) (GH-155804) 2026-10-10 12:29:01 +03:00
tkappinit.c [3.15] gh-150836: Mount embedded Tk ZIP in _tkinter on Windows (GH-151735) 2026-06-19 18:31:12 -05:00
tkinter.h [3.15] gh-150836: Mount embedded Tk ZIP in _tkinter on Windows (GH-151735) 2026-06-19 18:31:12 -05:00
unicodedata.c [3.15] gh-159739: Collect grapheme iterator and segment type cycles (GH-159975) (#160013) 2026-10-21 19:13:47 +00:00
unicodedata_db.h
unicodename_db.h
winreparse.h
xxlimited.c
xxlimited_3_13.c [3.15] gh-140550: Update xxlimited with 3.15 limited API (GH-142827) (GH-149785) 2026-05-14 00:00:29 +02:00
xxlimited_35.c
xxmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
xxsubtype.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
zlibmodule.c [3.15] gh-158169: Clear zlib.Decompress.unconsumed_tail at end of stream (GH-158177) (GH-158228) 2026-10-10 13:35:31 +03:00

Source files for standard library extension modules,
and former extension modules that are now builtin modules.