Commit graph

5699 commits

Author SHA1 Message Date
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
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
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
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
Kumar Aditya
60fbc20ef9
gh-140947: fix contextvars handling for server tasks in asyncio (#141158) 2026-03-21 17:44:08 +05:30
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
Pablo Galindo Salgado
2f4eb34bd2
gh-146171: Fix nested AttributeError suggestions (#146188) 2026-03-20 12:47:59 +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
Okiemute Enato
89a154a0c0
gh-146091: Fix NULL check in termios.tcsetwinsize (#146147) 2026-03-19 16:20:18 +05:30
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
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
Stan Ulbrych
9d7621b75b
gh-146054: Limit the growth of encodings.search_function cache (GH-146055) 2026-03-17 15:02:59 +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
Pieter Eendebak
3a24856447
gh-123471: make concurrent iteration over itertools.accumulate thread-safe (#144486) 2026-03-16 08:53:37 +00:00
Gregory P. Smith
ee5318025b
gh-140814: Fix freeze_support() setting start method as side effect (GH-144608)
freeze_support() called get_start_method() without allow_none=True,
which locked in the default start method context. This caused a
subsequent set_start_method() call to raise "context has already been
set". Use allow_none=True and accept None as a matching value, since
spawn.freeze_support() independently detects spawned child processes.

Test that freeze_support() does not lock in the default start method,
which would prevent a subsequent set_start_method() call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-15 22:50:19 -07:00
Matthieu Darbois
ec5e3a5a07
gh-145968: Fix base64.b64decode altchars translation in specific cases (GH-145969)
When altchars overlaps with the standard ones, the translation does not
always yield to the expected outcome.
2026-03-15 19:46:44 +02:00
Guido van Rossum
788c329117
gh-123720: When closing an asyncio server, stop the handlers (#124689) 2026-03-14 11:28:49 -07:00
Konstantin Vlasov
77c06f3da6
gh-145703: Fix asyncio.BaseEventLoop low clock resolution (#145706) 2026-03-14 11:07:30 +05:30
Petr Viktorin
747ef70faa
GH-60729: Revert "Add IEEE format wave audio support (GH-145384)" (GH-145928)
Revert "GH-60729: Add IEEE format wave audio support (GH-145384)"

This reverts commit 61f2a1a599 for now;
as tests fail on big-endian machines.
2026-03-13 17:51:23 +00:00
Michiel W. Beijen
61f2a1a599
GH-60729: Add IEEE format wave audio support (GH-145384)
Co-authored-by: Lionel Koenig <lionelk@google.com>
2026-03-13 14:10:48 +01:00
Jason Yalim, PhD
f884dc6f70
gh-140715: Add %t and %n format codes support to strptime() (GH-144896)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-13 14:00:39 +01:00
Serhiy Storchaka
962fb872eb
gh-145850: Change some implementation details in struct.Struct (GH-145851)
* calling it with non-ASCII string format will now raise a ValueError
  instead of UnicodeEncodeError
* calling it with non-ASCII bytes format will now raise a ValueError
  instead of struct.error
* getting the format attribute of uninitialized object will now raise
  an AttributeError instead of RuntimeError.
2026-03-13 13:05:41 +02:00
Charlie Lin
7a65900764
gh-145717: Add a few Microsoft-specific MIME types, and synchronize between mimetypes module and tests (#145718)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-03-12 18:56:07 +02:00
Tan Long
e13f6dccd7
gh-140131: Fix REPL cursor position on Windows when module completion suggestion line hits console width (GH-140333) 2026-03-12 16:59:43 +01:00
bkap123
17eb0354ff
gh-145446: Add critical section in functools module for PyDict_Next (GH-145487) 2026-03-12 14:46:37 +01:00
Serhiy Storchaka
72456309e9
gh-143715: Deprecate incomplete initialization of struct.Struct() (GH-145580)
* Struct.__new__() will require a mandatory argument (format)
* Calls of __init__() method with a different format argument on initialized
  Struct are deprecated

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-03-12 09:44:11 +02:00
Bénédikt Tran
4722202a1a
gh-139933: correctly suggest attributes for classes with a custom __dir__ (GH-139950)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-03-11 15:30:09 +01:00
Seth Michael Larson
42d754e34c
gh-141707: Skip TarInfo DIRTYPE normalization during GNU long name handling
Co-authored-by: Eashwar Ranganathan <eashwar@eashwar.com>
2026-03-11 13:47:55 +00:00
Stefan Zetzsche
ece712197d
gh-145546: unittest.util: fix sorted_list_difference tail deduplication (GH-145547)
* fix(unittest.util): Deduplicate tail elements in sorted_list_difference

sorted_list_difference failed to deduplicate remaining elements when one
list was exhausted, causing duplicate values in the result.

Deduplicate before extending.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-11 13:21:22 +01:00
Shrey Naithani
5d6e8dd683
gh-145587: fix busy loop in multiprocessing.connection.wait on Windows (GH-145597)
Ensure wait() blocks for the specified timeout when object_list is empty, preventing 100% CPU usage. This aligns the Windows behavior with the Unix implementation.

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-03-11 13:08:48 +01:00
Sam Gross
665c1db94f
gh-142763: Fix race in ZoneInfo cache eviction (gh-144978)
The cache may be cleared between the evaluation of the if statement and the
call to popitem.
2026-03-10 14:47:58 -04:00
Stan Ulbrych
4d0dce0c8d
Fix integer overflow for formats "s" and "p" in the struct module (GH-145750) 2026-03-10 18:57:34 +02:00
Charlie Lin
467507a651
gh-145697: Add .sql and .sqlite3 recognition in mimetypes (GH-145698)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
2026-03-10 16:21:33 +01:00
Hugo van Kemenade
7fbdc8fb54 Merge branch 'main' of https://github.com/python/cpython 2026-03-10 16:41:02 +02:00
Steve Dower
ae0d2875bc
gh-145035: Allows removing the _pyrepl module to completely disable the modern REPL (GH-145159) 2026-03-10 14:58:32 +01:00
Matt Van Horn
2d35f9bc1c
gh-145492: Fix defaultdict __repr__ infinite recursion (GH-145659)
Co-Authored-By: Thomas Kowalski <thom.kowa@gmail.com>
2026-03-10 14:20:42 +01:00
Hugo van Kemenade
6024d3c6da Python 3.15.0a7 2026-03-10 14:31:15 +02:00
Daan De Meyer
1564e231aa
gh-145541: Fix InvalidStateError in BaseSubprocessTransport._call_connection_lost() (#145554) 2026-03-09 19:37:23 +05:30
Ramin Farajpour Cami
2cf6b2caad
gh-145623: Fix crashes on uninitialized struct.Struct objects (gh-145624) 2026-03-07 22:31:45 +09:00
Pieter Eendebak
c1d7768321
gh-145376: Fix crashes in md5module.c and hmacmodule.c (#145422)
Fix a possible NULL pointer dereference in `md5module.c` and a double-free in `hmacmodule.c`.
Those crashes only occur in error paths taken when the interpreter fails to allocate memory.
2026-03-06 20:00:06 +00:00
Victor Stinner
4fce98a920
gh-141510: Change marshal version to 6 (#145551)
Fix SliceTestCase: test also that version 4 fails with ValueError.
2026-03-06 10:23:11 +01:00
Shrey Naithani
dbe0007ab2
gh-145417: Do not preserve SELinux context when copying venv scripts (#145454)
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-05 15:19:49 +01:00
krylosov-aa
6acaf659ef
gh-145301: Fix double-free in hashlib and hmac module initialization (GH-145321)
gh-145301: Fix double-free in hashlib and hmac initialization
2026-03-04 19:48:25 -08:00