]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 months agogh-134869: Fix Ctrl+C corrupts REPL autocomplete (#134929)
ggqlq [Mon, 18 Aug 2025 20:54:39 +0000 (04:54 +0800)] 
gh-134869: Fix Ctrl+C corrupts REPL  autocomplete (#134929)

2 months agogh-132947: Apply changes from importlib_metadata 8.7 (#137885)
Jason R. Coombs [Mon, 18 Aug 2025 17:54:10 +0000 (10:54 -0700)] 
gh-132947: Apply changes from importlib_metadata 8.7 (#137885)

* Copied files from python/importlib_metadata@b67ac80c49.

2 months agoGH-137623: Use an AC decorator for docstring line length enforcement (#137690)
Adam Turner [Mon, 18 Aug 2025 17:29:00 +0000 (18:29 +0100)] 
GH-137623: Use an AC decorator for docstring line length enforcement (#137690)

2 months agogh-137044: Make resource.RLIM_INFINITY always positive (GH-137511)
Serhiy Storchaka [Mon, 18 Aug 2025 16:28:56 +0000 (19:28 +0300)] 
gh-137044: Make resource.RLIM_INFINITY always positive (GH-137511)

It is now a positive integer larger larger than any limited resource value.
This simplifies comparison of the resource values.
Previously, it could be negative, such as -1 or -3, depending on platform.

Deprecation warning is emitted if the old negative value is passed.

2 months agogh-44538: Mention nested classes/functions in doctest docs (GH-137870)
Bartosz Sławecki [Mon, 18 Aug 2025 14:58:23 +0000 (16:58 +0200)] 
gh-44538: Mention nested classes/functions in doctest docs (GH-137870)

2 months agogh-73487: Convert ``_decimal`` to use Argument Clinic (part 2) (#137637)
Sergey B Kirpichev [Mon, 18 Aug 2025 13:21:00 +0000 (16:21 +0300)] 
gh-73487: Convert ``_decimal`` to use Argument Clinic (part 2) (#137637)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 months agogh-135862: add C contiguous one-dimensional buffer requirement to `asyncio.StreamWrit...
Kumar Aditya [Mon, 18 Aug 2025 13:06:43 +0000 (18:36 +0530)] 
gh-135862: add C contiguous one-dimensional buffer requirement to `asyncio.StreamWriter` docs (#137910)

2 months agogh-135228: Create __dict__ and __weakref__ descriptors for object (GH-136966)
Petr Viktorin [Mon, 18 Aug 2025 12:25:51 +0000 (14:25 +0200)] 
gh-135228: Create __dict__ and __weakref__ descriptors for object (GH-136966)

This partially reverts #137047, keeping the tests for GC collectability of the
original class that dataclass adds `__slots__` to.
The reference leaks solved there are instead solved by having the `__dict__` &
`__weakref__` descriptors not tied to (and referencing) their class.

Instead, they're shared between all classes that need them (within
an interpreter).
The `__objclass__` ol the descriptors is set to `object`, since these
descriptors work with *any* object. (The appropriate checks were already
made in the get/set code, so the `__objclass__` check was redundant.)

The repr of these descriptors (and any others whose `__objclass__` is `object`)
now doesn't mention the objclass.

This change required adjustment of introspection code that checks
`__objclass__` to determine an object's “own” (i.e. not inherited) `__dict__`.
Third-party code that does similar introspection of the internals will also
need adjusting.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 months agogh-127859: Fixed documentation for call_later and call_at for early wakeup in asyncio...
Bar Harel [Mon, 18 Aug 2025 12:18:54 +0000 (13:18 +0100)] 
gh-127859: Fixed documentation for call_later and call_at for early wakeup in asyncio (#137859)

2 months agobpo-38735: Don't fail when importing from / with sys.pycache_prefix set (GH-30456)
Petr Viktorin [Mon, 18 Aug 2025 11:53:01 +0000 (13:53 +0200)] 
bpo-38735: Don't fail when importing from / with sys.pycache_prefix set (GH-30456)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 months agogh-131885: Use positional-only markers for the ``decimal`` module (#131990)
Semyon Moroz [Mon, 18 Aug 2025 11:49:21 +0000 (11:49 +0000)] 
gh-131885: Use positional-only markers for the ``decimal`` module (#131990)

2 months agogh-137847: Add examples for UUIDv6-8 (#137848)
Weilin Du [Mon, 18 Aug 2025 11:24:19 +0000 (19:24 +0800)] 
gh-137847: Add examples for UUIDv6-8 (#137848)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 months agogh-137729: Fix support for locales with @-modifiers (GH-137253)
Serhiy Storchaka [Mon, 18 Aug 2025 07:11:15 +0000 (10:11 +0300)] 
gh-137729: Fix support for locales with @-modifiers (GH-137253)

2 months agogh-127146: Emscripten: Add test_sample_profiler skips where needed (#137815)
Hood Chatham [Sun, 17 Aug 2025 23:57:15 +0000 (01:57 +0200)] 
gh-127146: Emscripten: Add test_sample_profiler skips where needed (#137815)

Emscripten doesn't have the `socket.SO_REUSEADDR` constant; skip tests that
require that symbol to exist.

2 months agoEmend an error in ``string.templatelib`` example output (#137890)
Christoph Walcher [Sun, 17 Aug 2025 22:12:32 +0000 (00:12 +0200)] 
Emend an error in ``string.templatelib`` example output (#137890)

2 months agoGH-137841: Open tzdata/zones file with UTF-8 encoding (#137872)
Adam Turner [Sun, 17 Aug 2025 16:13:57 +0000 (17:13 +0100)] 
GH-137841: Open tzdata/zones file with UTF-8 encoding (#137872)

2 months agogh-135661: Fix parsing unterminated bogus comments in HTMLParser (GH-137873)
Serhiy Storchaka [Sun, 17 Aug 2025 10:37:50 +0000 (13:37 +0300)] 
gh-135661: Fix parsing unterminated bogus comments in HTMLParser (GH-137873)

Bogus comments that start with "<![CDATA[" should not include the starting "!"
in its value.

2 months agogh-131591: fix formatting of remote debugger docs (#137225)
Rafael Fontenelle [Sun, 17 Aug 2025 05:41:31 +0000 (02:41 -0300)] 
gh-131591: fix formatting of remote debugger docs (#137225)

2 months agogh-137846: Add missing 'be' to profile doc. (#137856)
Terry Jan Reedy [Sat, 16 Aug 2025 14:29:47 +0000 (10:29 -0400)] 
gh-137846: Add missing 'be' to profile doc. (#137856)

Insert 'be' into 'will interpreted'.

2 months agogh-137725: Convert faulthandler to Argument Clinic (#137726)
Victor Stinner [Sat, 16 Aug 2025 13:16:04 +0000 (15:16 +0200)] 
gh-137725: Convert faulthandler to Argument Clinic (#137726)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 months agogh-90483: fix docs of `SubprocessTransport.get_pipe_transport ` (#137852)
Kumar Aditya [Sat, 16 Aug 2025 11:11:45 +0000 (16:41 +0530)] 
gh-90483: fix docs of `SubprocessTransport.get_pipe_transport ` (#137852)

2 months agogh-101359: clarify docs for `asyncio.Event.clear` (#137849)
Kumar Aditya [Sat, 16 Aug 2025 10:50:54 +0000 (16:20 +0530)] 
gh-101359: clarify docs for `asyncio.Event.clear` (#137849)

2 months agogh-120492: Sync importlib_metadata 8.2.0 (#124033)
Jason R. Coombs [Fri, 15 Aug 2025 21:19:23 +0000 (14:19 -0700)] 
gh-120492: Sync importlib_metadata 8.2.0 (#124033)

* Sync with importlib_metadata 8.2.0

Removes deprecated behaviors, including support for `PackageMetadata.__getitem__` returning None for missing keys and Distribution subclasses not implementing abstract methods.
Prioritizes valid dists to invalid dists when retrieving by name (python/cpython/#120492). Adds SimplePath to `importlib.metadata.__all__`.

* Add blurb

2 months agogh-92936: update `http.cookies` docs post GH-113663 (#137566)
Nick Burns [Fri, 15 Aug 2025 20:47:46 +0000 (13:47 -0700)] 
gh-92936: update `http.cookies` docs post GH-113663 (#137566)

* add versionchanged and example with quotes in cookie value

* update whatsnew with http.cookies change

* Update Doc/library/http.cookies.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Update Doc/whatsnew/3.15.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* spelling, quote

* demonstrate json

* Update Doc/library/http.cookies.rst

Co-authored-by: Senthil Kumaran <senthil@python.org>
* Apply suggestions from code review

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* shorter description

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Senthil Kumaran <senthil@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 months ago gh-131178: Add tests for `site` command-line interface (GH-133582)
ggqlq [Fri, 15 Aug 2025 18:00:43 +0000 (02:00 +0800)] 
 gh-131178: Add tests for `site` command-line interface  (GH-133582)

2 months agogh-137777: Disband the 'Program Frameworks' chapter (#137796)
rimchoi [Fri, 15 Aug 2025 17:41:09 +0000 (02:41 +0900)] 
gh-137777: Disband the 'Program Frameworks' chapter (#137796)

2 months agogh-137078: Fix keyword typo recognition when executed over files (#137079)
Pablo Galindo Salgado [Fri, 15 Aug 2025 15:14:13 +0000 (16:14 +0100)] 
gh-137078: Fix keyword typo recognition when executed over files (#137079)

2 months agoGH-123299: Copyedit 3.14 What's New: Removed (#137794)
Adam Turner [Fri, 15 Aug 2025 14:56:13 +0000 (15:56 +0100)] 
GH-123299: Copyedit 3.14 What's New: Removed (#137794)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 months agogh-137808: use argument clinic for `_thread.lock` and `_thread.RLock` (#137809)
Kumar Aditya [Fri, 15 Aug 2025 13:58:10 +0000 (19:28 +0530)] 
gh-137808: use argument clinic for `_thread.lock` and `_thread.RLock` (#137809)

2 months agogh-137760: Update REPL constants documentation (gh-137798)
Chaemin-Lim [Fri, 15 Aug 2025 13:53:15 +0000 (22:53 +0900)] 
gh-137760: Update REPL constants documentation (gh-137798)

2 months agoGH-123299: Copyedit 3.14 What's New: Optimizations (#137789)
Adam Turner [Fri, 15 Aug 2025 11:14:45 +0000 (12:14 +0100)] 
GH-123299: Copyedit 3.14 What's New: Optimizations (#137789)

2 months agoMention the "context manager" keyword in concurrent.futures documentation (#130976)
Jakub Stasiak [Fri, 15 Aug 2025 10:00:22 +0000 (12:00 +0200)] 
Mention the "context manager" keyword in concurrent.futures documentation (#130976)

2 months agogh-137716: Fix double period in AttributeError message for invalid mock assertions...
ROHAN WINSOR [Thu, 14 Aug 2025 21:26:02 +0000 (02:56 +0530)] 
gh-137716:  Fix double period in AttributeError message for invalid mock assertions (#137717)

2 months agogh-135241: Make unpickling of booleans in protocol 0 more strict (GH-135242)
Justin Applegate [Thu, 14 Aug 2025 19:22:37 +0000 (13:22 -0600)] 
gh-135241: Make unpickling of booleans in protocol 0 more strict (GH-135242)

The Python pickle module looks for "00" and "01" but _pickle only looked
for 2 characters that parsed to 0 or 1, meaning some payloads like "+0" or
" 0" would lead to different results in different implementations.

2 months agogh-135661: Fix CDATA section parsing in HTMLParser (GH-135665)
Serhiy Storchaka [Thu, 14 Aug 2025 18:13:22 +0000 (21:13 +0300)] 
gh-135661: Fix CDATA section parsing in HTMLParser (GH-135665)

"] ]>" and "]] >" no longer end the CDATA section.

Make CDATA section parsing  context depending.
Add private method HTMLParser._set_support_cdata() to change the context.
If called with True, "<[CDATA[" starts a CDATA section which ends with "]]>".
If called with False, "<[CDATA[" starts a bogus comments which ends with ">".

2 months agogh-137576: Fix for Basic REPL showing incorrect code in tracebacks with `PYTHONSTARTU...
adam j hartz [Thu, 14 Aug 2025 17:58:11 +0000 (13:58 -0400)] 
gh-137576: Fix for Basic REPL showing incorrect code in tracebacks with `PYTHONSTARTUP` (#137625)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2 months agoUpdate link to translating in the devguide in `bugs.rst` (#137736)
Stan Ulbrych [Thu, 14 Aug 2025 16:14:50 +0000 (18:14 +0200)] 
Update link to translating in the devguide in `bugs.rst` (#137736)

2 months agogh-123299: Update What's new in Python 3.14: typos and misplaced item. (#136665)
Hunter Hogan [Thu, 14 Aug 2025 16:14:33 +0000 (11:14 -0500)] 
gh-123299: Update What's new in Python 3.14: typos and misplaced item. (#136665)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2 months agogh-109975: Indicate the minimum version for PyREPL in the tutorial (#136046)
Konstantin Morenko [Thu, 14 Aug 2025 15:45:12 +0000 (18:45 +0300)] 
gh-109975: Indicate the minimum version for PyREPL in the tutorial (#136046)

2 months agogh-133403: Run `mypy` on `Tools/build/check_warnings.py` (#137700)
sobolevn [Thu, 14 Aug 2025 13:58:02 +0000 (16:58 +0300)] 
gh-133403: Run `mypy` on `Tools/build/check_warnings.py` (#137700)

2 months agogh-74185: repr() of ImportError now contains attributes name and path (#136770)
Yoav Nir [Thu, 14 Aug 2025 13:14:00 +0000 (14:14 +0100)] 
gh-74185: repr() of ImportError now contains attributes name and path (#136770)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: ynir3 <ynir3@bloomberg.net>
2 months agogh-125854: Improve error messages for invalid category in the warnings module (GH...
Serhiy Storchaka [Thu, 14 Aug 2025 11:59:04 +0000 (14:59 +0300)] 
gh-125854: Improve error messages for invalid category in the warnings module (GH-137750)

Include the type name if the category is a type, but not a Warning
subclass, instead of just 'type'.

2 months agogh-137749: Python 3.14 installer is for macOS 10.15 and later (#137753)
Hugo van Kemenade [Thu, 14 Aug 2025 11:01:45 +0000 (14:01 +0300)] 
gh-137749: Python 3.14 installer is for macOS 10.15 and later (#137753)

2 months agogh-130821: Add type information to error messages for invalid return type (GH-130835)
Semyon Moroz [Thu, 14 Aug 2025 08:04:41 +0000 (08:04 +0000)] 
gh-130821: Add type information to error messages for invalid return type (GH-130835)

2 months agoGH-137573: mark _PyOptimizer_Optimize as no inline (GH-137731)
Sachin Shah [Thu, 14 Aug 2025 08:00:00 +0000 (03:00 -0500)] 
GH-137573: mark _PyOptimizer_Optimize as no inline (GH-137731)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 months agogh-132339: Add support for OpenSSL 3.5 (GH-137720)
Zachary Ware [Thu, 14 Aug 2025 04:18:03 +0000 (23:18 -0500)] 
gh-132339: Add support for OpenSSL 3.5 (GH-137720)

* Add OpenSSL 3.5.2 definitions to Modules/_ssl_data_35.h (moved from Modules/_ssl_data_34.h)

* Demote OpenSSL 3.1 to "old", remove it from CI

* Update all OpenSSL versions to latest patchlevel in CI config and multissltests defaults

* Add OpenSSL 3.5.2 to CI configuration and multissltests default list

* Fix a typo in the argument parser description of multissltests.py

2 months agoUse the latest dev container image perpetually (#137734)
Brett Cannon [Wed, 13 Aug 2025 21:05:08 +0000 (14:05 -0700)] 
Use the latest dev container image perpetually (#137734)

With `Tools/wasm/wasi` now selecting the appropriate WASI SDK based on the supported version, we can now use the `latest` label of the image.

2 months agogh-131788: make resource_tracker re-entrant safe (GH-131787)
Thomas Grainger [Wed, 13 Aug 2025 20:00:23 +0000 (21:00 +0100)] 
gh-131788: make resource_tracker re-entrant safe (GH-131787)

* make resource_tracker re-entrant safe
* Update Lib/multiprocessing/resource_tracker.py
* trim trailing whitespace
* use f-string and args = [x, *y, z]
* raise self._reentrant_call_error

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 months agogh-137400: Fix thread-safety issues when profiling all threads (gh-137518)
Sam Gross [Wed, 13 Aug 2025 18:15:12 +0000 (14:15 -0400)] 
gh-137400: Fix thread-safety issues when profiling all threads (gh-137518)

There were a few thread-safety issues when profiling or tracing all
threads via PyEval_SetProfileAllThreads or PyEval_SetTraceAllThreads:

* The loop over thread states could crash if a thread exits concurrently
  (in both the free threading and default build)
* The modification of `c_profilefunc` and `c_tracefunc` wasn't
  thread-safe on the free threading build.

2 months agoAdd internal doc describing the stack protection mechanism (GH137663)
Mark Shannon [Wed, 13 Aug 2025 18:04:25 +0000 (19:04 +0100)] 
Add internal doc describing the stack protection mechanism (GH137663)

2 months agogh-87281: Improve documentation for locale.setlocale() and locale.getlocale() (GH...
Serhiy Storchaka [Wed, 13 Aug 2025 17:49:33 +0000 (20:49 +0300)] 
gh-87281: Improve documentation for locale.setlocale() and locale.getlocale() (GH-137313)

Add a section explaining the locale name formats.

2 months agogh-137681: Always initialize exception handler for new instruction (#137655)
Dino Viehland [Wed, 13 Aug 2025 15:58:26 +0000 (08:58 -0700)] 
gh-137681: Always initialize exception handler for new instruction (#137655)

Always initialize exception handler for new instruction

2 months agogh-137226: Fix behavior of ForwardRef.evaluate with type_params (#137227)
Jelle Zijlstra [Wed, 13 Aug 2025 13:47:47 +0000 (06:47 -0700)] 
gh-137226: Fix behavior of ForwardRef.evaluate with type_params (#137227)

The previous behavior was copied from earlier typing code. It works around the way
typing.get_type_hints passes its namespaces, but I don't think the behavior is logical
or correct.

2 months agogh-73487: Convert `_decimal` to use Argument Clinic (part 1) (#137606)
Sergey B Kirpichev [Wed, 13 Aug 2025 12:41:57 +0000 (15:41 +0300)] 
gh-73487: Convert `_decimal` to use Argument Clinic (part 1) (#137606)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2 months agogh-64612: Remove error handlers list under `open()` (GH-137304)
Stan Ulbrych [Wed, 13 Aug 2025 10:38:30 +0000 (12:38 +0200)] 
gh-64612: Remove  error handlers list under `open()` (GH-137304)

This was duplicated and out-of date.

2 months agogh-137668: Document that ord() supports also bytes and bytearray (GH-137669)
Serhiy Storchaka [Wed, 13 Aug 2025 09:12:16 +0000 (12:12 +0300)] 
gh-137668: Document that ord() supports also bytes and bytearray (GH-137669)

2 months agogh-131146: Fall back to `month_name` if `standalone_month_name`s aren't distinct...
Petr Viktorin [Wed, 13 Aug 2025 07:03:05 +0000 (09:03 +0200)] 
gh-131146: Fall back to `month_name` if `standalone_month_name`s aren't distinct (GH-137674)

Some systems reportedly don't expand '%OB' and '%Ob'.
In this case (and similar theoretically possible ones, like expanding to empty
string or 'OB'), fall back to the month_name & month_abbr.

2 months agoGH-137630: Argument Clinic: Reduce use of 'as' for renaming in ``_interpretersmodule...
Adam Turner [Tue, 12 Aug 2025 22:28:38 +0000 (23:28 +0100)] 
GH-137630: Argument Clinic: Reduce use of 'as' for renaming in ``_interpretersmodule.c`` (#137680)

2 months agogh-133403: Run `mypy` on `Tools/build/mypy.ini` changes (#137692)
sobolevn [Tue, 12 Aug 2025 22:01:50 +0000 (01:01 +0300)] 
gh-133403: Run `mypy` on `Tools/build/mypy.ini` changes (#137692)

2 months agoGH-137623: Begin enforcing docstring length in Argument Clinic (#137624)
Adam Turner [Tue, 12 Aug 2025 20:17:35 +0000 (21:17 +0100)] 
GH-137623: Begin enforcing docstring length in Argument Clinic (#137624)

2 months agogh-136672: Docs: Move Enum functions and add examples (GH-136791)
RafaelWO [Tue, 12 Aug 2025 19:28:27 +0000 (21:28 +0200)] 
gh-136672: Docs: Move Enum functions and add examples (GH-136791)

* Docs: Move Enum functions and add examples

When the `Enum` functions `_add_alias_` and `_add_value_alias_` were added in de6bca956432cc852a4a41e2a2cee9cdacd19f35, the documentation for them was done under `EnumType` instead of `Enum`.

This change moves them to the docs of the `Enum` class and adds an example for each function.

---------

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2 months agoGH-137562: Fix github-issue number for deallocated objects in cache bug (GH-137614)
Sergey Miryanov [Tue, 12 Aug 2025 17:32:53 +0000 (10:32 -0700)] 
GH-137562: Fix github-issue number for deallocated objects in cache bug (GH-137614)

2 months agogh-137242: Add Android CI job (#137186)
Malcolm Smith [Tue, 12 Aug 2025 17:16:04 +0000 (18:16 +0100)] 
gh-137242: Add Android CI job (#137186)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2 months agoGH-137630: Convert ``_interpreters`` to use Argument Clinic (#137631)
Adam Turner [Tue, 12 Aug 2025 15:23:13 +0000 (16:23 +0100)] 
GH-137630: Convert ``_interpreters`` to use Argument Clinic  (#137631)

2 months agogh-133403: Check `generate_stdlib_module_names` and `check_extension_modules` with...
sobolevn [Tue, 12 Aug 2025 15:11:18 +0000 (18:11 +0300)] 
gh-133403: Check `generate_stdlib_module_names` and `check_extension_modules` with mypy (#137546)

2 months agogh-137288: Update 3.14 magic numbers (GH-137665)
Hugo van Kemenade [Tue, 12 Aug 2025 11:52:09 +0000 (14:52 +0300)] 
gh-137288: Update 3.14 magic numbers (GH-137665)

2 months agogh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class...
Jelle Zijlstra [Tue, 12 Aug 2025 11:16:54 +0000 (04:16 -0700)] 
gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (take 2) (GH-137047)

Remove the `__dict__` and `__weakref__` descriptors from the original class when creating a dataclass from it.

An interesting hack, but more localized in scope than gh-135230.

This may be a breaking change if people intentionally keep the original class around
when using `@dataclass(slots=True)`, and then use `__dict__` or `__weakref__` on the
original class.

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 months agogh-126008: Improve docstrings for Tkinter cget and configure methods (GH-133303)
Serhiy Storchaka [Tue, 12 Aug 2025 04:55:01 +0000 (07:55 +0300)] 
gh-126008: Improve docstrings for Tkinter cget and configure methods (GH-133303)

* Explain the behavior of Widget.configure() depending on arguments.
* Unify descriptions.
* Replace "resource" with "option".

2 months agogh-131885: Use positional-only markers for ``max()`` and ``min()`` (#131868)
Evan Kohilas [Mon, 11 Aug 2025 23:29:17 +0000 (09:29 +1000)] 
gh-131885: Use positional-only markers for ``max()`` and ``min()`` (#131868)

2 months agoGH-137426: Remove code deprecation of `importlib.abc.ResourceLoader` (GH-137567)
Brett Cannon [Mon, 11 Aug 2025 23:18:54 +0000 (16:18 -0700)] 
GH-137426: Remove code deprecation of `importlib.abc.ResourceLoader` (GH-137567)

Enough other classes in `importlib.abc` inherit from the class and the deprecation was to redirect people to `TraversableResources`. The documentation now makes it clear the class only exists for backwards compatibility.

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 months agogh-125897: Mark range function parameters as positional only (#125945)
Konstantin Baikov [Mon, 11 Aug 2025 23:12:55 +0000 (01:12 +0200)] 
gh-125897: Mark range function parameters as positional only (#125945)

2 months agogh-137400: Fix a crash when disabling profiling across all threads (gh-137471)
Sam Gross [Mon, 11 Aug 2025 15:41:44 +0000 (11:41 -0400)] 
gh-137400: Fix a crash when disabling profiling across all threads (gh-137471)

The `PyEval_SetProfileAllThreads` function and other related functions
had a race condition on `tstate->c_profilefunc` that could lead to a
crash when disable profiling or tracing on all threads while another
thread is starting to profile or trace a a call.

There are still potential crashes when threads exit concurrently with
profiling or tracing be enabled/disabled across all threads.

2 months agogh-115766: Fix IPv4Interface.is_unspecified (GH-137326)
AN Long [Mon, 11 Aug 2025 13:04:47 +0000 (22:04 +0900)] 
gh-115766: Fix IPv4Interface.is_unspecified (GH-137326)

2 months agogh-128813: cleanup C-API docs for PyComplexObject (GH-137579)
Sergey B Kirpichev [Mon, 11 Aug 2025 11:51:39 +0000 (14:51 +0300)] 
gh-128813: cleanup C-API docs for PyComplexObject (GH-137579)

* move non-deprecated API up
* make a dedicated section for deprecated low-leved API

2 months agogh-135953: Profile a module or script with sampling profiler (#136777)
László Kiss Kollár [Mon, 11 Aug 2025 11:36:43 +0000 (08:36 -0300)] 
gh-135953: Profile a module or script with sampling profiler (#136777)

2 months agoFix documentation of hash in PyHash_FuncDef (#137595)
da-woods [Mon, 11 Aug 2025 11:18:37 +0000 (12:18 +0100)] 
Fix documentation of hash in PyHash_FuncDef (#137595)

Because of a small typo, it wasn't showing up in the generated docs.

2 months agoAdd test for opening an SQLite with bytes path (GH-136331)
Serhiy Storchaka [Mon, 11 Aug 2025 06:16:54 +0000 (09:16 +0300)] 
Add test for opening an SQLite with bytes path (GH-136331)

2 months agoUpdate pre-commit hooks (#137591)
Malcolm Smith [Sun, 10 Aug 2025 22:32:50 +0000 (23:32 +0100)] 
Update pre-commit hooks (#137591)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 months agogh-137583: Only lock the SSL context, not the SSL socket (GH-137588)
Peter Bierma [Sun, 10 Aug 2025 14:47:11 +0000 (10:47 -0400)] 
gh-137583: Only lock the SSL context, not the SSL socket (GH-137588)

Fixes a deadlock in 3.13.6.

2 months agogh-136571: Convert more code in datetime to Argument Clinic (GH-136573)
Serhiy Storchaka [Sat, 9 Aug 2025 18:25:49 +0000 (21:25 +0300)] 
gh-136571: Convert more code in datetime to Argument Clinic (GH-136573)

This adds signatures for some classes and methods.

date.fromisocalendar() can now raise OverflowError for arguments that
don't fit in the C int.

2 months agoGH-132532: Add new DSL macros to better declare semantics of exits at ends of instruc...
Mark Shannon [Sat, 9 Aug 2025 14:41:28 +0000 (15:41 +0100)] 
GH-132532: Add new DSL macros to better declare semantics of exits at ends of instructions/uops. (GH-137098)

2 months agogh-137562: Remove reference for GC_REACHABLE in comment (GH-137563)
Sergey Miryanov [Sat, 9 Aug 2025 12:32:45 +0000 (05:32 -0700)] 
gh-137562: Remove reference for GC_REACHABLE in comment (GH-137563)

GC_REACHABLE is obsolete

3 months agogh-137026: Add an explainer guide for asyncio (GH-137215)
Alexander Nordin [Sat, 9 Aug 2025 05:29:51 +0000 (22:29 -0700)] 
gh-137026: Add an explainer guide for asyncio (GH-137215)

* - Add an explainer guide (aka HOWTO, not how-to) for asyncio.

* Fix linter errors.

* - Enforce max line length of roughly 79 chars.
- Start sentences on new lines to minimize disruption of diffs.

* Add reference to subinterpreters.

* - Significantly reduce article size. Remove both example sections & "Which concurrency do I want" section.

* Align section-header lengths with section names.

* - Remove reference to deleted section.

* - Fix a variety of rote style guide items like title-alignment, use of ie and $, and so forth.
- Add links to other parts of the docs for keywords and objects like await, coro, task, future, etc.

* - One last title alignment.

* - Style nit.

* - Rework a variety of I statements.

* Lint fix.

* - Firm up commentary on yield from in corotuines.

* Update language comparing await and yield from.

* - Remove await-ing Tasks and futures section

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* - Address comments related to style & writing flow.

* per-thread event loop note.

* Add section describing coroutines roots in generators.

* Phrasing tweak.

* Use asyncio.create_task instead of asyncio.Task

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* small phrasing.

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* phrasing nit.

* style nits

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* phrasing nit

* Fix misnaming of async generator.

* phrasing nits.

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* consistent spacing

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* phrasing nits

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* add conclusion

* nits

* - Variety of style & grammar improvements thanks to ZeroIntensity's comments.

* - Make all directives start with a 3 space indent. Then 4 thereafter.

* - Use :linenos: instead of manually writing the line numbers.

* - Fix label typo for article.

* fix label link.

* Apply suggestions from code review

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* - introduce async-sleep name

* Phrasing

* nit

* ungendered octopus

* teammates

* jobs

* rework fella to penguin

* - remove byline; add seealso

* Change ref from asyncio to use seealso block.

* Remove typehints. Fix indentation in one code example.

* Slight rephrase for clarity.

* Make references point to asyncio. Wrap some long lines.

* - Variety of style/phrasing improvements based on PR feedback.

* phrasing.

* phrasing nit.

* Apply suggestions from code review

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* nit

* Apply suggestions from code review

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* fix backticks.

* nits

* nit

* add section on asyncio.run

* title change under the hood.

* modify task coro example.

* howtos article link.

* prefer await without backticks.

* phrasing tweak.

* Rework phrasing around how await tasks pauses and returns control in the await section.

* move code block to beforfe explanation in coroutine under the hood.

* phrasing.

* link to yield from.

* style nits

* nit

* - Modify language re: event-loop cycling endlessly.
- Discuss why await was designed to not yield for coros.

* - Add a note about debug=True on asyncio.run to await coro section.

* clarity nit

* - Add two other references in seealso block.

* nit

* Language simplification

* Apply suggestions from code review

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* nit

* grammar fix.

* fix

* worker bees

* rework event loop paragraph to significantly deemphasize queues

* remove all references to queue besides the initial analogy.

* add note about garbage collection of tasks

* add practical note re: garbage collection

* phrasing nits

* re arrange note on task gc.

* line wrap nit

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* link to debug mode docs.

* readd part2 prefix.

* simplify title.

* fix titles. tihnk I messed this up earlier.

* avoid idiom in title.

* fix titles once agian.

* Apply suggestions from code review

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* rework task gc example.

* phrasing tweak.

* tewak.

* nit

* nit

* nit

* nit

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
3 months agogh-92936: allow double quote in cookie values (#113663)
Nick Burns [Fri, 8 Aug 2025 19:07:15 +0000 (12:07 -0700)] 
gh-92936: allow double quote in cookie values (#113663)

* allow double quote in cookie values
* Update Lib/test/test_http_cookies.py

Co-authored-by: Senthil Kumaran <senthil@python.org>
3 months agogh-133722: Add Difflib theme to `_colorize` and 'color' option to `difflib.unified_di...
Douglas Thor [Fri, 8 Aug 2025 15:34:02 +0000 (08:34 -0700)] 
gh-133722: Add Difflib theme to `_colorize` and 'color' option to `difflib.unified_diff` (#133725)

3 months agoReplace "ordered arguments" with "positional arguments" in `unittest.mock` documentat...
Tom Forbes [Fri, 8 Aug 2025 14:00:18 +0000 (15:00 +0100)] 
Replace "ordered arguments" with "positional arguments" in `unittest.mock` documentation (GH-137552)

3 months agogh-128813: deprecate cval field of the PyComplexObject struct (#137271)
Sergey B Kirpichev [Fri, 8 Aug 2025 10:36:42 +0000 (13:36 +0300)] 
gh-128813: deprecate cval field of the PyComplexObject struct (#137271)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 months agoBump mypy to 1.17.1 (#137542)
sobolevn [Fri, 8 Aug 2025 07:14:51 +0000 (10:14 +0300)] 
Bump mypy to 1.17.1 (#137542)

3 months ago[Doc] Remove unnecessary quotes from typing module (#137207)
Adorilson Bezerra [Fri, 8 Aug 2025 02:04:59 +0000 (03:04 +0100)] 
[Doc] Remove unnecessary quotes from typing module (#137207)

* gh-106320: Remove private _PyInterpreterState functions (#106335)

Remove private _PyThreadState and _PyInterpreterState C API
functions: move them to the internal C API (pycore_pystate.h and
pycore_interp.h). Don't export most of these functions anymore, but
still export functions used by tests.

Remove _PyThreadState_Prealloc() and _PyThreadState_Init() from the C
API, but keep it in the stable API.

* Doc: minor change

* Revert "Doc: minor change"

This reverts commit ebfa0937c2caf0110ab1540f14956d56fe925092.

* [Doc] Remove unnecessary quotes from typing (See Also section)

* [Doc] Remove unnecessary quotes from typing

---------

Co-authored-by: Victor Stinner <vstinner@python.org>
3 months agoGH-136155: Fail the EPUB check on fatal errors (#137351)
Adam Turner [Fri, 8 Aug 2025 01:32:20 +0000 (03:32 +0200)] 
GH-136155: Fail the EPUB check on fatal errors (#137351)

3 months agoGH-135552: Add tests to check weakref clearing (GH-136304)
Sergey Miryanov [Fri, 8 Aug 2025 00:45:33 +0000 (17:45 -0700)] 
GH-135552: Add tests to check weakref clearing (GH-136304)

These are tests to ensure behaviour introduced by GH-136189 is working as expected.

Co-authored-by: Mikhail Borisov <43937008+fxeqxmulfx@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
3 months agogh-130102: drop "require numeric arguments" from pow() docs (#137456)
Sergey B Kirpichev [Thu, 7 Aug 2025 23:43:18 +0000 (02:43 +0300)] 
gh-130102: drop "require numeric arguments" from pow() docs (#137456)

Co-authored-by: Senthil Kumaran <senthil@python.org>
3 months agoGH-135552: Make the GC clear weakrefs later (GH-136189)
Neil Schemenauer [Thu, 7 Aug 2025 23:32:17 +0000 (16:32 -0700)] 
GH-135552: Make the GC clear weakrefs later (GH-136189)

Fix a bug caused by the garbage collector clearing weakrefs too early.  The
weakrefs in the ``tp_subclasses`` dictionary are needed in order to correctly
invalidate type caches (for example, by calling ``PyType_Modified()``).
Clearing weakrefs before calling finalizers causes the caches to not be
correctly invalidated.  That can cause crashes since the caches can refer to
invalid objects.  Defer the clearing of weakrefs without callbacks until after
finalizers are executed.

3 months agogh-137412: fix `default_builtin_hashes` values in `test_hashlib.py` (#137413)
Bénédikt Tran [Thu, 7 Aug 2025 22:31:56 +0000 (00:31 +0200)] 
gh-137412: fix `default_builtin_hashes` values in `test_hashlib.py` (#137413)

fix `default_builtin_hashes` in test_hashlib

3 months agogh-137291: Support perf profiler with an evaluation hook (#137292)
Dino Viehland [Thu, 7 Aug 2025 21:54:12 +0000 (14:54 -0700)] 
gh-137291: Support perf profiler with an evaluation hook (#137292)

Support perf profiler with an evaluation hook

3 months agoGH-119085: Move comment in Python/gc.c to correct place.
Abhinav Upadhyay [Thu, 7 Aug 2025 20:31:11 +0000 (02:01 +0530)] 
GH-119085: Move comment in Python/gc.c to correct place.

In GH-116206, the comment about moving reachable objects to next generation
got moved from its original place to a place where there is no code below
it. Put the comment back to where the actual movement of reachable objects
happens.

3 months agogh-137526: Fix broken link to drdobbs journal in difflib.rst (#137527)
Sebastien Williams-Wynn [Thu, 7 Aug 2025 19:36:05 +0000 (20:36 +0100)] 
gh-137526: Fix broken link to drdobbs journal in difflib.rst (#137527)

3 months agoadd floss.fund manifest provenance (#137529)
Ee Durbin [Thu, 7 Aug 2025 19:35:39 +0000 (15:35 -0400)] 
add floss.fund manifest provenance (#137529)

ref: https://fundingjson.org/#wellknown

3 months agoRemove redundant assignment in asyncio.streams.StreamReaderProtocol.connection_lost...
maurycy [Thu, 7 Aug 2025 15:38:14 +0000 (17:38 +0200)] 
Remove redundant assignment in asyncio.streams.StreamReaderProtocol.connection_lost() (GH-137524)

The _stream_writer attribute was removed in a355f60 (gh-114914).

3 months agogh-137514: Add a free-threading wrapper for mutexes (GH-137515)
Peter Bierma [Thu, 7 Aug 2025 15:24:50 +0000 (11:24 -0400)] 
gh-137514: Add a free-threading wrapper for mutexes (GH-137515)

Add `FT_MUTEX_LOCK`/`FT_MUTEX_UNLOCK`, which call `PyMutex_Lock` and `PyMutex_Unlock` on the free-threaded build, and no-op otherwise.