Commit graph

130629 commits

Author SHA1 Message Date
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
Ken Jin
966fc81531
gh-146058: Fix _GUARD_CODE_VERSION_* (GH-146060) 2026-03-18 01:19:44 +08:00
Michiel W. Beijen
ff287a72de
gh-144975: Fix wave.Wave_write.setframerate() validation order (GH-144976)
Validate the frame rate after rounding to an integer, not before.
This prevents values like 0.5 from passing validation (0.5 > 0)
but then rounding to 0, which would cause a confusing delayed error
"sampling rate not specified" when writing frames.

With this fix, setframerate(0.5) immediately raises "bad frame rate",
providing clear feedback at the point of the error.
2026-03-17 18:01:18 +01:00
Ramin Farajpour Cami
dc24b8a6d4
gh-145966: Fix _csv DIALECT_GETATTR macro silently masking non-AttributeError exceptions (GH-145974)
The DIALECT_GETATTR macro in dialect_new() unconditionally called
PyErr_Clear() when PyObject_GetAttrString() failed, which suppressed
all exceptions including MemoryError, KeyboardInterrupt, and
RuntimeError. Now only AttributeError is cleared; other exceptions
propagate via the existing error handling path.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-17 16:08:53 +01:00
Sacul
1efd9939c8
gh-131798: Optimize _ITER_CHECK_RANGE and _ITER_CHECK_LIST in the JIT (GH-144583) 2026-03-17 22:07:17 +08:00
Stan Ulbrych
9d7621b75b
gh-146054: Limit the growth of encodings.search_function cache (GH-146055) 2026-03-17 15:02:59 +01:00
Serhiy Storchaka
99e2c5eccd
gh-144545: Improve handling of default values in Argument Clinic (GH-146016)
* Add the c_init_default attribute which is used to initialize the C variable
  if the default is not explicitly provided.
* Add the c_default_init() method which is used to derive c_default from
  default if c_default is not explicitly provided.
* Explicit c_default and py_default are now almost always have precedence
  over the generated value.
* Add support for bytes literals as default values.
* Improve support for str literals as default values (support non-ASCII
  and non-printable characters and special characters like backslash or quotes).
* Fix support for str and bytes literals containing trigraphs, "/*" and "*/".
* Improve support for default values in converters "char" and "int(accept={str})".
* Converter "int(accept={str})" now requires 1-character string instead of
  integer as default value.
* Add support for non-None default values in converter "Py_buffer": NULL,
  str and bytes literals.
* Improve error handling for invalid default values.
* Rename Null to NullType for consistency.
2026-03-17 12:16:35 +02:00
Ned Batchelder
4f5e79805e
Docs: a brief note in the sets tutorial about order (#145984)
Docs: a brief note in the sets tut about order
2026-03-17 05:03:11 -04:00
Hood Chatham
1b118353bb
gh-145176 Move Emscripten files into Platforms/emscripten (#145806)
Moves Emscripten build files into Platforms/emscripten.
2026-03-17 09:39:45 +08:00
Hugo van Kemenade
104cae039a
gh-142927: Move hotspots up flamegraph sidebar (#145428) 2026-03-16 23:01:41 +00:00
trag1c
4e96282ee4
Docs: remove unmatched parenthesis for asyncio.TaskGroup note (#146035) 2026-03-16 20:55:29 +01:00
wavebyrd
2a0fa500f8
gh-145870: Fix Format.SOURCE reference in get_annotations docstring (#145889)
The get_annotations() docstring incorrectly referred to the SOURCE
format, which was renamed to STRING during PEP 749 development.

Co-authored-by: Carson Jones <carson@Carsons-MacBook-Pro.local>
2026-03-16 12:25:31 -07:00
dependabot[bot]
ae1b307433
build(deps): bump hypothesis from 6.135.26 to 6.151.9 in /Tools (#145948)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.135.26 to 6.151.9.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.135.26...hypothesis-python-6.151.9)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.151.9
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-16 19:07:07 +01:00
Ken Jin
3d0824aef2
gh-127958: Trace from RESUME in the JIT (GH-145905) 2026-03-17 00:18:59 +08:00
Hai Zhu
81ef1b7317
gh-144888: Replace bloom filter linked lists with continuous arrays to optimize executor invalidating performance (GH-145873) 2026-03-16 15:58:18 +00:00
Sam Gross
e18abc6a1f
gh-135329: Remove flaky test_repl_eio test (gh-145932)
The test doesn't actually test any pyrepl code (it runs Python with -S)
and has a race condition that causes intermittent timeouts on CI.
2026-03-16 11:08:07 -04:00
Ken Jin
182aea2f57
gh-146018: Disable over-aggressive optimization for _GUARD_CODE_VERSION (GH-145923) 2026-03-16 13:52:56 +00:00
Sergey Miryanov
fd50b41aa9
GH-145247: Use _PyTuple_FromPair in exceptions.c (GH-145910) 2026-03-16 13:50:26 +00:00
Stan Ulbrych
57e88c1cf9
gh-145599, CVE 2026-3644: Reject control characters in http.cookies.Morsel.update() (#145600)
Reject control characters in `http.cookies.Morsel.update()` and `http.cookies.BaseCookie.js_output`.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <victor.stinner@gmail.com>
2026-03-16 14:43:43 +01:00
Victor Stinner
77632f085d
gh-141510: Avoid critical section on frozendict copy (#145920) 2026-03-16 14:19:00 +01:00
Ramin Farajpour Cami
e6b9a14069
gh-144984: Fix crash in Expat's ExternalEntityParserCreate error paths (#144992)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-16 12:30:13 +00:00
Sacul
37121ef77e
gh-145866: Convert CALL_INTRINSIC_1 to leave its inputs on the stack to be cleaned up by _POP_TOP. (GH-145964) 2026-03-16 11:58:12 +00:00
Matt Van Horn
36b5284f04
gh-145649: Fix man page text wrapping for -X option (#145656)
Replace hardcoded space indentation with proper troff macros
(.TP, .RS/.RE, .IP) for -X sub-options so text wraps correctly
at any terminal width.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 11:55:00 +01:00
Ken Jin
e2e62033aa
gh-139038: Link to Savannah's webpage for JIT results (#146013) 2026-03-16 11:10:34 +01:00
Pieter Eendebak
3a24856447
gh-123471: make concurrent iteration over itertools.accumulate thread-safe (#144486) 2026-03-16 08:53:37 +00:00