]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
10 months ago[3.12] gh-127563: use `dk_log2_index_bytes=3` in empty dicts (GH-127568) (GH-127813)
Miss Islington (bot) [Thu, 12 Dec 2024 11:50:51 +0000 (12:50 +0100)] 
[3.12] gh-127563: use `dk_log2_index_bytes=3` in empty dicts (GH-127568) (GH-127813)

This fixes a UBSan failure (unaligned zero-size memcpy) in `dictobject.c`.
(cherry picked from commit 9af96f440618304e7cc609c246e1f8c8b2d7a119)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months ago[3.12] gh-123401: Fix http.cookies module to support obsolete RFC 850 date format...
Miss Islington (bot) [Wed, 11 Dec 2024 15:34:22 +0000 (16:34 +0100)] 
[3.12] gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (GH-123405) (#127829)

gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (GH-123405)
(cherry picked from commit 359389ed51aecc107681e600b71852c0a97304e1)

Co-authored-by: Nano <nanoapezlk@gmail.com>
Co-authored-by: Wulian <1055917385@qq.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
10 months ago[3.12] Add `extern "C"` around `PyTraceMalloc_` functions. (#127772) (#127817)
Victor Stinner [Wed, 11 Dec 2024 13:08:23 +0000 (14:08 +0100)] 
[3.12] Add `extern "C"` around `PyTraceMalloc_` functions. (#127772) (#127817)

Add `extern "C"` around `PyTraceMalloc_` functions. (#127772)

Pretty much everything else exported by Python.h has an extern "C"
annotation, yet this header appears to be missing one.

(cherry picked from commit 2cdeb61b57e638ae46a04386330a12abe9cddf2c)

Co-authored-by: Peter Hawkins <hawkinsp@cs.stanford.edu>
10 months ago[3.12] GH-117195: Avoid assertion error in `object.__sizeof__` (GH-117220) (#127605)
Miss Islington (bot) [Wed, 11 Dec 2024 11:21:07 +0000 (12:21 +0100)] 
[3.12] GH-117195: Avoid assertion error in `object.__sizeof__` (GH-117220) (#127605)

GH-117195: Avoid assertion error in `object.__sizeof__` (GH-117220)
(cherry picked from commit 406ffb5293a8c9ca315bf63de1ee36a9b33f9aaf)

Co-authored-by: Mark Shannon <mark@hotpy.org>
10 months ago[3.12] gh-111609: `end_offset` is ignored in subclasses of SyntaxError (#127554)
Nice Zombies [Wed, 11 Dec 2024 09:09:34 +0000 (10:09 +0100)] 
[3.12] gh-111609: `end_offset` is ignored in subclasses of SyntaxError (#127554)

* `end_offset` is ignored in subclasses of SyntaxError

* 📜🤖 Added by blurb_it.

* Add test

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
10 months ago[3.12] Update the documentation howto index page and group docs into 3 logical sectio...
Hugo van Kemenade [Wed, 11 Dec 2024 06:58:37 +0000 (08:58 +0200)] 
[3.12] Update the documentation howto index page and group docs into 3 logical sections (GH-119366) (#127811)

(cherry picked from commit a26d27e7ee512cd822b7a7ba075171152779ffdd)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
10 months ago[3.12] Docs: Fix indents in `xmlrpc.client.rst` (GH-127782) (#127800)
Miss Islington (bot) [Tue, 10 Dec 2024 17:44:45 +0000 (18:44 +0100)] 
[3.12] Docs: Fix indents in `xmlrpc.client.rst` (GH-127782) (#127800)

Docs: Fix indents in `xmlrpc.client.rst` (GH-127782)
(cherry picked from commit 035f512046337e64a018d11fdaa3b21758625291)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
10 months ago[3.12] Add zizmor to pre-commit and fix most findings (GH-127749) (#127788)
Hugo van Kemenade [Tue, 10 Dec 2024 14:57:27 +0000 (16:57 +0200)] 
[3.12] Add zizmor to pre-commit and fix most findings (GH-127749) (#127788)

(cherry picked from commit ae31df354d02e12bf656954c5c72380d96c1dc0e)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
10 months ago[3.12] Add zizmor to pre-commit and fix most findings (GH-127749) (#127788)
Hugo van Kemenade [Tue, 10 Dec 2024 13:55:00 +0000 (15:55 +0200)] 
[3.12] Add zizmor to pre-commit and fix most findings (GH-127749) (#127788)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
10 months ago[3.12] gh-101100: Fix sphinx warnings in `whatsnew/3.0.rst` (GH-127662) (#127784)
Miss Islington (bot) [Tue, 10 Dec 2024 10:52:22 +0000 (11:52 +0100)] 
[3.12] gh-101100: Fix sphinx warnings in `whatsnew/3.0.rst` (GH-127662) (#127784)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
10 months ago[3.12] gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime...
Miss Islington (bot) [Tue, 10 Dec 2024 08:20:54 +0000 (09:20 +0100)] 
[3.12] gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (GH-127590) (#127649)

gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (GH-127590)

The code has required 4 digits for the year since its inclusion in the stdlib in 2002 (over 22 years ago as of this commit).
(cherry picked from commit 51cfa569e379f84b3418db0971a71b1ef575a42b)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months ago[3.12] gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH...
Miss Islington (bot) [Tue, 10 Dec 2024 08:02:22 +0000 (09:02 +0100)] 
[3.12] gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH-126776) (#127779)

gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH-126776)

(cherry picked from commit 2233c303e476496fc4c85a29a1429a7e4b1f707b)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
10 months agogh-127732: Add Windows Server 2025 detection to platform module (GH-127733)
Miss Islington (bot) [Mon, 9 Dec 2024 12:42:37 +0000 (13:42 +0100)] 
gh-127732: Add Windows Server 2025 detection to platform module (GH-127733)

(cherry picked from commit 5eb7fd4d0fc37b91058086181afebec41e66e5ad)

Co-authored-by: Wulian <1055917385@qq.com>
10 months ago[3.12] gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth...
Miss Islington (bot) [Sun, 8 Dec 2024 20:16:03 +0000 (21:16 +0100)] 
[3.12] gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth.__init__` (GH-127735) (#127745)

gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth.__init__` (GH-127735)

improve signature of urllib.request.HTTPPasswordMgrWithPriorAuth.__init__
(cherry picked from commit a03efb533a58fd13fb0cc7f4a5c02c8406a407bd)

Co-authored-by: Stephen Morton <git@tungol.org>
11 months ago[3.12] Give `poplib.POP3.rpop` a proper docstring (GH-127370) (#127722)
Miss Islington (bot) [Sat, 7 Dec 2024 16:33:04 +0000 (17:33 +0100)] 
[3.12] Give `poplib.POP3.rpop` a proper docstring (GH-127370) (#127722)

Give `poplib.POP3.rpop` a proper docstring (GH-127370)

Previously `poplib.POP3.rpop` had a "Not sure what this does" docstring, now it has been fixed.
(cherry picked from commit 27d0d2141319d82709eb09ba20065df3e1714fab)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
11 months ago[3.12] gh-101100: amend references starting with `!~` in gh-127054 (GH-127684) (...
Miss Islington (bot) [Fri, 6 Dec 2024 14:19:52 +0000 (15:19 +0100)] 
[3.12] gh-101100: amend references starting with `!~` in gh-127054 (GH-127684) (#127693)

gh-101100: amend references starting with `!~` in gh-127054 (GH-127684)
(cherry picked from commit 77a61c0465c27c1c4ba7cddf4638d9ed75259671)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
11 months ago[3.12] gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol...
Miss Islington (bot) [Fri, 6 Dec 2024 05:12:40 +0000 (06:12 +0100)] 
[3.12] gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol if needed (GH-127656) (#127664)

gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol if needed (GH-127656)

Ensure `_SelectorSocketTransport.writelines` pauses the protocol if it reaches the high water mark as needed.
(cherry picked from commit e991ac8f2037d78140e417cc9a9486223eb3e786)

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
11 months ago[3.12] [Docs] GDB howto: Fix block type of a cast example (GH-127621) (#127654)
Miss Islington (bot) [Thu, 5 Dec 2024 21:01:23 +0000 (22:01 +0100)] 
[3.12] [Docs] GDB howto: Fix block type of a cast example (GH-127621) (#127654)

[Docs] GDB howto: Fix block type of a cast example (GH-127621)
(cherry picked from commit 657d0e99aa8754372786120d6ec00c9d9970e775)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
11 months ago[3.12] GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327...
Miss Islington (bot) [Thu, 5 Dec 2024 19:01:25 +0000 (20:01 +0100)] 
[3.12] GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327) (GH-127646)

(cherry picked from commit d958d9f4a1b71c6d30960bf6c53c41046ea94590)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
11 months ago[3.12] gh-122431: Disallow negative values in `readline.append_history_file` (GH...
Miss Islington (bot) [Thu, 5 Dec 2024 17:15:30 +0000 (18:15 +0100)] 
[3.12] gh-122431: Disallow negative values in `readline.append_history_file` (GH-122469) (#127642)

gh-122431: Disallow negative values in `readline.append_history_file` (GH-122469)
(cherry picked from commit 208b0fb645c0e14b0826c0014e74a0b70c58c9d6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593) (#127631)
Victor Stinner [Thu, 5 Dec 2024 09:59:53 +0000 (10:59 +0100)] 
[3.12] gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593) (#127631)

gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593)

(cherry picked from commit fcbe6ecdb6ed4dd93b2ee144f89a73af755e2634)

11 months ago[3.12] gh-127347: Document `traceback.print_list` (GH-127348) (#127570)
Miss Islington (bot) [Wed, 4 Dec 2024 08:29:10 +0000 (09:29 +0100)] 
[3.12] gh-127347: Document `traceback.print_list` (GH-127348) (#127570)

Add an documentation entry about `traceback.print_list`

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
11 months agoPost 3.12.8
Thomas Wouters [Tue, 3 Dec 2024 21:35:54 +0000 (22:35 +0100)] 
Post 3.12.8

11 months agoPython 3.12.8 v3.12.8
Thomas Wouters [Tue, 3 Dec 2024 18:40:02 +0000 (19:40 +0100)] 
Python 3.12.8

11 months ago[3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-125205)
Miss Islington (bot) [Tue, 3 Dec 2024 17:26:25 +0000 (18:26 +0100)] 
[3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-125205)

Fix a crash caused by immortal interned strings being shared between
sub-interpreters that use basic single-phase init. In that case, the string
can be used by an interpreter that outlives the interpreter that created and
interned it. For interpreters that share obmalloc state, also share the
interned dict with the main interpreter.

This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS
failures identified by gh-124785 (i.e. backporting gh-125709 too).

(cherry picked from commit f2cb39947093feda3ff85b8dc820922cc5e5f954, AKA gh-124865)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
11 months ago[3.12] gh-126876: Fix socket internal_select() for large timeout (GH-126968) (#127003)
Miss Islington (bot) [Tue, 3 Dec 2024 14:12:59 +0000 (15:12 +0100)] 
[3.12] gh-126876: Fix socket internal_select() for large timeout (GH-126968) (#127003)

gh-126876: Fix socket internal_select() for large timeout (GH-126968)

If the timeout is larger than INT_MAX, replace it with INT_MAX, in
the poll() code path.

Add an unit test.
(cherry picked from commit b3687ad454c4ac54c8599a10f3ace8a13ca48915)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127558)
Miss Islington (bot) [Tue, 3 Dec 2024 12:57:58 +0000 (13:57 +0100)] 
[3.12] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127558)

(cherry picked from commit 35d37d6592d1be71ea76042165f6cbfa6c4c3a17)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
11 months agogh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)
Miss Islington (bot) [Mon, 2 Dec 2024 20:03:44 +0000 (21:03 +0100)] 
gh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)

(cherry picked from commit 4b00aba42e4d9440d22e399ec2122fe8601bbe54)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
11 months ago[3.12] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211...
Miss Islington (bot) [Mon, 2 Dec 2024 19:47:42 +0000 (20:47 +0100)] 
[3.12] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (GH-127216) (GH-127530)

[3.13] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (GH-127216)

Note, that transformed expression is not an equivalent for original one (1/exp(-x) != exp(x) in general for floating-point numbers). Though, the difference seems to be ~1ULP for good libm implementations.

It's more interesting why division was used from beginning. Closest algorithm I've found (no error checks, of course;)) - it's Algorithm 190 from ACM: https://dl.acm.org/doi/10.1145/366663.366679. It uses subtraction in the exponent.

(cherry picked from commit f7bb658124aba74be4c13f498bf46cfded710ef9)

(cherry picked from commit f41d8d89e79d634895868656f50a0e16e339f9d6)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
11 months ago[3.12] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127510)
Sergey B Kirpichev [Mon, 2 Dec 2024 14:19:59 +0000 (17:19 +0300)] 
[3.12] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127510)

(cherry picked from commit 930ba0ce605eee9e3b992fa368b00a3f2b7dc4c1)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702...
Miss Islington (bot) [Mon, 2 Dec 2024 14:18:53 +0000 (15:18 +0100)] 
[3.12] gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702) (#126761)

gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702)
(cherry picked from commit feb3e0b19cb03f06364a3f5e970f0861b8883d1c)

Co-authored-by: Stephen Morton <github@tungol.org>
11 months ago[3.12] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127512)
Miss Islington (bot) [Mon, 2 Dec 2024 14:01:46 +0000 (15:01 +0100)] 
[3.12] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127512)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
11 months ago[3.12] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127501)
Miss Islington (bot) [Mon, 2 Dec 2024 13:57:51 +0000 (14:57 +0100)] 
[3.12] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127501)

add missing gc_collect() calls in sqlite3 tests (GH-127446)
(cherry picked from commit 2a373da7700cf928e0a5ce3998d19351a3565df4)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
11 months ago[3.12] Docs: Miscellaneous corrections to simple statements in the language reference...
Carol Willing [Mon, 2 Dec 2024 13:55:31 +0000 (05:55 -0800)] 
[3.12] Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720) (#126891)

* Replace: The :keyword:`global` -> The :keyword:`global` statement
Add :keyword: when it's needed

* Replace repeated links with duoble backticks
(cherry picked from commit 94a7a4e22fb8f567090514785c69e65298acca42)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
11 months ago[3.12] gh-99880: document rounding mode for new-style formatting (GH-121481) (#126335)
Miss Islington (bot) [Mon, 2 Dec 2024 13:52:49 +0000 (14:52 +0100)] 
[3.12] gh-99880: document rounding mode for new-style formatting (GH-121481) (#126335)

The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half
to even tie-breaking rule.

If that functions is unavailable, PyOS_double_to_string() fallbacks to
system snprintf().  Since CPython 3.12, build requirements include C11
compiler *and* support for IEEE 754 floating point numbers (Annex F).
This means that FE_TONEAREST macro is available and, per default,
printf-like functions should use same rounding mode as _Py_dg_dtoa().

(cherry picked from commit 7d7d56d8b1147a6b85e1c09d01b164df7c5c4942)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] Fix Unicode encode_wstr_utf8() (#127420) (#127504)
Bénédikt Tran [Mon, 2 Dec 2024 12:24:26 +0000 (13:24 +0100)] 
[3.12] Fix Unicode encode_wstr_utf8() (#127420) (#127504)

Fix Unicode encode_wstr_utf8() (#127420)

Raise RuntimeError instead of RuntimeWarning.

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) (#127497)
Miss Islington (bot) [Mon, 2 Dec 2024 08:29:34 +0000 (09:29 +0100)] 
[3.12] gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) (#127497)

gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451)

Fix incorrect entries in `Doc/data/refcounts.dat`
(cherry picked from commit 1f8267b85dda655282922ba20df90d0ac6bea634)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) ...
Miss Islington (bot) [Sun, 1 Dec 2024 09:24:18 +0000 (10:24 +0100)] 
[3.12] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) (#127471)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
11 months ago[3.12] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127461)
Yuki Kobayashi [Sun, 1 Dec 2024 08:51:46 +0000 (17:51 +0900)] 
[3.12] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127461)

(cherry picked from commit 33ce8dcf791721fea563715f681dc1593a35b83b)

11 months ago[3.12] Add the missing `f` on an f-string error message in multiprocessing. (GH-12746...
Miss Islington (bot) [Sun, 1 Dec 2024 07:50:33 +0000 (08:50 +0100)] 
[3.12] Add the missing `f` on an f-string error message in multiprocessing. (GH-127462) (#127465)

Add the missing `f` on an f-string error message in multiprocessing. (GH-127462)
(cherry picked from commit 11c01092d5fa8f02c867a7f1f3c135ce63db4838)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
11 months ago[3.12] Link to correct class methods in asyncio primitives docs (GH-127270) (#127438)
Bénédikt Tran [Sat, 30 Nov 2024 10:02:07 +0000 (11:02 +0100)] 
[3.12] Link to correct class methods in asyncio primitives docs (GH-127270) (#127438)

11 months ago[3.12] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid...
Miss Islington (bot) [Sat, 30 Nov 2024 09:05:46 +0000 (10:05 +0100)] 
[3.12] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid joining parent process' threads (GH-126098) (GH-127164)

Threads are gone after fork, so clear the queues too. Otherwise the
child process (here created via multiprocessing.Process) crashes on
interpreter exit.

(cherry picked from commit 1848ce61f349533ae5892a8c24c2e0e3c364fc8a)

Co-authored-by: Andrei Bodrov <Drino@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] gh-127208: Reject null character in _imp.create_dynamic() (#127400) (#127419)
Victor Stinner [Fri, 29 Nov 2024 16:03:24 +0000 (17:03 +0100)] 
[3.12] gh-127208: Reject null character in _imp.create_dynamic() (#127400) (#127419)

gh-127208: Reject null character in _imp.create_dynamic() (#127400)

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.

Backport also the _PyUnicode_AsUTF8NoNUL() function.

(cherry picked from commit b14fdadc6c620875a20b7ccc3c9b069e85d8557a)

11 months ago[3.12] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (GH-127365) (#127394)
Hugo van Kemenade [Fri, 29 Nov 2024 11:02:41 +0000 (13:02 +0200)] 
[3.12] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (GH-127365) (#127394)

11 months ago[3.12] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)...
Miss Islington (bot) [Fri, 29 Nov 2024 10:59:22 +0000 (11:59 +0100)] 
[3.12] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358) (#127402)

gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)

Replace the sleep(2) with a task which is blocked forever.
(cherry picked from commit bfabf96b50b7d6a9c15b298a86ba3633b05a1fd7)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127391)
Miss Islington (bot) [Fri, 29 Nov 2024 09:22:27 +0000 (10:22 +0100)] 
[3.12] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127391)

gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304)

---------

(cherry picked from commit dd3a87d2a8f8750978359a99de2c5cb2168351d1)

Co-authored-by: Илья Любавский <100635212+lubaskinc0de@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] gh-127190: Fix local_setattro() error handling (GH-127366) (#127368)
Miss Islington (bot) [Thu, 28 Nov 2024 17:32:50 +0000 (18:32 +0100)] 
[3.12] gh-127190: Fix local_setattro() error handling (GH-127366) (#127368)

gh-127190: Fix local_setattro() error handling (GH-127366)

Don't make the assumption that the 'name' argument is a string. Use
repr() to format the 'name' argument instead.
(cherry picked from commit 20657fbdb14d50ca4ec115da0cbef155871d8d33)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-123967: Fix faulthandler for trampoline frames (#127329) (#127363)
Victor Stinner [Thu, 28 Nov 2024 13:57:35 +0000 (14:57 +0100)] 
[3.12] gh-123967: Fix faulthandler for trampoline frames (#127329) (#127363)

gh-123967: Fix faulthandler for trampoline frames (#127329)

If the top-most frame is a trampoline frame, skip it.

(cherry picked from commit 58e334e1431b2ed6b70ee42501ea73e08084e769)

11 months ago[3.12] gh-124008: Fix calculation of the number of written bytes for the Windows...
Miss Islington (bot) [Wed, 27 Nov 2024 14:00:30 +0000 (15:00 +0100)] 
[3.12] gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059) (GH-127326)

Since MultiByteToWideChar()/WideCharToMultiByte() is not reversible if
the data contains invalid UTF-8 sequences, use binary search to
calculate the number of written bytes from the number of written
characters.

Also fix writing incomplete UTF-8 sequences.

Also fix handling of memory allocation failures.
(cherry picked from commit 3cf83d91a5baf3600dd60f7aaaf4fb6d73c4b8a9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299)...
Miss Islington (bot) [Wed, 27 Nov 2024 12:22:32 +0000 (13:22 +0100)] 
[3.12] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299) (GH-127324)

(cherry picked from commit 83926d3b4c7847394b5e2531e9566d7fc9fbea0f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127311)
Yuki Kobayashi [Wed, 27 Nov 2024 09:46:42 +0000 (18:46 +0900)] 
[3.12] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127311)

11 months ago[3.12] gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) (GH-127252)
Miss Islington (bot) [Tue, 26 Nov 2024 10:13:29 +0000 (11:13 +0100)] 
[3.12] gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) (GH-127252)

gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184)

* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
(cherry picked from commit c7f1e3e150ca181f4b4bd1e5b59d492749f00be6)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
11 months ago[3.12] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127268)
Miss Islington (bot) [Mon, 25 Nov 2024 21:42:34 +0000 (22:42 +0100)] 
[3.12] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127268)

(cherry picked from commit 26ff32b30553e1f7b0cc822835ad2da8890c180c)

Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
11 months ago[3.12] Fix a few typos found in the docs (GH-127126) (GH-127185)
Rafael Fontenelle [Mon, 25 Nov 2024 19:48:00 +0000 (16:48 -0300)] 
[3.12] Fix a few typos found in the docs (GH-127126) (GH-127185)

(cherry picked from commit 39e60aeb3837f1f23d8b7f30d3b8d9faf805ef88)

11 months ago[3.12] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value...
Miss Islington (bot) [Mon, 25 Nov 2024 17:51:21 +0000 (18:51 +0100)] 
[3.12] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219) (#127263)

gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219)
(cherry picked from commit a2ee89968299fc4f0da4b5a4165025b941213ba5)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610...
Miss Islington (bot) [Mon, 25 Nov 2024 12:18:35 +0000 (13:18 +0100)] 
[3.12] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610) (GH-127160)

(cherry picked from commit 7725c0371a93be3ccfaff4871014a80bdf0ea274)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
11 months ago[3.12] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127240)
Yuki Kobayashi [Mon, 25 Nov 2024 08:51:48 +0000 (17:51 +0900)] 
[3.12] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127240)

11 months ago[3.12] gh-127217: Fix pathname2url() for paths starting with multiple slashes on...
Miss Islington (bot) [Sun, 24 Nov 2024 18:13:23 +0000 (19:13 +0100)] 
[3.12] gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218) (GH-127231)

(cherry picked from commit 97b2ceaaaf88a73a45254912a0e972412879ccbf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127233)
Miss Islington (bot) [Sun, 24 Nov 2024 17:48:12 +0000 (18:48 +0100)] 
[3.12] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127233)

Improve `pathname2url()` and `url2pathname()` docs (GH-127125)

These functions have long sown confusion among Python developers. The
existing documentation says they deal with URL path components, but that
doesn't fit the evidence on Windows:

    >>> pathname2url(r'C:\foo')
    '///C:/foo'
    >>> pathname2url(r'\\server\share')
    '////server/share'  # or '//server/share' as of quite recently

If these were URL path components, they would imply complete URLs like
`file://///C:/foo` and `file://////server/share`. Clearly this isn't right.
Yet the implementation in `nturl2path` is deliberate, and the
`url2pathname()` function correctly inverts it.

On non-Windows platforms, the behaviour until quite recently is to simply
quote/unquote the path without adding or removing any leading slashes. This
behaviour is compatible with *both* interpretations -- 1) the value is a
URL path component (existing docs), and 2) the value is everything
following `file:` (this commit)

The conclusion I draw is that these functions operate on everything after
the `file:` prefix, which may include an authority section. This is the
only explanation that fits both the  Windows and non-Windows behaviour.
It's also a better match for the function names.
(cherry picked from commit 307c63358681d669ae39e5ecd814bded4a93443a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] Fix "useable" typo in docs (GH-127200) (#127206)
Miss Islington (bot) [Sat, 23 Nov 2024 21:45:47 +0000 (22:45 +0100)] 
[3.12] Fix "useable" typo in docs (GH-127200) (#127206)

Fix "useable" typo in docs (GH-127200)

Fix typo in docs
(cherry picked from commit dbd23790dbd662169905be6300259992639d4e69)

Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
11 months ago[3.12] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (#127202)
Miss Islington (bot) [Sat, 23 Nov 2024 19:55:55 +0000 (20:55 +0100)] 
[3.12] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (#127202)

Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667)
(cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
11 months ago[3.12] gh-109746: Make _thread.start_new_thread delete state of new thread on its...
Serhiy Storchaka [Fri, 22 Nov 2024 19:56:39 +0000 (21:56 +0200)] 
[3.12] gh-109746: Make _thread.start_new_thread delete state of new thread on its startup failure (GH-109761) (GH-127173)

If Python fails to start newly created thread
due to failure of underlying PyThread_start_new_thread() call,
its state should be removed from interpreter' thread states list
to avoid its double cleanup.

(cherry picked from commit ca3ea9ad05c3d876a58463595e5b4228fda06936)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
11 months ago[3.12] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH...
Serhiy Storchaka [Fri, 22 Nov 2024 16:33:50 +0000 (18:33 +0200)] 
[3.12] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH-127158)

* Name without a PATHEXT extension is only searched if the mode does not
  include X_OK.
* Support multi-component PATHEXT extensions (e.g. ".foo.bar").
* Support files without extensions in PATHEXT contains dot-only extension
  (".", "..", etc).
* Support PATHEXT extensions that end with a dot (e.g. ".foo.").
(cherry picked from commit 8899e85de100557899da05f0b37867a371a73800)

11 months ago[3.12] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127148)
Miss Islington (bot) [Fri, 22 Nov 2024 14:13:43 +0000 (15:13 +0100)] 
[3.12] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127148)

(cherry picked from commit fcfdb55465636afc256bc29781b283404d88e6ca)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
11 months ago[3.12] gh-127082: Replace "Windows only" with the `availability: Windows` in `ctypes...
Jun Komoda [Fri, 22 Nov 2024 13:08:37 +0000 (22:08 +0900)] 
[3.12] gh-127082: Replace "Windows only" with the `availability: Windows` in `ctypes` doc (GH-127099) (#127145)

(cherry picked from commit 3c770e3f0978d825c5ebea98fcd654660e7e135f)

11 months ago[3.12] GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path...
Miss Islington (bot) [Fri, 22 Nov 2024 04:37:51 +0000 (05:37 +0100)] 
[3.12] GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132) (#127136)

GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132)

Decode a file URI like `file://///server/share` as a UNC path like
`\\server\share`. This form of file URI is created by software the simply
prepends `file:///` to any absolute Windows path.
(cherry picked from commit 8c98ed846a7d7e50c4cf06f823d94737144dcf6a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127131)
Miss Islington (bot) [Fri, 22 Nov 2024 03:42:46 +0000 (04:42 +0100)] 
[3.12] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127131)

GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129)

Discard any 'localhost' authority from the beginning of a `file:` URI. As a
result, file URIs like `//localhost/etc/hosts` are correctly decoded as
`/etc/hosts`.
(cherry picked from commit ebf564a1d3e2e81b9846535114e481d6096443d2)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127098)
Serhiy Storchaka [Thu, 21 Nov 2024 11:44:37 +0000 (13:44 +0200)] 
[3.12] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127098)

It now returns multiple era description segments separated by semicolons.
Previously it only returned the first segment on platforms with Glibc.
(cherry picked from commit 4803cd0244847f286641c85591fda08b513cea52)

11 months ago[3.12] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH...
Miss Islington (bot) [Thu, 21 Nov 2024 11:32:16 +0000 (12:32 +0100)] 
[3.12] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH-127095)

* Fix support of STRING and GLOBAL opcodes with non-ASCII arguments.
* dis() now outputs non-ASCII bytes in STRING, BINSTRING and
  SHORT_BINSTRING arguments as escaped (\xXX).
(cherry picked from commit eaf217108226633c03cc5c4c90f0b6e4587c8803)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] Run `apt update` before `apt install git` in autoconf CI job (GH-127071)
Miss Islington (bot) [Wed, 20 Nov 2024 19:37:24 +0000 (20:37 +0100)] 
[3.12] Run `apt update` before `apt install git` in autoconf CI job (GH-127071)

(cherry picked from commit 0af4ec30bd2e3a52350344d1011c0c125d6dcd71)

Co-authored-by: Zachary Ware <zach@python.org>
11 months ago[3.12] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127064)
Miss Islington (bot) [Wed, 20 Nov 2024 15:49:58 +0000 (16:49 +0100)] 
[3.12] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127064)

This catches a memory leak in loading the BUILD opcode.
(cherry picked from commit addb225f3823b03774cddacce35214dd471bec46)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH...
Miss Islington (bot) [Tue, 19 Nov 2024 21:55:10 +0000 (22:55 +0100)] 
[3.12] GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852) (#127040)

GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852)

Adjust `urllib.request.url2pathname()` and `pathname2url()` to use the
filesystem encoding when quoting and unquoting file URIs, rather than
forcing use of UTF-8.

No changes are needed in the `nturl2path` module because Windows always
uses UTF-8, per PEP 529.
(cherry picked from commit c9b399fbdb01584dcfff0d7f6ad484644ff269c3)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990...
Miss Islington (bot) [Tue, 19 Nov 2024 18:19:18 +0000 (19:19 +0100)] 
[3.12] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990) (GH-127019)

If PyObject_SetItem() fails in the `load_build()` function of _pickle.c, no DECREF for the `dict` variable.
(cherry picked from commit 29cbcbd73bbfd8c953c0b213fb33682c289934ff)

Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
11 months ago[3.12] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127016)
Miss Islington (bot) [Tue, 19 Nov 2024 15:41:41 +0000 (16:41 +0100)] 
[3.12] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127016)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months ago[3.12] gh-126789: Correct sysconfig test exclusions for iOS and Android. (GH-126941...
Russell Keith-Magee [Tue, 19 Nov 2024 10:01:54 +0000 (18:01 +0800)] 
[3.12] gh-126789: Correct sysconfig test exclusions for iOS and Android. (GH-126941) (GH-126959)

(cherry picked from commit 3938fd60c0c88891b213097380aeea91a45bcd77)

11 months ago[3.12] gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754) (#127005)
Miss Islington (bot) [Tue, 19 Nov 2024 08:33:18 +0000 (09:33 +0100)] 
[3.12] gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754) (#127005)

gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754)

Reject flags smaller than INT_MIN.

(cherry picked from commit 84f07c3a4cbcfe488ccfb4030571be0bc4de7e45)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
11 months ago[3.12] gh-126911: Update credits output (GH-126913) (#126974)
Miss Islington (bot) [Mon, 18 Nov 2024 15:58:22 +0000 (16:58 +0100)] 
[3.12] gh-126911: Update credits output (GH-126913) (#126974)

Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months ago[3.12] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930...
Miss Islington (bot) [Mon, 18 Nov 2024 13:22:58 +0000 (14:22 +0100)] 
[3.12] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930) (#126964)

gh-126909: Fix running xattr tests on systems with lower limits (GH-126930)

Modify the extended attribute tests to write fewer and smaller extended
attributes, in order to fit within filesystems with total xattr limit
of 1 KiB (e.g. ext4 with 1 KiB blocks).  Previously, the test would
write over 2 KiB, making it fail with ENOSPC on such systems.
(cherry picked from commit 2c0a21c1aad65ab8362491acf856eb574b1257ad)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
11 months ago[3.12] gh-101955: Fix SystemError in possesive quantifier with alternative and group...
Miss Islington (bot) [Mon, 18 Nov 2024 12:03:19 +0000 (13:03 +0100)] 
[3.12] gh-101955: Fix SystemError in possesive quantifier with alternative and group (GH-111362) (GH-126963)

(cherry picked from commit f9c5573dedcb2f2e9ae152672ce157987cdea612)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] gh-67877: Fix memory leaks in terminated RE matching (GH-126840) (GH-126961)
Serhiy Storchaka [Mon, 18 Nov 2024 11:24:13 +0000 (13:24 +0200)] 
[3.12] gh-67877: Fix memory leaks in terminated RE matching (GH-126840) (GH-126961)

If SRE(match) function terminates abruptly, either because of a signal
or because memory allocation fails, allocated SRE_REPEAT blocks might
be never released.

(cherry picked from commit 7538e7f5696408fa0aa02fce8a413a7dfac76a04)

11 months ago[3.12] gh-124452: Fix header mismatches when folding/unfolding with email message...
Miss Islington (bot) [Sun, 17 Nov 2024 20:12:29 +0000 (21:12 +0100)] 
[3.12] gh-124452: Fix header mismatches when folding/unfolding with email message (GH-125919) (#126916)

gh-124452: Fix header mismatches when folding/unfolding with email message (GH-125919)

The header-folder of the new email API has a long standing known buglet where
if the first token is longer than max_line_length, it puts that token on the next
line.  It turns out there is also a *parsing* bug when parsing such a header:
the space prefixing that first, non-empty line gets preserved and tacked on to
the start of the header value, which is not the expected behavior per the RFCs.
The bug arises from the fact that the parser assumed that there would be at
least one token on the line with the header, which is going to be true for
probably every email producer other than the python email library with its
folding buglet.  Clearly, though, this is a case that needs to be handled
correctly.  The fix is simple: strip the blanks off the start of the whole
value, not just the first physical line of the value.

(cherry picked from commit ed81971e6b26c34445f06850192b34458b029337)

Co-authored-by: RanKKI <hliu86.me@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] GH-126789: fix some sysconfig data on late site initializations
Miss Islington (bot) [Sun, 17 Nov 2024 00:26:59 +0000 (01:26 +0100)] 
[3.12] GH-126789: fix some sysconfig data on late site initializations

Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
11 months ago[3.12] gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input...
Miss Islington (bot) [Fri, 15 Nov 2024 23:20:10 +0000 (00:20 +0100)] 
[3.12] gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input month is not correct (GH-126484) (GH-126878)

gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input month is not correct (GH-126484)
(cherry picked from commit 3be7498d2450519d5d8f63a35ef298db3b3d935b)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
11 months ago[3.12] Added a warning to the urljoin docs, indicating that it is not safe to use...
Miss Islington (bot) [Fri, 15 Nov 2024 23:17:37 +0000 (00:17 +0100)] 
[3.12] Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659) (#126889)

Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc154e93a0a20ab97187d3e8b726fffb14f8f)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
11 months ago[3.12] gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) (GH-126870)
Miss Islington (bot) [Fri, 15 Nov 2024 14:04:35 +0000 (15:04 +0100)] 
[3.12] gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) (GH-126870)

Proxes of shared objects register a Finalizer in BaseProxy._incref(), and it
will call BaseProxy._decref() when it is GCed. This may cause a race condition
with Pool(maxtasksperchild=None) on Windows.

A connection would be closed and raised TypeError when a GC occurs between
_ConnectionBase._check_writable() and _ConnectionBase._send_bytes() in
_ConnectionBase.send() in the second or later task, and a new object
is allocated that shares the id() of a previously deleted one.

Instead of using the id() of the token (or the proxy), use a unique,
non-reusable number.

(cherry picked from commit ba088c8f9cf7163b0f28c507cb1343befe21997e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Akinori Hattori <hattya@gmail.com>
11 months ago[3.12] gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH...
Miss Islington (bot) [Fri, 15 Nov 2024 13:07:04 +0000 (14:07 +0100)] 
[3.12] gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182) (GH-126824)

gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182)

* gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance

This changes nothing changes for CPython supported platforms,
but hints how to deal with platforms that stick to the letter of
the spec.
It also marks `socket.getaddrinfo` as a wrapper around `getaddrinfo(3)`;
specifically, workarounds to make the function work consistently across
platforms are out of scope in its code.

Include wording similar to the POSIX's “by providing options and by
limiting the returned information”, which IMO suggests that the
hints limit the resulting list compared to the defaults, *but* can
be interpreted differently. Details are added in a note.

Specifically say that this wraps the underlying C function. So, the
details are in OS docs. The “full range of results” bit goes away.

Use `AF_UNSPEC` rather than zero for the *family* default, although
I don't think a system where it's nonzero would be very usable.

Suggest setting proto and/or type (with examples, as the appropriate
values aren't obvious). Say why you probably want to do that that
on all systems; mention the behavior on the “letter of the spec”
systems.

Suggest that the results should be tried in order, which is,
AFAIK best practice -- see RFC 6724 section 2, and its predecessor
from 2003 (which are specific to IP, but indicate how people use this):

> Well-behaved applications SHOULD iterate through the list of
> addresses returned from `getaddrinfo()` until they find a working address.

(cherry picked from commit ff0ef0a54bef26fc507fbf9b7a6009eb7d3f17f5)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
11 months ago[3.12] gh-126413: Add translation tests for getopt and optparse (GH-126698) (GH-126756)
Tomas R. [Fri, 15 Nov 2024 11:07:16 +0000 (12:07 +0100)] 
[3.12] gh-126413: Add translation tests for getopt and optparse (GH-126698) (GH-126756)

(cherry picked from commit dff074d1446bab23578a6b228b0c59a17006299c)

11 months ago[3.12] GH-126766: `url2pathname()`: handle empty authority section. (GH-126767) ...
Miss Islington (bot) [Thu, 14 Nov 2024 23:52:46 +0000 (00:52 +0100)] 
[3.12] GH-126766: `url2pathname()`: handle empty authority section. (GH-126767) (#126837)

GH-126766: `url2pathname()`: handle empty authority section. (GH-126767)

Discard two leading slashes from the beginning of a `file:` URI if they
introduce an empty authority section. As a result, file URIs like
`///etc/hosts` are correctly parsed as `/etc/hosts`.
(cherry picked from commit cae9d9d20f61cdbde0765efa340b6b596c31b67f)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] gh-126807: pygettext: Do not attempt to extract messages from function definit...
Miss Islington (bot) [Thu, 14 Nov 2024 22:35:35 +0000 (23:35 +0100)] 
[3.12] gh-126807: pygettext: Do not attempt to extract messages from function definitions. (GH-126808) (GH-126847)

Fixes a bug where pygettext would attempt
to extract a message from a code like this:

def _(x): pass

This is because pygettext only looks at one
token at a time and '_(x)' looks like a
function call.

However, since 'x' is not a string literal,
it would erroneously issue a warning.
(cherry picked from commit 9a456383bed52010b90bd491277ea855626a7bba)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
11 months ago[3.12] Document that return-less user-defined functions return None (GH-126769) ...
Miss Islington (bot) [Thu, 14 Nov 2024 09:46:26 +0000 (10:46 +0100)] 
[3.12] Document that return-less user-defined functions return None (GH-126769) (#126823)

Document that return-less user-defined functions return None (GH-126769)
(cherry picked from commit e0692f11650acb6c2eed940eb94650b4703c072e)

Co-authored-by: John Marshall <jmarshall@hey.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
11 months ago[3.12] gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732...
Miss Islington (bot) [Thu, 14 Nov 2024 05:08:18 +0000 (06:08 +0100)] 
[3.12] gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732) (#126819)

gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732)
(cherry picked from commit 6a93a1adbb56a64ec6d20e8aab911439998502c9)

Co-authored-by: Wulian <xiguawulian@gmail.com>
11 months ago[3.12] gh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15. (GH-125800)
Miss Islington (bot) [Thu, 14 Nov 2024 05:06:14 +0000 (06:06 +0100)] 
[3.12] gh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15. (GH-125800)

(cherry picked from commit fc9e6bf53d1c9ce2b5f802864e0da265a77c111f)

Co-authored-by: Ned Deily <nad@python.org>
11 months ago[3.12] Docs: re-create pages for removed modules to document their removal, based...
Ned Batchelder [Thu, 14 Nov 2024 00:02:09 +0000 (19:02 -0500)] 
[3.12] Docs: re-create pages for removed modules to document their removal, based on GH-126622 (#126781)

[3.12] Docs: re-create pages for removed modules to document their removal, based on #126622

11 months ago[3.12] gh-126188: Update bundled pip to 24.3.1 (gh-126805) (gh-126813)
Stéphane Bidoul [Wed, 13 Nov 2024 23:42:54 +0000 (00:42 +0100)] 
[3.12] gh-126188: Update bundled pip to 24.3.1 (gh-126805) (gh-126813)

Update bundled pip to 24.3.1
(cherry picked from commit f6b0361c17552197f44be16435e4a5cb4b1d60ca)

11 months ago[3.12] GH-126606: don't write incomplete pyc files (GH-126627) (GH-126810)
Miss Islington (bot) [Wed, 13 Nov 2024 22:49:47 +0000 (23:49 +0100)] 
[3.12] GH-126606: don't write incomplete pyc files (GH-126627) (GH-126810)

GH-126606: don't write incomplete pyc files (GH-126627)
(cherry picked from commit c695e37a3f95c225ee08d1e882d23fa200b5ec34)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Brett Cannon <brett@python.org>
11 months ago[3.12] gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792...
Miss Islington (bot) [Wed, 13 Nov 2024 18:50:29 +0000 (19:50 +0100)] 
[3.12] gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792) (GH-126797)

gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792)

Update libexpat to 2.6.4, make future updates easier.
(cherry picked from commit 3c9996909402fadc98e6ca2a64e75a71a7427352)

Co-authored-by: Seth Michael Larson <seth@python.org>
11 months ago[3.12] gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759...
Miss Islington (bot) [Wed, 13 Nov 2024 18:44:01 +0000 (19:44 +0100)] 
[3.12] gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759) (#126779)

gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759)
(cherry picked from commit a12690ef49e8fc8a3af4c5f1757eb3caffb35e03)

Co-authored-by: Ritvik Pasham <ritvikpasham@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
11 months ago[3.12] bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces...
Miss Islington (bot) [Wed, 13 Nov 2024 09:20:47 +0000 (10:20 +0100)] 
[3.12] bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces (GH-30196) (#126771)

bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces (GH-30196)

---------

(cherry picked from commit 2e39d77ddeb51505d65fd54ccfcd72615c6b1927)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
11 months ago[3.12] gh-104745: Limit starting a patcher more than once without stopping it (GH...
Miss Islington (bot) [Wed, 13 Nov 2024 08:37:34 +0000 (09:37 +0100)] 
[3.12] gh-104745: Limit starting a patcher more than once without stopping it (GH-126649) (#126773)

gh-104745: Limit starting a patcher more than once without stopping it (GH-126649)

Previously, this would cause an `AttributeError` if the patch stopped more than once after this, and would also disrupt the original patched object.

---------

(cherry picked from commit 1e40c5ba47780ddd91868abb3aa064f5ba3015e4)

Co-authored-by: Red4Ru <39802734+Red4Ru@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] GH-120423: `pathname2url()`: handle forward slashes in Windows paths (GH-12659...
Miss Islington (bot) [Tue, 12 Nov 2024 21:53:58 +0000 (22:53 +0100)] 
[3.12] GH-120423: `pathname2url()`: handle forward slashes in Windows paths (GH-126593) (#126763)

GH-120423: `pathname2url()`: handle forward slashes in Windows paths (GH-126593)

Adjust `urllib.request.pathname2url()` so that forward slashes in Windows
paths are handled identically to backward slashes.
(cherry picked from commit bf224bd7cef5d24eaff35945ebe7ffe14df7710f)

Co-authored-by: Barney Gale <barney.gale@gmail.com>