]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 months ago[3.12] gh-131015: Add test for bytes formatting errors (#131881) (#132114)
Bénédikt Tran [Sat, 5 Apr 2025 09:40:48 +0000 (11:40 +0200)] 
[3.12] gh-131015: Add test for bytes formatting errors (#131881) (#132114)

* gh-131015: Add test for bytes formatting errors (#131881)

Co-authored-by: Ageev Maxim <maksim170901@gmail.com>
(cherry picked from commit 05557788f3c284ede73e6f94810ec796bb9d3721)

7 months ago[3.12] Docs: document `plistlib.InvalidFileException` (GH-132069) (#132117)
Miss Islington (bot) [Sat, 5 Apr 2025 08:53:06 +0000 (10:53 +0200)] 
[3.12] Docs: document `plistlib.InvalidFileException` (GH-132069) (#132117)

Docs: document `plistlib.InvalidFileException` (GH-132069)
(cherry picked from commit 99e9798d612222785db427eb295c847147fe5e78)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
7 months ago[3.12] Fix typo in `template_replace()` test helper docstring (GH-132094) (#132096)
Miss Islington (bot) [Fri, 4 Apr 2025 18:04:01 +0000 (20:04 +0200)] 
[3.12] Fix typo in `template_replace()` test helper docstring (GH-132094) (#132096)

Fix typo in `template_replace()` test helper docstring (GH-132094)
(cherry picked from commit ac3a7bfeccb752a59d88861e45b454db360aa69d)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
7 months ago[3.12] gh-128632: fix segfault on nested __classdict__ type param (GH… (#132090)
Tomasz Pytel [Fri, 4 Apr 2025 15:48:57 +0000 (11:48 -0400)] 
[3.12] gh-128632: fix segfault on nested __classdict__ type param (GH… (#132090)

(cherry picked from commit 891c61c1fa480928dd60cce8bbc8764630c95025)

Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
7 months ago[3.12] gh-130655: Add a test for corrupt `.mo` files in `gettext` (GH-131911) (#132080)
Miss Islington (bot) [Fri, 4 Apr 2025 14:49:48 +0000 (16:49 +0200)] 
[3.12] gh-130655: Add a test for corrupt `.mo` files in `gettext` (GH-131911) (#132080)

gh-130655: Add a test for corrupt `.mo` files in `gettext` (GH-131911)
(cherry picked from commit a126cefc176a7ddbd1a09ce560195f6fd81a5c92)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
7 months ago[3.12] gh-130655: Add a test for bad magic numbers in `.mo` files parsed by `gettext...
Miss Islington (bot) [Fri, 4 Apr 2025 14:49:36 +0000 (16:49 +0200)] 
[3.12] gh-130655: Add a test for bad magic numbers in `.mo` files parsed by `gettext` (GH-131909) (#132078)

gh-130655: Add a test for bad magic numbers in `.mo` files parsed by `gettext` (GH-131909)
(cherry picked from commit 16a6270aa61c86c430a308c0f766a69a88c9a3a5)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
7 months ago[3.12] gh-130655: Add tests for `gettext.find()` (GH-130691) (#132083)
Miss Islington (bot) [Fri, 4 Apr 2025 14:39:22 +0000 (16:39 +0200)] 
[3.12] gh-130655: Add tests for `gettext.find()` (GH-130691) (#132083)

gh-130655: Add tests for `gettext.find()` (GH-130691)

(cherry picked from commit 3118693a1a3db0da96c565a2de015a806c892625)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
7 months ago[3.12] gh-132075: Fix possible use of sockaddr structures with uninitialized members...
Miss Islington (bot) [Fri, 4 Apr 2025 14:29:12 +0000 (16:29 +0200)] 
[3.12] gh-132075: Fix possible use of sockaddr structures with uninitialized members (GH-132076) (GH-132087)

Now all structure members are initialized with zeroes by default.
(cherry picked from commit 345baa77ba2ce3b8ea8f2fad84754e5cc0b10938)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 months agogh-131423: Update OpenSSL build tag to 3.0.16.2 to fix ARM64 crash (GH-132051)
Steve Dower [Thu, 3 Apr 2025 18:04:29 +0000 (19:04 +0100)] 
gh-131423: Update OpenSSL build tag to 3.0.16.2 to fix ARM64 crash (GH-132051)

Backported from 24decb05ddda445d96f45e2cd0b39497318c98d4

7 months ago[3.12] gh-130197: pygettext: Test the --escape option (GH-131902) (GH-132033)
Tomas R. [Wed, 2 Apr 2025 20:29:02 +0000 (22:29 +0200)] 
[3.12] gh-130197: pygettext: Test the --escape option (GH-131902) (GH-132033)

(cherry picked from commit 87d9983994e9a423e9e0050b1bbee52ebaf84367)

7 months ago[3.12] gh-89039: Call subclass constructors in datetime.*.replace (GH-114780) (GH...
Serhiy Storchaka [Wed, 2 Apr 2025 17:35:16 +0000 (20:35 +0300)] 
[3.12] gh-89039: Call subclass constructors in datetime.*.replace (GH-114780) (GH-131239)

When replace() method is called on a subclass of datetime, date or time,
properly call derived constructor. Previously, only the base class's
constructor was called.

Also, make sure to pass non-zero fold values when creating subclasses in
various methods. Previously, fold was silently ignored.
(cherry picked from commit 46190d9ea8a878a03d95b4e1bdcdc9ed576cf3fa)

Co-authored-by: Eugene Toder <eltoder@users.noreply.github.com>
7 months ago[3.12] gh-131888: fix ResourceWarning in test_ftplib (GH-131889) (#132010)
Miss Islington (bot) [Wed, 2 Apr 2025 12:46:40 +0000 (14:46 +0200)] 
[3.12] gh-131888: fix ResourceWarning in test_ftplib (GH-131889) (#132010)

gh-131888: fix ResourceWarning in test_ftplib (GH-131889)
(cherry picked from commit b0f77c4d250789fd1deaab4912919e2e6b89e583)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
7 months ago[3.12] gh-132002: Fix crash of `ContextVar` on unhashable `str` subtype (GH-132003...
Miss Islington (bot) [Wed, 2 Apr 2025 12:05:30 +0000 (14:05 +0200)] 
[3.12] gh-132002: Fix crash of `ContextVar` on unhashable `str` subtype (GH-132003) (#132008)

gh-132002: Fix crash of `ContextVar` on unhashable `str` subtype (GH-132003)
(cherry picked from commit ab2a3dda1d3b6668162a847bf5b6aca2855a3416)

Co-authored-by: sobolevn <mail@sobolevn.me>
7 months ago[3.12] gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668) (GH-131977...
Miss Islington (bot) [Tue, 1 Apr 2025 14:56:56 +0000 (16:56 +0200)] 
[3.12] gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668) (GH-131977) (#131979)

[3.13] gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668) (GH-131977)

gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668)

Don't pass direct references to sockaddr members since their type may
not match PyArg_ParseTuple() types. Instead, use temporary 'int' and
'unsigned char' variables, and update sockaddr members afterwards.

On FreeBSD, treat BTPROTO_HCI node name as a bytes string,
not as an integer.
(cherry picked from commit c318a03b17c3e58e9c46beb84ab7070b7baa303b)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 8cd29c2b533e5a1a262238695d05f2a7c44d6455)

Co-authored-by: Victor Stinner <vstinner@python.org>
7 months ago[3.12] gh-131736: only apply `security_level` workaround in `test_ssl` for security...
Miss Islington (bot) [Tue, 1 Apr 2025 08:16:34 +0000 (10:16 +0200)] 
[3.12] gh-131736: only apply `security_level` workaround in `test_ssl` for security levels greater than 1 (GH-131739) (#131966)

gh-131736: only apply `security_level` workaround in `test_ssl` for security levels greater than 1 (GH-131739)
(cherry picked from commit 3b3720f1a26ab34377542b48eb6a6565f78ff892)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
7 months ago[3.12] Minor improvements to the programming FAQ (GH-127261) (#131965)
Miss Islington (bot) [Tue, 1 Apr 2025 07:26:36 +0000 (09:26 +0200)] 
[3.12] Minor improvements to the programming FAQ (GH-127261) (#131965)

Minor improvements to the programming FAQ (GH-127261)
(cherry picked from commit 23a658b9af410b72beeb28ba4ace2d83896c5631)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months ago[3.12] gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH...
Miss Islington (bot) [Tue, 1 Apr 2025 07:23:33 +0000 (09:23 +0200)] 
[3.12] gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH-125958) (#131963)

gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH-125958)
(cherry picked from commit 0a3eb8855ccea52c618db1cf09840c6368a3745f)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-129917: Update installers to use SQLite 3.49.1 (#131025) (#131958)
Erlend E. Aasland [Mon, 31 Mar 2025 21:39:06 +0000 (23:39 +0200)] 
[3.12] gh-129917: Update installers to use SQLite 3.49.1 (#131025) (#131958)

(cherry picked from commit 45a3ab5a81769eadd94da3e26eb9bb2f3ae80fb1)

Co-authored-by: Ned Deily <nad@python.org>
7 months ago[3.12] gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH...
Miss Islington (bot) [Mon, 31 Mar 2025 18:29:04 +0000 (20:29 +0200)] 
[3.12] gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH-131866) (#131951)

gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH-131866)

When using --with-dtrace the resulting object file could be missing
specific CFLAGS exported by the build system due to the systemtap
script using specific defaults.

Exporting the CC and CFLAGS variables before the dtrace invocation
allows us to properly apply CFLAGS exported by the build system
even when cross-compiling.

The fix does not affect the dtrace invocation on Solaris/macOS.
(cherry picked from commit 0cd4befb02df07c0b320cd6246227c13e57b2efb)

Co-authored-by: stratakis <cstratak@redhat.com>
7 months ago[3.12] gh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` when concurrent...
Miss Islington (bot) [Mon, 31 Mar 2025 12:50:13 +0000 (14:50 +0200)] 
[3.12] gh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` when concurrent mutations happen (GH-126124) (#131930)

gh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` when concurrent mutations happen (GH-126124)
(cherry picked from commit bab1398a47f6d0cfc1be70497f306874c749ef7c)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-126037: fix UAF in `xml.etree.ElementTree.Element.find*` when concurrent...
Bénédikt Tran [Mon, 31 Mar 2025 12:47:22 +0000 (14:47 +0200)] 
[3.12] gh-126037: fix UAF in `xml.etree.ElementTree.Element.find*` when concurrent mutations happen (#127964) (#131932)

gh-126037: fix UAF in `xml.etree.ElementTree.Element.find*` when concurrent mutations happen (#127964)

We fix a use-after-free in the `find`, `findtext` and `findall` methods of `xml.etree.ElementTree.Element`
objects that can be triggered when the tag to find implements an `__eq__` method that mutates the
element being queried.

(cherry picked from commit c57623c221d46daeaedfbf2b32d041fde0c882de)

7 months ago[3.12] gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword...
Miss Islington (bot) [Sun, 30 Mar 2025 09:29:49 +0000 (11:29 +0200)] 
[3.12] gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (GH-128208) (#131894)

gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (GH-128208)
(cherry picked from commit edfbd8c062285e83dc5f596288df2a762e68bcdc)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
7 months ago[3.12] gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server...
Miss Islington (bot) [Sun, 30 Mar 2025 08:28:26 +0000 (10:28 +0200)] 
[3.12] gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (GH-129996) (#131891)

gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (GH-129996)
(cherry picked from commit 044a1e13d5cfc91b0a8774e936877e91cbac3a16)

Co-authored-by: Alexander Ershov <150328014+AEErshov@users.noreply.github.com>
7 months ago[3.12] gh-131050: skip `test_dh_params` when TLS library lacks FFDHE ciphersuites...
Miss Islington (bot) [Sat, 29 Mar 2025 10:51:11 +0000 (11:51 +0100)] 
[3.12] gh-131050: skip `test_dh_params` when TLS library lacks FFDHE ciphersuites (GH-131051) (#131875)

gh-131050: skip `test_dh_params` when TLS library lacks FFDHE ciphersuites (GH-131051)
(cherry picked from commit be2d2181e62cd138b0cdf80ebc0dd4058187c52a)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-127541: Update os.walk example (GH-127765) (#131873)
Miss Islington (bot) [Sat, 29 Mar 2025 10:34:35 +0000 (11:34 +0100)] 
[3.12] gh-127541: Update os.walk example (GH-127765) (#131873)

gh-127541: Update os.walk example (GH-127765)

Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs.
(cherry picked from commit a5949986d631391d37b1b329ad8badcf2000f9a9)

Co-authored-by: Totosuki <116938397+totosuki@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131423: Update to OpenSSL 3.0.16. (GH-131839)
Steve Dower [Fri, 28 Mar 2025 15:29:20 +0000 (15:29 +0000)] 
gh-131423: Update to OpenSSL 3.0.16. (GH-131839)

The bin tag is 3.0.16.1 because we rebuilt without uplink support to fix gh-131804.
This PR also prevents making calls that are now unsafe without uplink, and updates
the tests to property interpret these failures as unsupported.

7 months ago[3.12] gh-131807: fix ResourceWarning in test_ucn.py (GH-131808) (#131846)
Miss Islington (bot) [Fri, 28 Mar 2025 15:12:59 +0000 (16:12 +0100)] 
[3.12] gh-131807: fix ResourceWarning in test_ucn.py (GH-131808) (#131846)

gh-131807: fix ResourceWarning in test_ucn.py (GH-131808)
(cherry picked from commit adb67ed7e465410829ac0b1f903ec5678e0e51cc)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
7 months ago[3.12] gh-127949: fix resource warnings in `test_tasks.py` (GH-128172) (#131806)
Miss Islington (bot) [Fri, 28 Mar 2025 14:25:39 +0000 (15:25 +0100)] 
[3.12] gh-127949: fix resource warnings in `test_tasks.py` (GH-128172) (#131806)

* gh-127949: fix resource warnings in `test_tasks.py` (GH-128172)
(cherry picked from commit b66a4ad9fc32b63da2ba10db24cbc8f4e29f781a)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
7 months ago[3.12] gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (#131828)
Donghee Na [Fri, 28 Mar 2025 13:55:58 +0000 (22:55 +0900)] 
[3.12] gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (#131828)

7 months ago[3.12] gh-128446: Run Windows CI tests on each commit (GH-131702) (#131706)
Miss Islington (bot) [Fri, 28 Mar 2025 11:08:47 +0000 (12:08 +0100)] 
[3.12] gh-128446: Run Windows CI tests on each commit (GH-131702) (#131706)

gh-128446: Run Windows CI tests on each commit (GH-131702)
(cherry picked from commit 7d9442f0d55a7169940b9371d6e58a7c2ec1fa8a)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months ago[3.12] gh-131818: Add imply `-P` in `-I`'s help message (GH-131819) (#131823)
Miss Islington (bot) [Fri, 28 Mar 2025 08:09:03 +0000 (09:09 +0100)] 
[3.12] gh-131818: Add imply `-P` in `-I`'s help message (GH-131819) (#131823)

gh-131818: Add imply `-P` in `-I`'s help message (GH-131819)
(cherry picked from commit 8bd88e2827b2a887c2ea8e5ed0c0575704bfacdf)

Co-authored-by: Hang <bebound@gmail.com>
7 months ago[3.12] Fix typo in importlib.metadata.rst (gh-131596) (#131631)
Miss Islington (bot) [Thu, 27 Mar 2025 13:43:03 +0000 (14:43 +0100)] 
[3.12] Fix typo in importlib.metadata.rst (gh-131596) (#131631)

Fix typo in importlib.metadata.rst (gh-131596)
(cherry picked from commit 5fc889ffbfd271c651f563ab0afe2d345bacbca5)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
7 months ago[3.12] gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a...
Miss Islington (bot) [Wed, 26 Mar 2025 19:01:36 +0000 (20:01 +0100)] 
[3.12] gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (GH-131764) (#131775)

gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (GH-131764)
(cherry picked from commit 2c686a9ac243800b630d4a09622c8eb789f5b354)

Co-authored-by: rialbat <47256826+rialbat@users.noreply.github.com>
7 months ago[3.12] gh-131649: fix test_string_literals SyntaxWarning (GH-131650) (GH-131766)...
Miss Islington (bot) [Wed, 26 Mar 2025 16:47:55 +0000 (17:47 +0100)] 
[3.12] gh-131649: fix test_string_literals SyntaxWarning (GH-131650) (GH-131766) (#131772)

[3.13] gh-131649: fix test_string_literals SyntaxWarning (GH-131650) (GH-131766)

(cherry picked from commit 2d83891dfd51f595de68b0336b3bfc876f7b2507)
(cherry picked from commit 5bcb476df1127bffcad8f37141d8140221a7b43b)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
7 months ago[3.12] gh-131741: Add documentation for Windows version detection change in `platform...
Miss Islington (bot) [Wed, 26 Mar 2025 15:00:08 +0000 (16:00 +0100)] 
[3.12] gh-131741: Add documentation for Windows version detection change in `platform` (GH-131742) (#131768)

gh-131741: Add documentation for Windows version detection change in `platform` (GH-131742)

Document the behavior change between 3.11 & 3.12, where ``platform`` now correctly detects Windows 11 and Windows Server releases past Windows Server 2012.
(cherry picked from commit b9ca438daab6a4e2513ab38171e94c75da03d6e3)

Co-authored-by: Idan Noiman <idann@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wulian <1055917385@qq.com>
7 months ago[3.12] gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679) (gh-131693)
Miss Islington (bot) [Mon, 24 Mar 2025 20:59:03 +0000 (21:59 +0100)] 
[3.12] gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679) (gh-131693)

The call to `with self.subTest(...)` was not thread-safe.
(cherry picked from commit a1232459860235f4fb7896cc95966d87a51cbe32)

Co-authored-by: Sam Gross <colesbury@gmail.com>
7 months ago[3.12] gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH...
Miss Islington (bot) [Mon, 24 Mar 2025 19:18:29 +0000 (20:18 +0100)] 
[3.12] gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH-131682) (#131687)

gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH-131682)
(cherry picked from commit 929afd1d6ee4fb89ac818037effe6577947103de)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) (GH-131459)
Miss Islington (bot) [Mon, 24 Mar 2025 12:59:40 +0000 (13:59 +0100)] 
[3.12] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) (GH-131459)

The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.
(cherry picked from commit a0478c9f0c6d6a75ca35a8dc2c74d3b58877f094)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
7 months ago[3.12] gh-131045: [Enum] fix flag containment checks when using values (GH-131053...
Bénédikt Tran [Mon, 24 Mar 2025 09:31:24 +0000 (10:31 +0100)] 
[3.12] gh-131045: [Enum] fix flag containment checks when using values (GH-131053) (#131232)

* gh-131045: [Enum] fix flag containment checks when using values (GH-131053)

Check would fail if value would create a pseudo-member, but that member
had not yet been created.  We now attempt to create a pseudo-member for
a passed-in value first.

---------

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
7 months ago[3.12] gh-131357: Add a set of asserts to test.test_capi.test_bytearray (GH-131554...
Nybblista [Sun, 23 Mar 2025 17:43:12 +0000 (20:43 +0300)] 
[3.12] gh-131357: Add a set of asserts to test.test_capi.test_bytearray (GH-131554) (#131629)

[3.12] gh-131357: Add a set of asserts to test.test_capi.test_bytearray (#131554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.

(cherry picked from commit f3bf304c2799c31c045033f22db7eb8766a5f939)

7 months ago[3.12] gh-130283: update deprecated links and examples in `urllib.request` docs ...
Miss Islington (bot) [Sun, 23 Mar 2025 13:36:32 +0000 (14:36 +0100)] 
[3.12] gh-130283: update deprecated links and examples in `urllib.request` docs (GH-130284) (#131627)

gh-130283: update deprecated links and examples in `urllib.request` docs (GH-130284)
(cherry picked from commit fd459b115330b089da26a0555f45afced597942a)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-121529: Document `from_` parameter in `_mboxMMDF` public methods (GH-121530...
Miss Islington (bot) [Sun, 23 Mar 2025 12:18:32 +0000 (13:18 +0100)] 
[3.12] gh-121529: Document `from_` parameter in `_mboxMMDF` public methods (GH-121530) (#131622)

gh-121529: Document `from_` parameter in `_mboxMMDF` public methods (GH-121530)
(cherry picked from commit 557d2d20d484a7b22da39cdb876f6312ab66d561)

Co-authored-by: Sebb <sebbASF@users.noreply.github.com>
7 months ago[3.12] gh-131418: remove unused legacy typedefs in `{md5,sha1}module.c` (GH-131420...
Miss Islington (bot) [Sun, 23 Mar 2025 11:39:46 +0000 (12:39 +0100)] 
[3.12] gh-131418: remove unused legacy typedefs in `{md5,sha1}module.c` (GH-131420) (#131619)

gh-131418: remove unused legacy typedefs in `{md5,sha1}module.c` (GH-131420)

- Remove legacy typedefs `MD5_INT32` and `MD5_INT64` in `Modules/md5module.c`
- Remove legacy typedefs `SHA1_INT32` and `SHA1_INT64` in `Modules/sha1module.c`.

Those legacy typedefs were used to detect whether the host platform could
correctly implement MD5 and SHA-1, but this is no longer needed as we now
fallback to HACL* implementations.
(cherry picked from commit a9a399f0ecfeeff91425cc089057f1b95799853b)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-131457: Fix typo in BNF description of function signatures (GH-131460)...
Miss Islington (bot) [Sat, 22 Mar 2025 08:01:47 +0000 (09:01 +0100)] 
[3.12] gh-131457: Fix typo in BNF description of function signatures (GH-131460) (#131576)

gh-131457: Fix typo in BNF description of function signatures (GH-131460)
(cherry picked from commit 8b7d20d3a9dc53344e3803507deafc26b5c09ca8)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com>
7 months ago[3.12] gh-131492, gh-131461: handle exceptions in GzipFile constructor while owning...
Miss Islington (bot) [Fri, 21 Mar 2025 10:21:40 +0000 (11:21 +0100)] 
[3.12] gh-131492, gh-131461: handle exceptions in GzipFile constructor while owning resources (GH-131462) (#131519)

(cherry picked from commit ce79274e9f093bd06d2285c9af48dbcbc92173de)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
7 months ago[3.12] gh-88887: Cleanup `multiprocessing.resource_tracker.ResourceTracker` upon...
luccabb [Fri, 21 Mar 2025 10:15:35 +0000 (03:15 -0700)] 
[3.12] gh-88887: Cleanup `multiprocessing.resource_tracker.ResourceTracker` upon deletion (GH-130429) (#131530)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
(cherry picked from commit f53e7de6a84a0f535efb75c3671283b801a1af0f)

7 months ago[3.12] gh-131441: Add a set of asserts to test.test_capi.test_list (#131442) (#131533)
Nybblista [Fri, 21 Mar 2025 07:56:21 +0000 (10:56 +0300)] 
[3.12] gh-131441: Add a set of asserts to test.test_capi.test_list (#131442) (#131533)

gh-131441: Add a set of asserts to test.test_capi.test_list (#131442)

(cherry picked from commit 2433cc79d79d9c1db8e53d4b9bde26e9a47fb0b9)

7 months ago[3.12] gh-70647: update docs to mention the datetime 1900 year default 2/29 issue...
Gregory P. Smith [Fri, 21 Mar 2025 04:50:10 +0000 (21:50 -0700)] 
[3.12] gh-70647: update docs to mention the datetime 1900 year default 2/29 issue (#131534)

* gh-70647: Better promote how to safely parse yearless dates in datetime.

Every four years people encounter this because it just isn't obvious.
This moves the footnote up to a note with a code example.

We'd love to change the default year value for datetime but doing
that could have other consequences for existing code.  This documented
workaround *always* works.

* doctest code within note is bad, dedent.

7 months ago[3.12] GH-121970: Extract `pydoc_topics` into a new extension (GH-131256) (#131512)
Adam Turner [Thu, 20 Mar 2025 15:40:37 +0000 (15:40 +0000)] 
[3.12] GH-121970: Extract `pydoc_topics` into a new extension (GH-131256) (#131512)

(cherry picked from commit c1a02f9101f0b2d9dc7cfb4b8be5193e7459a906)

7 months ago[3.12] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) (GH-131459)
Miss Islington (bot) [Thu, 20 Mar 2025 12:41:22 +0000 (13:41 +0100)] 
[3.12] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) (GH-131459)

The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.
(cherry picked from commit a0478c9f0c6d6a75ca35a8dc2c74d3b58877f094)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
7 months ago[3.12] gh-131417: Mention asyncio Future and Task in docs for generic classes list...
Miss Islington (bot) [Wed, 19 Mar 2025 09:24:16 +0000 (10:24 +0100)] 
[3.12] gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422) (#131446)

gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422)

Mention asyncio Future and Task in docs for generic classes list
(cherry picked from commit 61b4b2c57c9327273f2e306bafa23cf2c70eac8e)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
7 months ago[3.12] Docs: fix shell command formatting (GH-131310) (#131444)
Miss Islington (bot) [Wed, 19 Mar 2025 07:52:17 +0000 (08:52 +0100)] 
[3.12] Docs: fix shell command formatting (GH-131310) (#131444)

Docs: fix shell command formatting (GH-131310)

replace "zypper in" with "zypper install" to avoid incorrect highlighting
(cherry picked from commit 267c06d6a8290aa299098b4fcd3f270001b01e72)

Co-authored-by: partev <petrosyan@gmail.com>
7 months ago[3.12] gh-121284: Fix email address header folding with parsed encoded-word (GH-12275...
Miss Islington (bot) [Tue, 18 Mar 2025 19:35:32 +0000 (20:35 +0100)] 
[3.12] gh-121284: Fix email address header folding with parsed encoded-word (GH-122754) (#131404)

gh-121284: Fix email address header folding with parsed encoded-word (GH-122754)

Email generators using email.policy.default may convert an RFC 2047
encoded-word to unencoded form during header refolding. In a structured
header, this could allow 'specials' chars outside a quoted-string,
leading to invalid address headers and enabling spoofing. This change
ensures a parsed encoded-word that contains specials is kept as an
encoded-word while the header is refolded.

[Better fix from @bitdancer.]

---------
(cherry picked from commit 295b53df2aa18deb625a7da41f7e4babfe6ef34b)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: R David Murray <rdmurray@bitdance.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
7 months ago[3.12] gh-131277: allow EnvironmentVarGuard to unset more than one environment variab...
Bénédikt Tran [Tue, 18 Mar 2025 12:46:24 +0000 (13:46 +0100)] 
[3.12] gh-131277: allow EnvironmentVarGuard to unset more than one environment variable at once (GH-131280) (#131410)

(cherry picked from commit 3185e3115c918ec189e16cf9f5b51a13a0146556)

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months ago[3.12] gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) (GH-131361)
Miss Islington (bot) [Tue, 18 Mar 2025 12:18:10 +0000 (13:18 +0100)] 
[3.12] gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) (GH-131361)

[3.13] gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176)

(cherry picked from commit bb0268f60dfe903a9bdb8d84104247a9318c6b18)
(cherry picked from commit 6af54d298d5135302037cdda7a1f5535e48cb1b6)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
7 months ago[3.12] gh-116666: Add "token" glossary term (GH-130888) (GH-131368)
Miss Islington (bot) [Tue, 18 Mar 2025 11:51:09 +0000 (12:51 +0100)] 
[3.12] gh-116666: Add "token" glossary term (GH-130888) (GH-131368)

gh-116666: Add "token" glossary term (GH-130888)

Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)
(cherry picked from commit 30d52058493e07fd1d3efea960482f4001bd2f86)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months ago[3.12] gh-131002: clarify how to enforce sqlite3 column types for generated fields...
Miss Islington (bot) [Tue, 18 Mar 2025 11:10:01 +0000 (12:10 +0100)] 
[3.12] gh-131002: clarify how to enforce sqlite3 column types for generated fields (GH-131006) (#131386)

(cherry picked from commit f48887fb97651c02c5e412a75ed8b51a4ca11e6a)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
7 months ago[3.12] gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280...
Miss Islington (bot) [Tue, 18 Mar 2025 09:34:45 +0000 (10:34 +0100)] 
[3.12] gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280) (#131395)

gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280)
(cherry picked from commit 77d2fd441320ca365c34e21c475d3878f3d5d833)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-131094: Refine `math.isclose` docs (GH-131139) (#131393)
Miss Islington (bot) [Tue, 18 Mar 2025 09:20:52 +0000 (10:20 +0100)] 
[3.12] gh-131094: Refine `math.isclose` docs (GH-131139) (#131393)

gh-131094: Refine `math.isclose` docs (GH-131139)
(cherry picked from commit 3f50f96586d46497e4d9de065c4424fe2d72508e)

Co-authored-by: Guy Jacoby <49398101+guyjacoby@users.noreply.github.com>
7 months ago[3.12] gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)...
Bénédikt Tran [Tue, 18 Mar 2025 09:16:26 +0000 (10:16 +0100)] 
[3.12] gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145) (#131348)

gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)

Refactor `_setException()` into different helpers that can be used separately:

- set_ssl_exception_from_errcode(): set an exception from an explicit SSL error code.
- raise_ssl_error(): set an exception from the last SSL error code or use a user-defined message.
- notify_ssl_error_occurred(): same as raise_ssl_error() but with a generic default message.

(cherry-picked from commit ac50ece6cea8745834e4ec0a9617809a51245bfc).

7 months ago[3.12] gh-131325: fix sendfile fallback implementation to drain data after writing...
Miss Islington (bot) [Mon, 17 Mar 2025 19:40:43 +0000 (20:40 +0100)] 
[3.12] gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376) (#131378)

gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376)
(cherry picked from commit 94f4d87aeb4d2d7bddcb4c3aad4f62a727ac91ee)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
7 months ago[3.12] gh-130727: Retry test_wmi on TimeoutError (GH-130832) (#130840)
Miss Islington (bot) [Mon, 17 Mar 2025 15:57:28 +0000 (16:57 +0100)] 
[3.12] gh-130727: Retry test_wmi on TimeoutError (GH-130832) (#130840)

gh-130727: Retry test_wmi on TimeoutError (GH-130832)

Use sleeping_retry() in test_wmi to retry multiple times on
TimeoutError. Wait up to LONG_TIMEOUT seconds (5 minutes by default).
(cherry picked from commit f67ff9e82071b21c1960401aed4844b00b5bfb53)

Co-authored-by: Victor Stinner <vstinner@python.org>
7 months ago[3.12] gh-129675: Update documentation for tp_basicsize & tp_itemsize (GH-129850...
Miss Islington (bot) [Mon, 17 Mar 2025 15:18:14 +0000 (16:18 +0100)] 
[3.12] gh-129675: Update documentation for tp_basicsize & tp_itemsize (GH-129850) (GH-131078)

- Add alignment requirement
- Mention that ob_size is unreliable if you don't control it
- Add some links for context
- basicsize should include the base type in generaly not just PyObject
- suggest Py_SIZE & Py_SET_SIZE

This adds a “by-the-way” link to `PyObject_New`, which shouldn't be
used for GC types. In order to be comfortable linking to it, I also
add a link to `PyObject_GC_New` from its docs. And the same for
`*Var` variants, while I'm here.

(cherry picked from commit ad0f618ab3eb1f26f8830a863aaf7bb70835c00d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
7 months ago[3.12] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#130549)
Hugo van Kemenade [Mon, 17 Mar 2025 12:59:12 +0000 (14:59 +0200)] 
[3.12] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#130549)

(cherry picked from commit 425587a110eb214a097c634d4b6d944ac478923e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
7 months ago[3.12] gh-109961: Docs: Fix incorrect rendering of `__replace__` in `copy.rst` (GH...
Hugo van Kemenade [Mon, 17 Mar 2025 12:58:14 +0000 (14:58 +0200)] 
[3.12] gh-109961: Docs: Fix incorrect rendering of `__replace__` in `copy.rst` (GH-109968) (#130909)

(cherry picked from commit 0baf72696e79191241a2d5cfdfd7e6135115f7b2)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
7 months ago[3.12] gh-131339: test PyBytes_Size for a zero-size bytes object (GH-131340) (#131344)
Miss Islington (bot) [Mon, 17 Mar 2025 12:20:32 +0000 (13:20 +0100)] 
[3.12] gh-131339: test PyBytes_Size for a zero-size bytes object (GH-131340) (#131344)

gh-131339: test PyBytes_Size for a zero-size bytes object (GH-131340)
(cherry picked from commit 3ae67ba97e88d6f066a5b6f0c809f57fe4a1ecbe)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
7 months ago[3.12] gh-129843: fix pure Python implementation of `warnings.warn_explicit` (GH...
Miss Islington (bot) [Mon, 17 Mar 2025 11:19:09 +0000 (12:19 +0100)] 
[3.12] gh-129843: fix pure Python implementation of `warnings.warn_explicit` (GH-129848) (#131350)

gh-129843: fix pure Python implementation of `warnings.warn_explicit` (GH-129848)

The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage`
with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`).
(cherry picked from commit 80e00ecc399db8aeaa9f3a1c87a2cfb34517d7be)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com>
7 months ago[3.12] gh-130160: use `.. program::` directive for documenting `http.server` CLI...
donBarbos [Mon, 17 Mar 2025 08:28:11 +0000 (12:28 +0400)] 
[3.12] gh-130160: use `.. program::` directive for documenting `http.server` CLI (GH-131010) (#131294)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months ago[3.12] gh-131327: Document winsound.SND_APPLICATION (GH-131328) (#131329)
Miss Islington (bot) [Sun, 16 Mar 2025 15:45:57 +0000 (16:45 +0100)] 
[3.12] gh-131327: Document winsound.SND_APPLICATION (GH-131328) (#131329)

gh-131327: Document winsound.SND_APPLICATION (GH-131328)
(cherry picked from commit bf4c1bf344ed1f80c4e8f4fd5b1a8f0e0858777e)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-130160: use `.. program::` directive for documenting `doctest` CLI (GH...
Miss Islington (bot) [Sun, 16 Mar 2025 12:00:39 +0000 (13:00 +0100)] 
[3.12] gh-130160: use `.. program::` directive for documenting `doctest` CLI (GH-131034) (#131321)

gh-130160: use `.. program::` directive for documenting `doctest` CLI (GH-131034)
(cherry picked from commit 9558d22ac308c102e4f843541eead2022050225e)

Co-authored-by: donBarbos <donbarbos@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-131204: Fix `difflib.HtmlDiff` may not use monospaced font (GH-131221)...
Wulian233 [Fri, 14 Mar 2025 12:23:39 +0000 (20:23 +0800)] 
[3.12] gh-131204: Fix `difflib.HtmlDiff` may not use monospaced font (GH-131221) (#131243)

(cherry picked from commit 7fd6160)

7 months ago[3.12] gh-131234: Improve `test_popen` with more asserts (GH-131235) (#131241)
Miss Islington (bot) [Fri, 14 Mar 2025 11:54:56 +0000 (12:54 +0100)] 
[3.12] gh-131234: Improve `test_popen` with more asserts (GH-131235) (#131241)

gh-131234: Improve `test_popen` with more asserts (GH-131235)
(cherry picked from commit fc07f863ee2a942dd96e1ca9edf049603fbb574e)

Co-authored-by: sobolevn <mail@sobolevn.me>
7 months ago[3.12] gh-131219: Improve tests in `test_lzma.py` by adding more asserts (GH-131220...
sobolevn [Fri, 14 Mar 2025 11:54:37 +0000 (14:54 +0300)] 
[3.12] gh-131219: Improve tests in `test_lzma.py` by adding more asserts (GH-131220) (#131237)

Co-authored-by: sobolevn <mail@sobolevn.me>
7 months ago[3.12] gh-130814: Enhance documentation for Python C API type objects (GH-130817...
Miss Islington (bot) [Fri, 14 Mar 2025 10:01:05 +0000 (11:01 +0100)] 
[3.12] gh-130814: Enhance documentation for Python C API type objects (GH-130817) (#131224)

gh-130814: Enhance documentation for Python C API type objects (GH-130817)

The "Type Objects" title in `c-api/typeobj.rst`, duplicating the title of `c-api/type.rst`,
has been changed to "Type Objects Structures", thereby slightly improving Sphinx
search.
(cherry picked from commit 6b932edc5216d9766e70fef300a6b842ab33204c)

Co-authored-by: sharktide <meherrihaan@gmail.com>
7 months ago[3.12] gh-124269: Simplify `typing.Annotated` docs (GH-130770) (#131223)
Miss Islington (bot) [Fri, 14 Mar 2025 09:54:08 +0000 (10:54 +0100)] 
[3.12] gh-124269: Simplify `typing.Annotated` docs (GH-130770) (#131223)

gh-124269: Simplify `typing.Annotated` docs (GH-130770)

---------
(cherry picked from commit e4ac196aaaa9fd2f1bd0050797b58959671c549a)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months ago[3.12] gh-85012: Properly reset msgctxt when compiling messages with msgfmt (GH-13052...
Serhiy Storchaka [Thu, 13 Mar 2025 19:09:42 +0000 (21:09 +0200)] 
[3.12] gh-85012: Properly reset msgctxt when compiling messages with msgfmt (GH-130525) (GH-131206)

Add also human-readable snapshots for tests.
(cherry picked from commit 7ea6e88eb490635518c63c3305c03baf3e151555)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
7 months ago[3.12] gh-131181: Assert that PyObject_stgdict isn't NULL for PyCData (#131188)
Alexandra [Thu, 13 Mar 2025 15:06:39 +0000 (18:06 +0300)] 
[3.12] gh-131181: Assert that PyObject_stgdict isn't NULL for PyCData (#131188)

PyCData types have stgdict, so `PyObject_stgdict` can not return NULL.
Add an assert to make this clear.

7 months ago[3.12] gh-93096: Load doctests in `test_itertools` (GH-131133) (#131137)
Miss Islington (bot) [Wed, 12 Mar 2025 08:00:17 +0000 (09:00 +0100)] 
[3.12] gh-93096: Load doctests in `test_itertools` (GH-131133) (#131137)

gh-93096: Load doctests in `test_itertools` (GH-131133)
(cherry picked from commit 15a8412b5e12ae46761843d4442c7b56ffa75176)

Co-authored-by: donBarbos <donbarbos@proton.me>
7 months ago[3.12] gh-130957: Use `sleeping_retry` in `test_free_reference` (GH-130958) (#131092)
Miss Islington (bot) [Tue, 11 Mar 2025 14:13:41 +0000 (15:13 +0100)] 
[3.12] gh-130957: Use `sleeping_retry` in `test_free_reference` (GH-130958) (#131092)

The weak reference may not be immediately dead.
(cherry picked from commit 19081158713526a3042c2ad3c6d5a589579b420f)

Co-authored-by: Sam Gross <colesbury@gmail.com>
7 months ago[3.12] gh-101100: Fix sphinx warnings in `library/asyncio-subprocess.rst` (GH-130994...
Yuki Kobayashi [Tue, 11 Mar 2025 12:31:33 +0000 (21:31 +0900)] 
[3.12] gh-101100: Fix sphinx warnings in `library/asyncio-subprocess.rst` (GH-130994) (#131075)

(cherry picked from commit 7cc99a54b755cc7cc0b3680fde7834cf612d4fbc)

7 months agogh-130959: Reject whitespace in fractions, in pure Python `fromisoformat()` (GH-13096...
Miss Islington (bot) [Tue, 11 Mar 2025 12:00:06 +0000 (13:00 +0100)] 
gh-130959: Reject whitespace in fractions, in pure Python `fromisoformat()` (GH-130962) (GH-131076) (#131086)

Fix the pure Python implementation of `fromisoformat()` to reject any
non-digit characters, including whitespace, in the fractional part
of time specification.  This makes the behavior consistent with the C
implementation, and prevents incorrect parsing of these fractions
(e.g. `.400 ` would be misinterpreted as `.04`).

(cherry picked from commit 33494b4d0dafc34ff4f1c118b7b3b5d8de3dd0f4)
(cherry picked from commit 27fd328cf68e5d812cdb7f9533a16dd68d911c54)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Michał Górny <mgorny@gentoo.org>
7 months ago[3.12] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044) (#131085)
Victor Stinner [Tue, 11 Mar 2025 11:55:13 +0000 (12:55 +0100)] 
[3.12] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044) (#131085)

gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044)

(cherry picked from commit de8818ae233b8e7722aa5d6f91d4b5a04bd039df)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
7 months ago[3.12] gh-93096: Fix loading doctests in test_pickle (GH-131069) (GH-131081)
Miss Islington (bot) [Tue, 11 Mar 2025 10:42:47 +0000 (11:42 +0100)] 
[3.12] gh-93096: Fix loading doctests in test_pickle (GH-131069) (GH-131081)

(cherry picked from commit 3bb20d13a88a178dae809016b3d0a457f38aa686)

Co-authored-by: donBarbos <donbarbos@proton.me>
7 months ago[3.12] gh-130809: Fix `PyFrame_LocalsToFast` copying the wrong value (#130816)
Kyle Cutler [Tue, 11 Mar 2025 00:27:07 +0000 (17:27 -0700)] 
[3.12] gh-130809: Fix `PyFrame_LocalsToFast` copying the wrong value (#130816)

* gh-130809: Fix `PyFrame_LocalsToFast` copying the wrong value

* Skip hidden locals

* test, blurb

* Update Misc/NEWS.d/next/Core_and_Builtins/2025-03-04-12-52-21.gh-issue-130809.fSXq60.rst

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
* Update test

* PR feedback

* formatting

* comment

---------

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
7 months ago[3.12] gh-125331: Allow the parser to activate future imports on the fly (GH-125482...
Miss Islington (bot) [Mon, 10 Mar 2025 22:13:59 +0000 (23:13 +0100)] 
[3.12] gh-125331: Allow the parser to activate future imports on the fly (GH-125482) (#131063)

gh-125331: Allow the parser to activate future imports on the fly (GH-125482)
(cherry picked from commit 3bd3e09588bfde7edba78c55794a0e28e2d21ea5)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
7 months agogh-131020: py.exe launcher does not correctly detect a BOM when searching for the...
Miss Islington (bot) [Mon, 10 Mar 2025 20:12:40 +0000 (21:12 +0100)] 
gh-131020: py.exe launcher does not correctly detect a BOM when searching for the shebang (GH-131021)

(cherry picked from commit 36ef3bfe39d767e283b55fe86f34e7671b7f5d1c)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
7 months ago[3.12] gh-130711: Document `PyBaseObject_Type` (GH-130712) (GH-130793)
Miss Islington (bot) [Mon, 10 Mar 2025 14:05:45 +0000 (15:05 +0100)] 
[3.12] gh-130711: Document `PyBaseObject_Type` (GH-130712) (GH-130793)

(cherry picked from commit b3c18bfd828ba90b9c712da74095c4a052887655)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
7 months ago[3.12] gh-80421: Correct definitions of time (GH-130984) (#131023)
Miss Islington (bot) [Sun, 9 Mar 2025 20:18:31 +0000 (21:18 +0100)] 
[3.12] gh-80421: Correct definitions of time (GH-130984) (#131023)

gh-80421: Correct definitions of time (GH-130984)

Based on the Wikipedia article, UTC is better said to be a successor than a renaming of GTC and language agnostic rather than an English-French compromise.
(cherry picked from commit 98fa4a49fecbac3c990a25ce5d300592dad31be0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
7 months ago[3.12] gh-130160: use `.. program::` directive for documenting `pdb` CLI (GH-130996...
Miss Islington (bot) [Sun, 9 Mar 2025 16:18:43 +0000 (17:18 +0100)] 
[3.12] gh-130160: use `.. program::` directive for documenting `pdb` CLI (GH-130996) (#131013)

gh-130160: use `.. program::` directive for documenting `pdb` CLI (GH-130996)
(cherry picked from commit c240c2d88a080fc3c68c220aa81062cf5f130ab9)

Co-authored-by: donBarbos <donbarbos@proton.me>
8 months ago[3.12] gh-130160: use `.. program::` directive for documenting `webbrowser` CLI ...
donBarbos [Sun, 9 Mar 2025 07:33:56 +0000 (11:33 +0400)] 
[3.12] gh-130160: use `.. program::` directive for documenting `webbrowser` CLI (GH-130995) (#131004)

* gh-130160: use `.. program::` directive for documenting `webbrowser` CLI (#130995)

use `.. program::` directive for documenting `webbrowser` CLI

(cherry picked from commit 92e5f826ace1eab29920a0a3487a3cac7eeab925)

* remove extra paragraph

8 months ago[3.12] gh-123726: Document caveats of zipfile.Path around name sanitization (GH-13053...
Miss Islington (bot) [Sat, 8 Mar 2025 21:45:48 +0000 (22:45 +0100)] 
[3.12] gh-123726: Document caveats of zipfile.Path around name sanitization (GH-130537) (#130987)

gh-123726: Document caveats of zipfile.Path around name sanitization (GH-130537)

Add a note to the `zipfile.Path` class documentation clarifying that it does not sanitize filenames. This emphasizes the caller's responsibility to validate or sanitize inputs, especially when handling untrusted ZIP archives, to prevent path traversal vulnerabilities. The note also references the `extract` and `extractall` methods for comparison and suggests using `os.path.abspath` and `os.path.commonpath` for safe filename resolution.
(cherry picked from commit a3990df6121880e8c67824a101bb1316de232898)

Co-authored-by: Affan Shaikhsurab <51104750+AffanShaikhsurab@users.noreply.github.com>
8 months ago[3.12] gh-130917: update timer and workload in test_signal (GH-130918) (#130968)
Miss Islington (bot) [Sat, 8 Mar 2025 18:21:46 +0000 (19:21 +0100)] 
[3.12] gh-130917: update timer and workload in test_signal (GH-130918) (#130968)

The workload to advance the virtual timeout is too lightweight for some
platforms. As result the test goes in timeout as it never reaches the
end of the timer. By having a heavier workload, the virtual timer
advances rapidly and the SIGVTALRM is sent before the timeout.
(cherry picked from commit 78790811989ab47319e2ee725e0c435b3cdd21ab)

Co-authored-by: Diego Russo <diego.russo@arm.com>
8 months ago[3.12] gh-130954: Fix multiprocessing test_notify_n (GH-130955) (#130982)
Miss Islington (bot) [Sat, 8 Mar 2025 18:21:37 +0000 (19:21 +0100)] 
[3.12] gh-130954: Fix multiprocessing test_notify_n (GH-130955) (#130982)

The test could deadlock trying join on the worker processes.
Apply the same technique as gh-130933.

Join the process before the test ends in `test_notify` as well.
(cherry picked from commit edd1eca336976b3431cf636aea87f08a40c94935)

Co-authored-by: Sam Gross <colesbury@gmail.com>
8 months ago[3.12] gh-113238: add Anchor to importlib.resources (GH-113801) (#130499)
Hugo van Kemenade [Sat, 8 Mar 2025 16:27:34 +0000 (18:27 +0200)] 
[3.12] gh-113238: add Anchor to importlib.resources (GH-113801) (#130499)

(cherry picked from commit c85c0026a64c2a902138feeb73a9c66af1af31e0)

Co-authored-by: Mike Zimin <122507876+mikeziminio@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
8 months ago[3.12] gh-110206: Fix multiprocessing test_notify_all (GH-130933) (#130951)
Miss Islington (bot) [Fri, 7 Mar 2025 17:20:00 +0000 (18:20 +0100)] 
[3.12] gh-110206: Fix multiprocessing test_notify_all (GH-130933) (#130951)

The test could deadlock trying join on the worker processes due to a
combination of behaviors:

* The use of `assertReachesEventually` did not ensure that workers
  actually woken.release() because the SyncManager's Semaphore does not
  implement get_value.

* This mean that the test could finish and the variable "sleeping" would
  got out of scope and be collected. This unregisters the proxy leading
  to failures in the worker or possibly the manager.

* The subsequent call to `p.join()` during cleanUp therefore never
  finished.

This takes two approaches to fix this:

1) Use woken.acquire() to ensure that the workers actually finish
   calling woken.release()

2) At the end of the test, wait until the workers are finished, while `cond`,
   `sleeping`, and `woken` are still valid.
(cherry picked from commit c476410dc5ae62ffb5e32f64f9a3a622485c7d93)

Co-authored-by: Sam Gross <colesbury@gmail.com>
8 months ago[3.12] Correct function name in `Doc/extending/embedding.rst` (GH-127539) (#130946)
Miss Islington (bot) [Fri, 7 Mar 2025 13:14:25 +0000 (14:14 +0100)] 
[3.12] Correct function name in `Doc/extending/embedding.rst` (GH-127539) (#130946)

Correct function name in `Doc/extending/embedding.rst` (GH-127539)
(cherry picked from commit e5527f2cdda501542bf94179093e1a15d7889b74)

Co-authored-by: Boris Verkhovskiy <boris.verk@gmail.com>
8 months ago[3.12] gh-127371 Avoid unbounded growth SpooledTempfile.writelines (GH-127372) (...
Miss Islington (bot) [Wed, 5 Mar 2025 17:42:35 +0000 (18:42 +0100)] 
[3.12] gh-127371 Avoid unbounded growth SpooledTempfile.writelines (GH-127372) (#130885)

gh-127371 Avoid unbounded growth SpooledTempfile.writelines (GH-127372)
(cherry picked from commit cb67b44ca92f9930b3aa2aba8420c89d12a25303)

Co-authored-by: Bert Peters <bert@bertptrs.nl>
8 months ago[3.12] Update links from typing.readthedocs.io to typing.python.org (GH-130877) ...
Miss Islington (bot) [Wed, 5 Mar 2025 15:35:46 +0000 (16:35 +0100)] 
[3.12] Update links from typing.readthedocs.io to typing.python.org (GH-130877) (#130884)

Update links from typing.readthedocs.io to typing.python.org (GH-130877)
(cherry picked from commit 4f6218959e35f649061484cce9de7fc810586533)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
8 months ago[3.12] gh-116742: Fix subprocess test_check_output_timeout() (GH-130836) (#130874)
Miss Islington (bot) [Wed, 5 Mar 2025 12:00:41 +0000 (13:00 +0100)] 
[3.12] gh-116742: Fix subprocess test_check_output_timeout() (GH-130836) (#130874)

gh-116742: Fix subprocess test_check_output_timeout() (GH-130836)

Fix a race condition in test_check_output_timeout() of
test_subprocess. Don't write into stdout anymore, since there is no
reliable way to synchronize the parent and the child processes.

Change the timeout from 3 seconds to 0.1 seconds, and remove
@requires_resource('walltime') decorator.
(cherry picked from commit 67a942d4272145ccdbdf4ceff31318e176f71355)

Co-authored-by: Victor Stinner <vstinner@python.org>
8 months ago[3.12] gh-130824: Add tests for NULL in PyLong_*AndOverflow functions (GH-130828...
Petr Viktorin [Wed, 5 Mar 2025 11:52:40 +0000 (12:52 +0100)] 
[3.12] gh-130824: Add tests for NULL in PyLong_*AndOverflow functions (GH-130828) (GH-130876)

(cherry picked from commit 90130807d9c5a55b2a64024f5dfbee4785b9a27c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>