Commit graph

130703 commits

Author SHA1 Message Date
Jonathan Dung
f6b5eed47d
gh-146153: Use frozendict in pure python fallback for curses.has_key (#146154)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-21 14:06:07 +01:00
andreuu-tsai
8a531f89df
gh-138234: clarify returncode behavior for subprocesses created with shell=True (#138536)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-03-21 12:32:28 +00:00
Kumar Aditya
60fbc20ef9
gh-140947: fix contextvars handling for server tasks in asyncio (#141158) 2026-03-21 17:44:08 +05:30
Sergey Miryanov
897fa231a7
GH-100108: Add async generators best practices section (#141885)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-03-21 11:59:15 +00:00
Mark Shannon
879c85f6e4
GH-145667: Merge GET_ITER and GET_YIELD_FROM_ITER (GH-146120)
* Merge GET_ITER and GET_YIELD_FROM_ITER. Modify SEND to make it a bit more like FOR_ITER
2026-03-21 10:48:13 +00:00
Jason R. Coombs
b5e4c46be2
gh-146228: Better fork support in cached FastPath (#146231)
* Apply changes from importlib_metadata 8.9.0
* Suppress deprecation warning in fork.
2026-03-20 20:10:50 +00:00
Sam Gross
1eff27f2c0
gh-146227: Fix wrong type in _Py_atomic_load_uint16 in pyatomic_std.h (gh-146229)
Also fix a few related issues in the pyatomic headers:

* Fix _Py_atomic_store_uint_release in pyatomic_msc.h to use __stlr32
  on ARM64 instead of a plain volatile store (which is only relaxed on
  ARM64).

* Add missing _Py_atomic_store_uint_release to pyatomic_gcc.h.

* Fix pseudo-code comment for _Py_atomic_store_ptr_release in
  pyatomic.h.
2026-03-20 15:38:35 -04:00
Victor Stinner
b36b87bcbb
gh-145980: Fix copy/paste mistake in binascii.c (#146230) 2026-03-20 18:12:10 +00:00
Victor Stinner
6450b1d142
gh-146092: Raise MemoryError on allocation failure in _zoneinfo (#146165) 2026-03-20 17:17:22 +01:00
Wulian233
5ad738f8fb
gh-91279: Note SOURCE_DATE_EPOCH support in ZipFile.writestr() doc (#139396)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-20 16:14:25 +00:00
Shamil
cd10a2e65c
gh-146196: Fix Undefined Behavior in _PyUnicodeWriter_WriteASCIIString() (#146201)
Avoid calling memcpy(data + writer->pos, NULL, 0)
which has an undefined behavior.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-20 15:58:41 +00:00
Seth Michael Larson
82a24a4442
gh-143930: Reject leading dashes in webbrowser URLs 2026-03-20 14:47:13 +00:00
Petr Viktorin
b38127f3d6
gh-145916: Soft-deprecate ctypes.util.find_library (GH-145919)
* Put the "Loading shared libraries" section first
  * Adjust formatting at the end of the section
* In "Finding shared libraries", add more text about what's going on
* Move the stub function doc for find_library into "Finding shared libraries"
  * Also move the sister function, find_msvcrt. That's on the chopping block,
    but not removed now.
2026-03-20 15:00:10 +01:00
AN Long
9f9faa2d1a
gh-146205: Check the errno with != 0 in close impls in select module (#146206)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-20 14:44:01 +01:00
Pablo Galindo Salgado
2f4eb34bd2
gh-146171: Fix nested AttributeError suggestions (#146188) 2026-03-20 12:47:59 +00:00
Ken Jin
acfb4528de
gh-146099: Optimize _GUARD_CODE_VERSION+IP via function version symbols (GH-146101) 2026-03-20 12:26:41 +00:00
Serhiy Storchaka
4507d496b4
gh-145980: Add support for alternative alphabets in the binascii module (GH-145981)
* Add the alphabet parameter in functions b2a_base64(), a2b_base64(),
  b2a_base85(), and a2b_base85().
* And a number of "*_ALPHABET" constants.
* Remove b2a_z85() and a2b_z85().
2026-03-20 13:07:00 +02:00
Matthias Schoettle
d357a7dbf3
gh-145754: Update signature retrieval in unittest.mock to use forwardref annotation format (#145756) 2026-03-19 19:39:41 -07:00
Hood Chatham
6b5511d66b
gh-145177: Add emscripten run --test, uses test args from config.toml (#146160)
This allows us to change the test arguments from the python repo rather
than having to change buildmaster-config.

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-03-19 22:14:13 +00:00
Mingzhu Yan
98977ca433
gh-131798: JIT: optimize _LOAD_COMMON_CONSTANT (GH-146104) 2026-03-20 05:55:22 +08:00
Hood Chatham
db11623694
gh-145177: Add make-dependencies command to emscripten build script (#146158)
Adds a standalone target for building all dependencies so that the buildbot
script is independent of a specific dependency list.
2026-03-20 05:40:01 +08:00
Serhiy Storchaka
ab47892c32
Improve tests for the PyUnicodeWriter C API (GH-146157)
Add tests for corner cases: NULL pointers and out of range values.
2026-03-19 19:15:30 +02:00
Sacul
d5b26816d0
gh-145866 : Update JIT contributor list (GH-146170) 2026-03-19 21:40:09 +08:00
Sergey B Kirpichev
52c01864c4
gh-145633: Refine notes on non-IEEE platforms (#145845)
* We don't specify what happens on non-IEEE platforms.
* Use rather PY_LITTLE_ENDIAN to get native endianness.
* Mention that unpack functions don't fail in CPython.
* Mention that PyFloat_Pack8 doesn't fail in CPython.

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-19 11:42:25 +00:00
Sergey Miryanov
ced64605be
GH-146096: Fix segfault in BaseExceptionGroup repr (#146141) 2026-03-19 11:25:15 +00:00
Carlos Sousa
004ce8d97b
gh-137696: Rename 'fort' parameter to 'order' in PyBuffer_* functions (#137866) 2026-03-19 16:54:27 +05:30
Sacul
0d37e423d5
gh-145866: Convert SET_UPDATE to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-145979) 2026-03-19 19:17:58 +08:00
Tan Long
982459132b
gh-145394: Remove duplicated isearch_add_character in _pyrepl/historical_reader.py (#145396) 2026-03-19 16:38:01 +05:30
Lysandros Nikolaou
580043dfae
gh-145254: Fix formatting of thread safety annotations (#146111)
- Add leading space so that the spacing between the previous annotation
  and the thread safety annotation looks correct.
- Remove trailing period from the link to the thread safety level.
2026-03-19 12:01:24 +01:00
Okiemute Enato
89a154a0c0
gh-146091: Fix NULL check in termios.tcsetwinsize (#146147) 2026-03-19 16:20:18 +05:30
Hood Chatham
91e1312b95
gh-145177: Put node version into emscripten/config.toml. (#146156)
Configure node version as part of the emscripten build script, and install 
that node version if it isn't available.
2026-03-19 09:38:22 +00:00
Serhiy Storchaka
becd7a967f
gh-146143: Fix the PyUnicodeWriter_WriteUCS4() signature (GH-146144)
It now accepts a pointer to constant buffer of Py_UCS4.
2026-03-19 08:23:01 +00:00
Serhiy Storchaka
0f2246b155
gh-146056: Fix list.__repr__() for lists containing NULLs (GH-146129)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-19 09:59:48 +02:00
Hood Chatham
abd5246305
gh-145805: Add python Platforms/emscripten run subcommand (#146051)
Provides a `run` command in the Emscripten build tooling, and adds 
environment variable configuration for EMSDK_CACHE, CROSS_BUILD_DIR
and QUIET.
2026-03-19 09:06:17 +08:00
Victor Stinner
b9d43188e9
gh-145410: Add _sysconfig.get_platform() function (#146145)
On Windows, sysconfig.get_platform() now gets the platform from the
_sysconfig module instead of parsing sys.version string.
2026-03-19 00:28:21 +01:00
Victor Stinner
656abe3c9a
gh-141510: Document isinstance change for frozendict in What's New (#146107) 2026-03-18 23:09:18 +01:00
Stan Ulbrych
bcdf231946
gh-146121: pkgutil.get_data() reject invalid resource arguments (#146122) 2026-03-18 17:31:01 +00:00
Victor Stinner
e1e4852133
gh-146092: Handle _PyFrame_GetFrameObject() failures properly (#146124)
* Fix _PyFrame_GetLocals() and _PyFrame_GetLocals() error handling.
* _PyEval_ExceptionGroupMatch() now fails on _PyFrame_GetLocals()
  error.
2026-03-18 18:27:52 +01:00
Victor Stinner
724c7c8146
gh-146093: Fix csv _set_str(): check if PyUnicode_DecodeASCII() failed (#146113)
The function can fail on a memory allocation failure.

Bug reported by devdanzin.
2026-03-18 18:20:35 +01:00
Hai Zhu
6fe91a9e80
gh-144888: JIT executor bloom filter wide-type optimization and function Inlining (GH-146114) 2026-03-19 00:58:14 +08:00
Bartosz Grabowski
2c6afb935a
docs: fix f-string in ExceptionGroup example (#146108) 2026-03-18 16:49:15 +00:00
Lysandros Nikolaou
5b25eaec37
gh-142518: Annotate PyList_* C APIs for thread safety (#146109) 2026-03-18 17:42:20 +01:00
Victor Stinner
1e4ed93210
gh-146092: Fix error handling in _BINARY_OP_ADD_UNICODE opcode (#146117)
Fix also error handling in _BINARY_OP_ADD_FLOAT,
_BINARY_OP_SUBTRACT_FLOAT and _BINARY_OP_MULTIPLY_FLOAT opcodes.
PyStackRef_FromPyObjectSteal() must not be called with a NULL
pointer.
2026-03-18 17:23:05 +01:00
Serhiy Storchaka
70c7e040d4
gh-66419: Make optional arguments with nargs=REMAINDER consume all arguments (GH-124509)
It no longer stops at the first '--'.
2026-03-18 17:04:11 +02:00
Lysandros Nikolaou
847f83ef1c
gh-142518: Add thread safety notes for the buffer protocol (#145911) 2026-03-18 14:18:28 +01:00
Stan Ulbrych
3b06d68d8a
gh-146076: Fix crash when a ZoneInfo subclass is missing a _weak_cache (#146082) 2026-03-18 18:28:08 +05:30
Michiel W. Beijen
d42a04c045
GH-60729: Add IEEE format wave audio support (GH-145931)
(this re-applies reverted commit 61f2a1a599,
with a test fix)

Co-authored-by: Lionel Koenig <lionelk@google.com>
2026-03-18 12:46:26 +00:00
bkap123
64862112b7
gh-146075: Prevent crash in functools.partial() from malformed str subclass (GH-146078)
In `partial_vectorcall`, an error returned by `PyDict_Contains` was
considered to be a truthy value. Now, the error is handled
appropriately.
2026-03-18 13:46:01 +01:00
Stan Ulbrych
dfde59f0e1
Fix entry in fuzz_pycompile.dict (GH-146069) 2026-03-18 13:43:55 +01:00
Sam Gross
e0f7c1097e
gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (#145826)
Add special cases for classmethod and staticmethod descriptors in
_PyObject_GetMethodStackRef() to avoid calling tp_descr_get, which
avoids reference count contention on the bound method and underlying
callable. This improves scaling when calling classmethods and
staticmethods from multiple threads.

Also refactor method_vectorcall in classobject.c into a new _PyObject_VectorcallPrepend() helper so that it can be used by
PyObject_VectorcallMethod as well.
2026-03-17 14:24:44 -04:00