Commit graph

56744 commits

Author SHA1 Message Date
Kevin Huai
f5364ae750
gh-145866: Convert _CALL_INTRINSIC_2 to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-146262) 2026-03-26 17:41:07 +08:00
Kumar Aditya
495178ab05
gh-146453: fix _PyType_LookupByVersion for types with fixed pre-defined version tags (#146454) 2026-03-26 14:36:55 +05:30
Sergey B Kirpichev
8e1469c952
gh-138573: Filter out failing math tests on Solaris (#146402) 2026-03-26 00:11:20 +01:00
Victor Stinner
0055140b2c
gh-146358: Fix warnings.catch_warnings on Free Threading (#146374)
catch_warnings now also overrides warnings.showwarning() on Free
Threading to support custom warnings.showwarning().
2026-03-25 14:34:50 +01:00
Hugo van Kemenade
d0e66ef1c0
gh-146369: Ensure PYTHON_LAZY_IMPORTS=none overrides __lazy_modules__ (#146371) 2026-03-25 11:08:45 +00:00
Victor Stinner
3364e7e62f
gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217)
OpenSSL 4.0.0 alpha1 removed these functions:

* SSLv3_method()
* TLSv1_method()
* TLSv1_1_method()
* TLSv1_2_method()

Other changes:

* Update test_openssl_version().
* Update multissltests.py for OpenSSL 4.
* Add const qualifier to fix compiler warnings.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-25 07:44:47 +01:00
Petr Viktorin
119fce7b88
gh-144984: Skip test under tracerefs (GH-146218) 2026-03-24 17:34:12 +01:00
Pieter Eendebak
951675c18a
gh-146306: JIT: Optimize float operations by mutating uniquely-referenced operands in place (GH-146307)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:16:02 +08:00
Sergey B Kirpichev
68c7fad757
gh-138580: Add sys.float_info.iec_60559 boolean flag (#138811)
This value indicating support the IEC 60559 floating-point standard (the
Annex F of C99).  If enabled, the float type characteristics matches the
IEC 60559 double format and exceptional cases for the math's functions
follow to the section F.10 of the C99 standard.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-24 11:36:15 +00:00
Neko Asakura
6d73bc2267
gh-145866: Convert DICT_MERGE to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-146329) 2026-03-24 18:31:41 +08:00
Victor Stinner
bcff99cb3f
gh-146202: Create tmp_dir in regrtest worker (#146347)
Create tmp_dir in libregrtest.worker since the directory can be
different than the --tempdir directory.
2026-03-23 23:47:47 +00:00
Brij Kapadia
e017971eb9
gh-146199: Fix error handling in code_richcompare when PyObject_RichCompareBool fails (#146200)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-23 23:41:53 +01:00
Charlie Lin
821581adae
gh-145719: Add .efi file detection in mimetypes (#145720)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-03-23 22:16:41 +02:00
Hood Chatham
0c83e8bed8
gh-146325: Use test.support.requires_fork in test_fastpath_cache_cleared_in_forked_child (#146330) 2026-03-23 16:56:11 +02:00
Jason R. Coombs
f5d47fceb0
gh-143387: Raise an exception instead of returning None when metadata file is missing. (#146234) 2026-03-23 09:12:36 -04:00
Serhiy Storchaka
4561f6418a
gh-145264: Do not ignore excess Base64 data after the first padded quad (GH-145267)
Base64 decoder (see binascii.a2b_base64(), base64.b64decode(), etc)
no longer ignores excess data after the first padded quad in non-strict
(default) mode.  Instead, in conformance with RFC 4648, it ignores the
pad character, "=", if it is present before the end of the encoded data.
2026-03-22 23:12:58 +02:00
kangtastic
b4e5bc2164
gh-146192: Add base32 support to binascii (GH-146193)
Add base32 encoder and decoder functions implemented in
C to the binascii module and use them to greatly improve the
performance and reduce the memory usage of the existing
base32 codec functions in the base64 module.
2026-03-22 23:10:28 +02:00
flow
a17301ab3d
gh-135953: Properly obtain main thread identifier in Gecko Collector (#146045) 2026-03-22 18:53:00 +00:00
reiden
e36f8db7e5
gh-143414: Implement unique reference tracking for JIT, optimize unpacking of such tuples (GH-144300)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2026-03-23 00:57:23 +08:00
Serhiy Storchaka
161329cde2
gh-145144: Add more tests for UserList, UserDict, etc (GH-145145) 2026-03-22 16:22:25 +02:00
Serhiy Storchaka
97c725cd39
gh-143959: Fix test_datetime if _datetime is unavailable (GH-145248) 2026-03-22 16:15:35 +02:00
Stan Ulbrych
f0aeabc6f9
gh-140049: Colorize exception notes in traceback.py (#140051)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-03-22 08:54:43 +00:00
Hugo van Kemenade
83360b5869
Docs: replace all datetime imports with import datetime as dt (#145640) 2026-03-21 18:02:06 +02:00
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
Kumar Aditya
60fbc20ef9
gh-140947: fix contextvars handling for server tasks in asyncio (#141158) 2026-03-21 17:44:08 +05:30
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
Seth Michael Larson
82a24a4442
gh-143930: Reject leading dashes in webbrowser URLs 2026-03-20 14:47:13 +00: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
Mingzhu Yan
98977ca433
gh-131798: JIT: optimize _LOAD_COMMON_CONSTANT (GH-146104) 2026-03-20 05:55:22 +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
Sergey Miryanov
ced64605be
GH-146096: Fix segfault in BaseExceptionGroup repr (#146141) 2026-03-19 11:25:15 +00:00
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
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
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
Stan Ulbrych
bcdf231946
gh-146121: pkgutil.get_data() reject invalid resource arguments (#146122) 2026-03-18 17:31:01 +00: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
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
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