]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
26 hours agogh-132467: Document and test that generic aliases are not classes (#133504)
Abduaziz π [Wed, 3 Jun 2026 13:35:25 +0000 (18:35 +0500)] 
gh-132467: Document and test that generic aliases are not classes (#133504)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
27 hours agoCorrect Stable ABI documentation for METH_FASTCALL (GH-149593)
da-woods [Wed, 3 Jun 2026 13:20:35 +0000 (14:20 +0100)] 
Correct Stable ABI documentation for METH_FASTCALL (GH-149593)

* Correct Stable ABI documentation for METH_FASTCALL

The current documentation says:

>
> METH_FASTCALL
>    Part of the Stable ABI since version 3.7.
>
> [...]
>
>   Added in version 3.7.
>
>    Changed in version 3.10: METH_FASTCALL is now part of the stable ABI.

so is contradictory about when it was added to the Stable ABI.  Looking at the header it seems like 3.10 is right.

27 hours agogh-105812: Make use of the Sphinx `deco` role in documentation (#139598)
Victorien [Wed, 3 Jun 2026 13:14:47 +0000 (15:14 +0200)] 
gh-105812: Make use of the Sphinx `deco` role in documentation (#139598)

27 hours agogh-141004: Document unstable perf map functions in `ceval.h` (GH-143492)
Yashraj [Wed, 3 Jun 2026 12:36:25 +0000 (18:06 +0530)] 
gh-141004: Document unstable perf map functions in `ceval.h` (GH-143492)

28 hours agoFix a typo in `SSLSocket` docs (GH-150839)
Robsdedude [Wed, 3 Jun 2026 12:18:06 +0000 (14:18 +0200)] 
Fix a typo in `SSLSocket` docs (GH-150839)

28 hours agogh-146636: Add Free-threaded Stable ABI migration guide (GH-150580)
Petr Viktorin [Wed, 3 Jun 2026 12:02:36 +0000 (14:02 +0200)] 
gh-146636: Add Free-threaded Stable ABI migration guide (GH-150580)

Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
29 hours agogh-148613: Fix race in `gc_set_threshold` and `gc_get_threshold` (#150356)
Edward Xu [Wed, 3 Jun 2026 11:28:26 +0000 (19:28 +0800)] 
gh-148613: Fix race in `gc_set_threshold` and `gc_get_threshold` (#150356)

40 hours agogh-150723: Fix perf jitdump files on macOS (#150728)
Nazım Can Altınova [Wed, 3 Jun 2026 00:15:34 +0000 (02:15 +0200)] 
gh-150723: Fix perf jitdump files on macOS (#150728)

The perf jitdump format defines the thread id field of the JR_CODE_LOAD
record as a 32-bit value, but on macOS it was declared as a uint64_t
(since pthread_threadid_np() returns a uint64_t). Those extra 8 bytes
plus alignment padding shifted every following field, so parsers reading
the file by the spec misread code_size as the code address and failed to
resolve any Python frames.

Declare thread_id as uint32_t on all platforms and truncate the macOS
thread id when writing the record. The value is only informational.
Symbols are resolved by address, and not thread ids so truncation is
safe here.

* Use mach_absolute_time for macOS jitdump timestamps

On macOS the jitdump file is consumed by profilers such as samply, which
timestamp their samples using mach_absolute_time(). The jitdump events were
stamped with clock_gettime(CLOCK_MONOTONIC), a different clock domain that
keeps advancing while the system is asleep, so the JIT code mappings could be
off by days relative to the samples and no Python frame would resolve. Stamp
jitdump events with mach_absolute_time() on macOS so they share the sampler's
clock domain. Linux continues to use CLOCK_MONOTONIC to stay aligned with perf.

Exercise the -Xperf_jit (jitdump) backend through samply and assert that
Python frames resolve, exercising the binary jitdump path end to end.
Skipped when samply is not installed.

43 hours agogh-91099: fix[imaplib]: call Exception with string instance (#31823)
Florian Best [Tue, 2 Jun 2026 20:42:04 +0000 (22:42 +0200)] 
gh-91099: fix[imaplib]: call Exception with string instance (#31823)

* bpo-46943: fix[imaplib]: call Exception with string instance

Adjust the behavior of 'login' to be similar to `authenticate()`,
where self.error is called with a str() instance.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
44 hours agogh-150319: Replace all documentation which says "See PEP 585" (#150325)
Stephen Rosen [Tue, 2 Jun 2026 20:13:34 +0000 (15:13 -0500)] 
gh-150319: Replace all documentation which says "See PEP 585" (#150325)

* Replace all documentation which says "See PEP 585"

The following classes in the stdlib get simple updates:

- array.array
- asyncio.Future
- asyncio.Task
- collections.defaultdict
- collections.deque
- contextvars.ContextVar
- contextvars.Token
- ctypes.Array
- os.DirEntry
- re.Match
- re.Pattern
- string.templatelib.Interpolation
- string.templatelib.Template
- types.MappingProxyType
- queue.SimpleQueue
- weakref.ref

The following classes are documented publicly as functions, and are
therefore updated internally (`__class_getitem__.__doc__`) but not in the
public docs:

- functools.partial
- itertools.chain

The following builtin types have updates to `__class_getitem__.__doc__`
but not to any documentation pages:

- BaseExceptionGroup
- coroutines (from generators)
- dict
- enumerate
- frozendict
- frozenset
- generators (and async generators)
- list
- memoryview
- set
- slice
- tuple

Special cases:

- union objects are now documented as "supporting class-level []",
  rather than anything to do with generics.

- Templates might be generic over a single type (union, in theory) or
  over a TypeVarTuple. As this is not currently fully settled, it is
  marked with a comment and a mild hint that it is a single type is used
  (namely, "type" is singular rather than "types", plural)

* Apply suggestions from code review

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Correct several class getitem docs

And expand the text for tuples.

Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
* Add notes on generic typing of builtins

* Fix typo in tuple.__class_getitem__ docstring

* Typo fix: malformed refs

Fix `generic` links which weren't marked as `:ref:`.

* Strike unnecessary docs on generic-ness

Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
* Apply suggestions from code review

These are applied at both the originally indicated locations and in the
corresponding docstring definitions.

Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com>
* Update Doc/library/re.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Update Objects/enumobject.c

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Remove tuple generic doc in 'stdtypes' page

This is covered in more detail in the cross-linked typing documentation.
The other copy of this documentation -- in the docstring for
`tuple.__class_getitem__` -- is left in place.

* Fix whitespace around new doc of generics

Per review, do not introduce or remove whitespace such that section
breaks are altered by the introduction of doc on various generic types.

In most cases, this is a removal of an extra line.

In one case (Arrays), it is the reintroduction of a line.

Additionally, two other minor fixes are included:
- incorrect indent on 'defaultdicts'
- make `mappingproxy.__class_getitem__.__doc__` consistent with other
  mapping type generic docs

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Move placement of memoryview generic note

Previous placement was at the end of the main docstring, which is
consistent with other types but places it after a section on various
methods (which makes it read somewhat inconsistently). Moving it up
helps resolve.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Ensure sphinxdoc does not start sentences lowercase

Lowercase class names at the start of sentences are marked out with the
`class` role. In the case of `deque`, documentation already refers to
these as `Deques`, so this form is preferred.

* Apply suggestions from code review

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Fix line endings and wrap more tightly

Line endings fixed by pre-commit ; also re-wrapped the MappingProxyType
text which was too long.

* Use 'ContextVars' style in sphinx doc

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
45 hours agoFix description of the function parameter of shutil.register_archive_format() (GH...
Brian Schubert [Tue, 2 Jun 2026 19:12:36 +0000 (15:12 -0400)] 
Fix description of the function parameter of shutil.register_archive_format() (GH-145087)

46 hours agoAdd link to new security policy (#150800)
Seth Larson [Tue, 2 Jun 2026 18:20:36 +0000 (11:20 -0700)] 
Add link to new security policy (#150800)

46 hours agogh-141627: Fix BufferedRandom inheritance documentation (GH-141629)
Mohsin Mehmood [Tue, 2 Jun 2026 18:06:39 +0000 (23:06 +0500)] 
gh-141627: Fix BufferedRandom inheritance documentation (GH-141629)

BufferedRandom does not inherit from BufferedReader and BufferedWriter
in the C implementation.

2 days agogh-101913: changed wording of docstring for _parsedate_tz (#134446)
Gustaf [Tue, 2 Jun 2026 15:02:19 +0000 (17:02 +0200)] 
gh-101913: changed wording of docstring for _parsedate_tz (#134446)

Fixed incorrect word.

Co-authored-by: Gustaf <79180496+GGyll@users.noreply.github.com>
2 days agogh-148587: Document `sys.lazy_modules` (#150742)
Bartosz Sławecki [Tue, 2 Jun 2026 15:00:45 +0000 (17:00 +0200)] 
gh-148587: Document `sys.lazy_modules` (#150742)

2 days agoSilence experimental coroutine deprecation warnings (#150788)
Hugo van Kemenade [Tue, 2 Jun 2026 14:55:28 +0000 (17:55 +0300)] 
Silence experimental coroutine deprecation warnings (#150788)

Co-authored-by: Zachary Ware <zach@python.org>
2 days agogh-149187: Document `frozendict()` under 'Built-in Functions' (#149185)
Øyvind Rønningstad [Tue, 2 Jun 2026 13:55:16 +0000 (15:55 +0200)] 
gh-149187: Document `frozendict()` under 'Built-in Functions' (#149185)

2 days agogh-150766: export `_PyGC_VisitFrameStack` and `_PyGC_VisitStackRef` functions (#150767)
Kumar Aditya [Tue, 2 Jun 2026 13:08:21 +0000 (18:38 +0530)] 
gh-150766: export `_PyGC_VisitFrameStack` and `_PyGC_VisitStackRef` functions (#150767)

2 days agogh-89554: Document _thread.LockType as a class (#150684)
Bernát Gábor [Tue, 2 Jun 2026 12:55:01 +0000 (05:55 -0700)] 
gh-89554: Document _thread.LockType as a class (#150684)

_thread.LockType is a class (the type of lock objects), but was documented
with the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.

Switch the entry to ".. class::", move it next to the lock methods, and
document acquire(), release() and locked() as methods of the class.  Keep
the old _thread.lock.* URL fragments working with raw HTML anchors.

2 days agogh-115119: Fix libmpdec detection when pkg-config files are missing (#150502)
stratakis [Tue, 2 Jun 2026 09:43:30 +0000 (11:43 +0200)] 
gh-115119: Fix libmpdec detection when pkg-config files are missing (#150502)

The fallback for systems with no mpdecimal .pc files used AC_LINK_IFELSE
directly, which relied on LIBMPDEC_LIBS being set. On failure this was empty
so the link test ran without -lmpdec.

Use AC_CHECK_HEADER and AC_CHECK_LIB instead.

2 days agogh-149079: Fix O(n^2) canonical ordering in unicodedata.normalize() (GH-149080)
Seth Larson [Tue, 2 Jun 2026 09:39:50 +0000 (02:39 -0700)] 
gh-149079: Fix O(n^2) canonical ordering in unicodedata.normalize() (GH-149080)

Replace the insertion sort used for canonical ordering of combining
characters with a hybrid approach: insertion sort for short runs (< 20)
and counting sort for longer runs, reducing worst-case complexity from
O(n^2) to O(n). This prevents denial of service via crafted Unicode
strings with many combining characters in alternating CCC order.

Co-authored-by: ch4n3-yoon <ch4n3.yoon@gmail.com>
Co-authored-by: Seokchan Yoon <13852925+ch4n3-yoon@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
2 days agogh-149805: Fix `SystemError` when compiling `__classdict__` class annotation (#149806)
Stan Ulbrych [Tue, 2 Jun 2026 09:17:03 +0000 (10:17 +0100)] 
gh-149805: Fix `SystemError` when compiling `__classdict__` class annotation (#149806)

2 days agoFix two typos in 'Exception Handling' C-API documentation (#150674)
Manoj K M [Tue, 2 Jun 2026 09:14:13 +0000 (14:44 +0530)] 
Fix two typos in 'Exception Handling' C-API documentation (#150674)

2 days agogh-149738: Fix segmentation fault bug in sqllite3 (#149754)
Sepehr Rasouli [Tue, 2 Jun 2026 09:07:08 +0000 (12:37 +0330)] 
gh-149738: Fix segmentation fault bug in sqllite3 (#149754)

Deleting the `row_factory` or `text_factory` attribute is no longer allowed.

2 days agogh-150052: Resolve un-loaded lazily loaded submodules via `module.__getattr__` instea...
Bartosz Sławecki [Tue, 2 Jun 2026 08:58:51 +0000 (10:58 +0200)] 
gh-150052: Resolve un-loaded lazily loaded submodules via `module.__getattr__` instead of publishing lazy values (#150055) (#150744)

2 days agogh-89554: Document typing.ParamSpecArgs and ParamSpecKwargs as classes (GH-150677)
Bernát Gábor [Tue, 2 Jun 2026 08:07:51 +0000 (01:07 -0700)] 
gh-89554: Document typing.ParamSpecArgs and ParamSpecKwargs as classes (GH-150677)

Use the directive "class" instead of "data" for ParamSpecArgs and ParamSpecKwargs.

2 days agogh-89554: Document standard type objects in types as classes (GH-150676)
Bernát Gábor [Tue, 2 Jun 2026 08:03:36 +0000 (01:03 -0700)] 
gh-89554: Document standard type objects in types as classes (GH-150676)

Use the directive and the role "class" instead of "data" for classes
exposed in the types module.

2 days agogh-89554: Document weakref type objects as classes (#150678)
Bernát Gábor [Tue, 2 Jun 2026 07:59:15 +0000 (00:59 -0700)] 
gh-89554: Document weakref type objects as classes (#150678)

Use the "class" directive instead of "data" for ReferenceType,
ProxyType and CallableProxyType.

2 days agogh-89554: Document NoneType, NotImplementedType and EllipsisType as classes (GH-150682)
Bernát Gábor [Tue, 2 Jun 2026 07:55:01 +0000 (00:55 -0700)] 
gh-89554: Document NoneType, NotImplementedType and EllipsisType as classes (GH-150682)

Always use the directive and the role "class" instead of "data" for
NoneType, NotImplementedType and EllipsisType.

2 days agogh-150717: Avoid mark-array allocation for groupless regex patterns (GH-150719)
Bernát Gábor [Tue, 2 Jun 2026 07:45:30 +0000 (00:45 -0700)] 
gh-150717: Avoid mark-array allocation for groupless regex patterns (GH-150719)

state_init() always did PyMem_New(state->mark, groups*2), which for a
pattern with no capturing groups is PyMem_Malloc(0) -- a real allocation
(plus matching free) on every match/search/fullmatch call, for an array
that is never read: groupless patterns emit no MARK opcodes and group 0's
span is taken from state->start/ptr.

Guard the allocation with `if (pattern->groups)`. state->mark stays NULL
(set by the preceding memset), and both the error path and state_fini
already PyMem_Free(NULL) safely.

2 days agogh-150228: Improve the PEP 829 batch processing APIs (#150542)
Barry Warsaw [Tue, 2 Jun 2026 01:43:18 +0000 (18:43 -0700)] 
gh-150228: Improve the PEP 829 batch processing APIs (#150542)

* gh-150228: Improve the PEP 829 batch processing APIs

As previously discussed with @ncoghlan and approved for 3.15b2 by @hugovk,
this implements the batch processing APIs for addsitedir() and friends.  We
remove the `defer_processing_start_files` flag which required some implicit
module global state, and promote StartupState to the public documented API.

This also moves the bulk of the module global functions into methods of the
`StartupState` class, so it removes the awkward APIs in 3.15b1.  Now, instances
of this class are an accumulator for startup state, using `StartupState.process()`
to process them.  Callers can now batch up startup state themselves by using
the methods on this class.  The module global functions are shims for this
which preserve the legacy APIs and semantics using the new state class.

This PR also fixes the interleaving regression identified by @ncoghlan in the
same issue.  Now, .pth file sys.path extensions are added to sys.path after
the sitedir that the .pth file is found in, restoring the legacy behavior.

Along the way, I've made a lot of improvements to function docstrings,
site.rst documentation, and comments in the code explaining what's going on.

* Add a note that if known_paths is provided to StartupState.__init__(), it
  will get mutated in place.
* Improve some conditional flows.
* Improve some comments.
* Improve the what's new entry.

* Make test_impl_exec_imports_suppressed_by_matching_start() more robust

Based on PR comment, we need to read both the .pth and .start files, and prove
that the .pth file's import line (which passes a bigger increment) is not
called, but the .start file's entry point (which uses the default increment)
is called.

* As per review, move some methods to the private API

_read_pth_file() and _read_start_file() are not intended to be part of the
public API surface outside of the site module, so even though they are used by
methods outside of the StartupState class, make them privately named.

* Resolve several review feedbacks

* Move a `versionadded`
* Better list comprehension formatting (use the output from
  `ruff format --line-length 78`)

* Add docs for site.makepath() and point the case-normalization requirement to
  this utility function.
* Note that StartupState.process() is not idempotent.

* Address another feedback comment

This time, we get rid of the legacy implementation `reset` local, which was
always difficult to understand, and just implement a return value based on the
processing mode selected.

* Changes based on gh-150228 review

The comment by @encukou that started this change:

```
I still see two red flags here though: an argument that doesn't combine with
other arguments, and (another instance of) changing the return type based on
an argument.

Did you consider adding a StartupState.addsitedir(sitedir) method, instead of
the startup_state argument?
```

As it turns out, this is an even cleaner design.  By moving the bulk of the
previous module global functions into `StartupState` methods, we can get rid
of all the awkward `startup_state` keyword-only arguments which conflict
with `known_path` (Petr's first point).  We can also get rid of the
return value dichotomy (Petr's second point) because now we can preserve
exactly the Python 3.14 API in the module global functions, and implement
the better APIs in the class methods.  We also generally don't have to
pass around `process_known_sitedirs`.

Now the following module global functions are essentially shims around
class methods:

* site.addsitedir() -> StartupState.addsitedir()
* site.addusersitepackages() -> StartupState.addusersitepackages()
* site.addsitepackages() -> StartupState.addsitepackages()
* Additional minor changes
* Remove a now unused parameter

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 days agogh-150720: Remove '-d 1' in test_script_error_treatment (#150736)
László Kiss Kollár [Tue, 2 Jun 2026 00:51:51 +0000 (01:51 +0100)] 
gh-150720: Remove '-d 1' in test_script_error_treatment (#150736)

2 days agogh-150644: Tag Apple system log messages as public. (#150645)
Russell Keith-Magee [Mon, 1 Jun 2026 22:25:46 +0000 (06:25 +0800)] 
gh-150644: Tag Apple system log messages as public. (#150645)

macOS 26 changed the default visibility of "dynamic" system messages. This
changes the logging strategy to tag all messages as "public" so they are
visible in the system log without special configuration.

2 days agogh-150429: Fix sampling profiler generator stack test (#150433)
Pablo Galindo Salgado [Mon, 1 Jun 2026 20:27:39 +0000 (21:27 +0100)] 
gh-150429: Fix sampling profiler generator stack test (#150433)

2 days agogh-93417: Improve test_mimetypes (GH-150725)
Serhiy Storchaka [Mon, 1 Jun 2026 20:02:40 +0000 (23:02 +0300)] 
gh-93417: Improve test_mimetypes (GH-150725)

* Separate tests for module-level API and for the MimeTypes class.
* Add tests for mimetypes.init() and MimeTypes() with knownfiles and with
  explicitly passed files.

2 days agogh-148672: Document namespace subpackages inside regular packages (#150056)
Taeknology [Mon, 1 Jun 2026 19:22:42 +0000 (04:22 +0900)] 
gh-148672: Document namespace subpackages inside regular packages (#150056)

2 days agogh-115119: Remove superfluous TEST_COVERAGE private macro from _decimal module (GH...
Sergey B Kirpichev [Mon, 1 Jun 2026 18:41:21 +0000 (21:41 +0300)] 
gh-115119: Remove superfluous TEST_COVERAGE private macro from _decimal module (GH-149756)

It was previously shared with `libmpdec`, which is no longer vendored.

2 days agoGH-148960: Reduce the size of the debug stencils to less than half. (GH-150551)
Mark Shannon [Mon, 1 Jun 2026 16:56:16 +0000 (17:56 +0100)] 
GH-148960: Reduce the size of the debug stencils to less than half. (GH-150551)

For AArch64 linux, reduces the total bytes in the code bodies from 489kb to 218kb.
Reduces the size of the stencils files from 394k lines to 167k lines.

2 days agoGH-150478: Add "show_jit" option to `dis.dis` to show jit entry points (GH-150554)
Mark Shannon [Mon, 1 Jun 2026 16:52:40 +0000 (17:52 +0100)] 
GH-150478: Add "show_jit" option to `dis.dis` to show jit entry points (GH-150554)

* Shows `ENTER_EXECUTOR` instructions

3 days agogh-150436: Skip subprocess test on STATUS_DLL_INIT_FAILED (#150704)
Victor Stinner [Mon, 1 Jun 2026 14:50:15 +0000 (16:50 +0200)] 
gh-150436: Skip subprocess test on STATUS_DLL_INIT_FAILED (#150704)

If a subprocess spawned with CREATE_NEW_CONSOLE creation flag fails
with STATUS_DLL_INIT_FAILED return code, skip the test. It's likely a
memory allocation failure in the desktop heap memory which caused the
DLL init failure.

3 days agogh-150157: Fix critical section for PyDict_Next() in _pickle.c (GH-150158)
Thomas Kowalski [Mon, 1 Jun 2026 14:32:13 +0000 (16:32 +0200)] 
gh-150157: Fix critical section for PyDict_Next() in _pickle.c (GH-150158)

3 days agogh-149534: Fix unification of `defaultdict` and `frozendict` with `|` (#149539)
sobolevn [Mon, 1 Jun 2026 13:26:49 +0000 (16:26 +0300)] 
gh-149534: Fix unification of `defaultdict` and `frozendict` with `|` (#149539)

3 days agogh-149046: fix: correctly handle `str` subclasses in `io.StringIO` (#149047)
Thomas Kowalski [Mon, 1 Jun 2026 13:01:57 +0000 (15:01 +0200)] 
gh-149046: fix: correctly handle `str` subclasses in `io.StringIO` (#149047)

3 days agogh-80480: Remove deprecated 'u' array type code (#149535)
Sergey B Kirpichev [Mon, 1 Jun 2026 11:57:55 +0000 (14:57 +0300)] 
gh-80480: Remove deprecated 'u' array type code (#149535)

Reuse array.typecodes in tests.

3 days agogh-150368: Change Windows user group to secure identifier in test_tempfile (#150369)
Dawid Konrad Kohnke [Mon, 1 Jun 2026 11:35:48 +0000 (13:35 +0200)] 
gh-150368: Change Windows user group to secure identifier in test_tempfile (#150369)

3 days agogh-148508: Add another common pattern for iOS SSL failures to test_ssl (#150442)
Russell Keith-Magee [Mon, 1 Jun 2026 09:37:53 +0000 (17:37 +0800)] 
gh-148508: Add another common pattern for iOS SSL failures to test_ssl (#150442)

Match also '[SSL: HTTP_REQUEST] http request (_ssl.c:1143)'.

3 days agogh-150685: update bundled pip to 26.1.2 (gh-150686)
Stéphane Bidoul [Sun, 31 May 2026 19:28:02 +0000 (21:28 +0200)] 
gh-150685: update bundled pip to 26.1.2 (gh-150686)

4 days agoClarify docs for scheduler.run(blocking=False) (GH-129575)
M. Greyson Christoforo [Sun, 31 May 2026 12:11:17 +0000 (13:11 +0100)] 
Clarify docs for scheduler.run(blocking=False) (GH-129575)

4 days agogh-150636: Clarify difference between copy.copy() and the copy() methods (GH-150637)
Serhiy Storchaka [Sun, 31 May 2026 12:08:55 +0000 (15:08 +0300)] 
gh-150636: Clarify difference between copy.copy() and the copy() methods (GH-150637)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
4 days agogh-148605: Remove irepeat() thread test from test_bytes (#150576)
Victor Stinner [Sun, 31 May 2026 09:27:10 +0000 (11:27 +0200)] 
gh-148605: Remove irepeat() thread test from test_bytes (#150576)

4 days agogh-140553: Mark `*gettext` parameters as positionaly only in documentation (#140598)
Stan Ulbrych [Sun, 31 May 2026 08:08:17 +0000 (09:08 +0100)] 
gh-140553: Mark `*gettext` parameters as positionaly only in documentation (#140598)

4 days agogh-131178: Fix mimetypes CLI docs, mention that errors go to stdout (#149683)
htjworld [Sun, 31 May 2026 07:45:48 +0000 (16:45 +0900)] 
gh-131178: Fix mimetypes CLI docs, mention that errors go to stdout (#149683)

Co-authored-by: sobolevn <mail@sobolevn.me>
4 days agoCorrect frexp() docs for zero and non-finite numbers (GH-149753)
Sergey B Kirpichev [Sun, 31 May 2026 07:29:44 +0000 (10:29 +0300)] 
Correct frexp() docs for zero and non-finite numbers (GH-149753)

0.5 <= abs(m) < 1 is only true for finite nonzero numbers

4 days agogh-149609: Raise deprecation warnings for `abc.{abstractclassmethod,abstractstaticmet...
sobolevn [Sun, 31 May 2026 07:26:52 +0000 (10:26 +0300)] 
gh-149609: Raise deprecation warnings for `abc.{abstractclassmethod,abstractstaticmethod,abstractproperty}` (#149636)

4 days agogh-117291: Explain usage of null bytes in Array(c_char).value (GH-117292)
Patrick Rauscher [Sun, 31 May 2026 07:20:49 +0000 (09:20 +0200)] 
gh-117291: Explain usage of null bytes in Array(c_char).value (GH-117292)

4 days agogh-141444:fix broken URLs and examples in urllib.request.rst (#144863)
Paper Moon [Sun, 31 May 2026 02:08:18 +0000 (10:08 +0800)] 
gh-141444:fix broken URLs and examples in urllib.request.rst (#144863)

* Doc: fix broken URLs and examples in urllib.request.rst (gh-141444)

* Doc: update urllib.request examples to handle gzip compression

---------

Co-authored-by: Senthil Kumaran <senthil@python.org>
4 days agoAdd @itamaro to CODEOWNERS (#150635)
Itamar Oren [Sat, 30 May 2026 20:49:11 +0000 (13:49 -0700)] 
Add @itamaro to CODEOWNERS (#150635)

Added myself as a code owner across CI and build-system areas

4 days agogh-150372: Add missing null check on completer_word_break_characters in readline...
Thomas Kowalski [Sat, 30 May 2026 19:26:05 +0000 (21:26 +0200)] 
gh-150372: Add missing null check on completer_word_break_characters in readline.c (GH-150251)

4 days agogh-150524: Remove outdated note in binascii.a2b_hex() documentation (GH-150525)
Joshix-1 [Sat, 30 May 2026 19:18:39 +0000 (21:18 +0200)] 
gh-150524: Remove outdated note in binascii.a2b_hex() documentation (GH-150525)

bytes.fromhex() accepts ASCII bytes and bytes-like objects as input since 3.14

4 days agogh-123138: Updated email.headerregistry docs to include required keyword parse_tree...
Gustaf [Sat, 30 May 2026 17:59:42 +0000 (19:59 +0200)] 
gh-123138: Updated email.headerregistry docs to include required keyword parse_tree (GH-134450)

5 days agogh-150406: Check result of PyThread_allocate_lock() for netdb_lock (GH-150407)
Thomas Kowalski [Sat, 30 May 2026 16:25:40 +0000 (18:25 +0200)] 
gh-150406: Check result of PyThread_allocate_lock() for netdb_lock (GH-150407)

5 days agogh-129851: Fix the documentation for -m command (GH-129862)
Dhruv Singla [Sat, 30 May 2026 15:47:14 +0000 (21:17 +0530)] 
gh-129851: Fix the documentation for -m command (GH-129862)

5 days agogh-144774: Add critical section in `BaseException.__setstate__` (#150578)
Brij Kapadia [Sat, 30 May 2026 15:37:27 +0000 (11:37 -0400)] 
gh-144774: Add critical section in `BaseException.__setstate__` (#150578)

5 days agoRemove unneeded LaTeX code from latex_elements['preamble'] (GH-124630)
Jean-François B. [Sat, 30 May 2026 15:19:56 +0000 (17:19 +0200)] 
Remove unneeded LaTeX code from latex_elements['preamble'] (GH-124630)

It was a workaround for Sphinx < 1.5.

5 days agogh-109503: Fix document for shutil.move() on usage of os.rename() since it's inaccura...
Fang Li [Sat, 30 May 2026 14:26:03 +0000 (07:26 -0700)] 
gh-109503: Fix document for shutil.move() on usage of os.rename() since it's inaccurate (GH-109507)

Nonatomic move might be used even if the files are
on the same filesystem in some cases.

5 days agogh-135898: Add section to free-threading howto about memory usage (#143279)
Neil Schemenauer [Sat, 30 May 2026 10:41:33 +0000 (03:41 -0700)] 
gh-135898: Add section to free-threading howto about memory usage (#143279)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
5 days agogh-121109: Fix performance of tarfile reading with "r|*" (GH-121296)
Tomi Belan [Sat, 30 May 2026 09:23:50 +0000 (11:23 +0200)] 
gh-121109: Fix performance of tarfile reading with "r|*" (GH-121296)

5 days agogh-150501: Correct `inspect.getattr_static` docs signature (#150504)
Jonathan Dung [Sat, 30 May 2026 09:18:25 +0000 (17:18 +0800)] 
gh-150501: Correct `inspect.getattr_static` docs signature (#150504)

5 days agogh-150560: Fix crash in XML parser on invalid XML with multi-byte encoding (GH-150568)
Serhiy Storchaka [Fri, 29 May 2026 21:23:32 +0000 (00:23 +0300)] 
gh-150560: Fix crash in XML parser on invalid XML with multi-byte encoding (GH-150568)

5 days agogh-149489: Fix ElementTree serialization to HTML (GH-149490)
Serhiy Storchaka [Fri, 29 May 2026 21:04:50 +0000 (00:04 +0300)] 
gh-149489: Fix ElementTree serialization to HTML (GH-149490)

* The content of comments, processing instructions and elements "xmp",
  "iframe", "noembed", "noframes", and "plaintext" is no longer escaped.
* The "plaintext" element no longer have the closing tag.
* Add support of empty attributes (with value None).

5 days agogh-149056: Properly pass array_hook in json.load() to json.loads() (GH-149057)
Thomas Kowalski [Fri, 29 May 2026 19:53:21 +0000 (21:53 +0200)] 
gh-149056: Properly pass array_hook in json.load() to json.loads() (GH-149057)

5 days agogh-150403: Document frozendict in language reference Mappings section (GH-150404)
Oral Ersoy Dokumacı [Fri, 29 May 2026 19:40:22 +0000 (21:40 +0200)] 
gh-150403: Document frozendict in language reference Mappings section (GH-150404)

6 days agogh-132372: Speed up logging.config existing logger handling (GH-150242)
esadomer [Fri, 29 May 2026 15:50:05 +0000 (18:50 +0300)] 
gh-132372: Speed up logging.config existing logger handling (GH-150242)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
6 days agoAdd a security warning about `pydoc`'s HTTP server (#150409)
Stan Ulbrych [Fri, 29 May 2026 12:29:59 +0000 (13:29 +0100)] 
Add a security warning about `pydoc`'s HTTP server (#150409)

6 days agoFix typos in InternalDocs/compiler.md (#149915)
Langyan [Fri, 29 May 2026 10:14:20 +0000 (18:14 +0800)] 
Fix typos in InternalDocs/compiler.md (#149915)

6 days agogh-150454: Fix wrong-interpreter return in import_run_extension error path (#150455)
pengyu lee [Fri, 29 May 2026 10:03:37 +0000 (18:03 +0800)] 
gh-150454: Fix wrong-interpreter return in import_run_extension error path (#150455)

6 days agogh-150345: Fix incorrect reference in BaseSelectorEventLoop docstring (#150538)
kodsurfer [Fri, 29 May 2026 09:54:58 +0000 (12:54 +0300)] 
gh-150345: Fix incorrect reference in BaseSelectorEventLoop docstring (#150538)

6 days agogh-150107: Fix asyncio sendfile fallback ignoring non-zero offset (#150270)
Grant Herman [Fri, 29 May 2026 09:40:57 +0000 (05:40 -0400)] 
gh-150107: Fix asyncio sendfile fallback ignoring non-zero offset (#150270)

Co-authored-by: Victor Stinner <vstinner@python.org>
6 days agogh-148587: Make sys.lazy_modules match PEP and keep internal lazy submodules tracking...
Bartosz Sławecki [Fri, 29 May 2026 00:55:47 +0000 (02:55 +0200)] 
gh-148587: Make sys.lazy_modules match PEP and keep internal lazy submodules tracking internal (#150086)

Make sys.lazy_modules match PEP and keep internal lazy submodules tracking internal

Co-authored-by: Dino Viehland <dinoviehland@meta.com>
6 days agogh-139398: [Enum] Add supported sunder names to `__dir__` for REPL completions (GH...
Rafael Weingartner-Ortner [Thu, 28 May 2026 19:55:38 +0000 (21:55 +0200)] 
gh-139398: [Enum] Add supported sunder names to `__dir__` for REPL completions (GH-139985)

* Add supported sunder names to Enum `__dir__`

This change adds the sunder names `_generate_next_value_`
and `_missing_` to the `__dir__` method of `EnumType` and `Enum`.
In Addition, The instance level sunder names
`_add_alias_` and `_add_value_alias_` are added to `Enum.__dir__`.

With the sunder names exposed in the `dir()` method,
the REPL autocomplete will also show them.

---------

Co-authored-by: SimonGPrs <107691772+SimonGPrs@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
6 days agogh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (#150089)
Pradyun Gedam [Thu, 28 May 2026 16:48:51 +0000 (17:48 +0100)] 
gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (#150089)

Avoid the runtime environment from affecting the tests' behaviours,
which notably checks the warning filters which can be controlled by
various PYTHON environment variables.

7 days agogh-115988: Add ARM64 and RISCV BCJ filters constants in lzma module (GH-115989)
Chien Wong [Thu, 28 May 2026 15:05:03 +0000 (23:05 +0800)] 
gh-115988: Add ARM64 and RISCV BCJ filters constants in lzma module (GH-115989)

---------

Signed-off-by: Chien Wong <m@xv97.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
7 days agogh-150311: Fix minor issues in configure.ac for Cygwin (#150328)
Armaan Sandhu [Thu, 28 May 2026 12:38:39 +0000 (18:08 +0530)] 
gh-150311: Fix minor issues in configure.ac for Cygwin (#150328)

- Use 'CYGWIN' (uppercase) for ac_sys_system to match the casing used
  in all case-pattern references throughout configure.ac.
- Fix LDLIBRARY for static builds: use '.a' extension instead of
  '.dll.a' when shared libraries are disabled.
- Replace hardcoded 'gcc' and 'g++' with '$(CC)' and '$(CXX)' in
  LDSHARED/LDCXXSHARED for Cygwin.

Co-authored-by: Victor Stinner <vstinner@python.org>
7 days agoFix docs for PyThreadState_GetDict() in threads.rst (#150401)
manoj-marimuthu [Thu, 28 May 2026 12:13:58 +0000 (17:43 +0530)] 
Fix docs for PyThreadState_GetDict() in threads.rst (#150401)

7 days agogh-85989: Add skip_if_double_rounding to test.support (#150219)
Sergey B Kirpichev [Thu, 28 May 2026 11:42:39 +0000 (14:42 +0300)] 
gh-85989: Add skip_if_double_rounding to test.support (#150219)

Co-authored-by: Victor Stinner <vstinner@python.org>
7 days agogh-148871: make `LOAD_COMMON_CONSTANT` use immortal stackref borrows (GH-149625)
Neko Asakura [Thu, 28 May 2026 11:27:37 +0000 (19:27 +0800)] 
gh-148871: make `LOAD_COMMON_CONSTANT` use immortal stackref borrows (GH-149625)

7 days agoUpdate `qsbr.md` doc to be more accurate (#148537)
Neil Schemenauer [Thu, 28 May 2026 10:30:22 +0000 (03:30 -0700)] 
Update `qsbr.md` doc to be more accurate (#148537)

7 days agoAdd prominent crash warning to `ctypes` docs (GH-150410)
Stan Ulbrych [Thu, 28 May 2026 08:13:14 +0000 (09:13 +0100)] 
Add prominent crash warning to `ctypes` docs (GH-150410)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
7 days agogh-149029: Update SQLite to 3.53.1 for binary releases (#149767)
Adam Johnson [Wed, 27 May 2026 22:03:34 +0000 (23:03 +0100)] 
gh-149029: Update SQLite to 3.53.1 for binary releases (#149767)

7 days agogh-84353: Preserve non-UTF-8 filenames when appending to ZipFile (GH-150091)
Serhiy Storchaka [Wed, 27 May 2026 17:56:38 +0000 (20:56 +0300)] 
gh-84353: Preserve non-UTF-8 filenames when appending to ZipFile (GH-150091)

Preserve non-UTF-8 filenames when appending to a ZipFile.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
8 days agogh-141984: Remove accidental merge markers (GH-150517)
Petr Viktorin [Wed, 27 May 2026 14:20:50 +0000 (16:20 +0200)] 
gh-141984: Remove accidental merge markers (GH-150517)

8 days agogh-141984: Reword docs on "enclosed" atom grammar (GH-148622)
Petr Viktorin [Wed, 27 May 2026 12:32:33 +0000 (14:32 +0200)] 
gh-141984: Reword docs on "enclosed" atom grammar (GH-148622)

Reorganize and reword the docs on atoms in parentheses, brackets and braces:
parenthesized groups, list/set/dict/tuple displays, and comprehensions.
(Generator expressions and yield atoms are left for later.)

In the spirit of better matching the underlying grammar, *comprehensions* are
covered separately from non-comprehension displays. Also, parenthesized forms
(with a single expression) and tuple displays are separated.
All sections are rewritten to start with simple cases and build up to the full
formal grammar.

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
8 days agogh-150389: Make perf profiler tests resilient (#150437)
Pablo Galindo Salgado [Wed, 27 May 2026 12:22:56 +0000 (13:22 +0100)] 
gh-150389: Make perf profiler tests resilient (#150437)

8 days agogh-149861: Fix rule in match statement `case_block` PEG grammar (GH-149908)
Ivy Xu [Wed, 27 May 2026 10:25:21 +0000 (18:25 +0800)] 
gh-149861: Fix rule in match statement `case_block` PEG grammar (GH-149908)

8 days agogh-149571: Fix the C implementation of Element.itertext() (GH-149929)
Serhiy Storchaka [Wed, 27 May 2026 10:23:28 +0000 (13:23 +0300)] 
gh-149571: Fix the C implementation of Element.itertext() (GH-149929)

It no longer emits text for comments and processing instructions.

8 days agogh-149879: Fix test_grp on Cygwin (#150495)
Victor Stinner [Tue, 26 May 2026 21:16:16 +0000 (23:16 +0200)] 
gh-149879: Fix test_grp on Cygwin (#150495)

8 days agogh-62259: Add support of multi-byte encodings in the XML parser (GH-149860)
Serhiy Storchaka [Tue, 26 May 2026 19:40:25 +0000 (22:40 +0300)] 
gh-62259: Add support of multi-byte encodings in the XML parser (GH-149860)

Supported encodings: "cp932", "cp949", "cp950", "Big5","EUC-JP",
"GB2312", "GBK", "johab", and "Shift_JIS".

Partially supported encodings (only BMP characters): "Big5-HKSCS",
"EUC_JIS-2004", "EUC_JISX0213", "Shift_JIS-2004", "Shift_JISX0213",
"utf-8-sig" and non-standard aliases like "UTF8" (without hyphen).

The parser now raises ValueError for known unsupported
multi-byte encodings such us "ISO-2022-JP" or "raw-unicode-escape"
instead of failing later, when encounter non-ASCII data.

8 days agogh-150486: Remove dead `_buffer_factory` attribute from `_SelectorDatagramTransport...
deadlovelll [Tue, 26 May 2026 19:07:27 +0000 (22:07 +0300)] 
gh-150486: Remove dead `_buffer_factory` attribute from `_SelectorDatagramTransport` (#150487)

8 days agogh-88726: Stop using non-standard charset names eucgb2312_cn and big5_tw in email...
Serhiy Storchaka [Tue, 26 May 2026 18:52:47 +0000 (21:52 +0300)] 
gh-88726: Stop using non-standard charset names eucgb2312_cn and big5_tw in email (GH-149959)

8 days agogh-149879: Fix test_embed on Cygwin (#150441)
Victor Stinner [Tue, 26 May 2026 16:33:08 +0000 (18:33 +0200)] 
gh-149879: Fix test_embed on Cygwin (#150441)