]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
17 months ago[3.12] gh-119666: fix multiple class-scope comprehensions referencing __class__ ...
Miss Islington (bot) [Mon, 10 Jun 2024 04:37:15 +0000 (06:37 +0200)] 
[3.12] gh-119666: fix multiple class-scope comprehensions referencing __class__ (GH-120295) (#120300)

17 months ago[3.12] gh-120276: Fix incorrect email.header.Header maxlinelen default (GH-120277...
Miss Islington (bot) [Sat, 8 Jun 2024 17:26:01 +0000 (19:26 +0200)] 
[3.12] gh-120276: Fix incorrect email.header.Header maxlinelen default (GH-120277) (GH-120278)

(cherry picked from commit 7c016deae62308dd1b4e2767fc6abf04857c7843)

Co-authored-by: Clinton <pygeek@users.noreply.github.com>
17 months ago[3.12] gh-120121: Add InvalidStateError to concurrent.futures.__all__ (GH-120123...
Miss Islington (bot) [Sat, 8 Jun 2024 16:28:21 +0000 (18:28 +0200)] 
[3.12] gh-120121: Add InvalidStateError to concurrent.futures.__all__ (GH-120123) (#120274)

gh-120121: Add InvalidStateError to concurrent.futures.__all__ (GH-120123)
(cherry picked from commit 5d59b870effa0f576acf7264cfcbfca2b36e34e3)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
17 months ago[3.12] gh-120244: Fix re.sub() reference leak (GH-120245) (GH-120265)
Miss Islington (bot) [Sat, 8 Jun 2024 11:10:44 +0000 (13:10 +0200)] 
[3.12] gh-120244: Fix re.sub() reference leak (GH-120245) (GH-120265)

(cherry picked from commit 38a25e9560cf0ff0b80d9e90bce793ff24c6e027)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
17 months ago[3.12] bpo-37755: Use configured output in pydoc instead of pager (GH-15105) (GH...
Serhiy Storchaka [Sat, 8 Jun 2024 09:46:25 +0000 (12:46 +0300)] 
[3.12] bpo-37755: Use configured output in pydoc instead of pager (GH-15105) (GH-120262)

If the Helper() class was initialized with an output, the topics, keywords
and symbols help still use the pager instead of the output.
Change the behavior so  the output is used if available while keeping the
previous behavior if no output was configured.
(cherry picked from commit 2080425154d235b4b7dcc9a8a2f58e71769125ca)

Co-authored-by: Enrico Tröger <enrico.troeger@uvena.de>
17 months ago[3.12] gh-120242: Fix handling of `[setUp,tearDown]Class` in `test_datetime` (GH...
Miss Islington (bot) [Sat, 8 Jun 2024 08:09:55 +0000 (10:09 +0200)] 
[3.12] gh-120242: Fix handling of `[setUp,tearDown]Class` in `test_datetime` (GH-120243) (#120260)

gh-120242: Fix handling of `[setUp,tearDown]Class` in `test_datetime` (GH-120243)
(cherry picked from commit 95f4db88d5ab7d900f05d0418b2a2e77bf9ff126)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
17 months ago[3.12] gh-120200: Fix `inspect.iscoroutinefunction(inspect) is True` corner case...
Nikita Sobolev [Fri, 7 Jun 2024 16:41:45 +0000 (19:41 +0300)] 
[3.12] gh-120200: Fix `inspect.iscoroutinefunction(inspect) is True` corner case (GH-120214) (#120239)

* [3.12] gh-120200: Fix `inspect.iscoroutinefunction(inspect) is True` corner case (GH-120214)
(cherry picked from commit 10fb1b8f36ab2fc3d2fe7392d5735dd19c5e2365)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
17 months ago[3.12] gh-120155: Fix copy/paste error in HAVE_SUBOFFSETS_IN_LAST_DIM() (GH-120228...
Miss Islington (bot) [Fri, 7 Jun 2024 16:26:03 +0000 (18:26 +0200)] 
[3.12] gh-120155: Fix copy/paste error in HAVE_SUBOFFSETS_IN_LAST_DIM() (GH-120228) (#120240)

gh-120155: Fix copy/paste error in HAVE_SUBOFFSETS_IN_LAST_DIM() (GH-120228)

Don't hardcode 'dest' in HAVE_SUBOFFSETS_IN_LAST_DIM() macro of
memoryobject.c, but use its 'view' parameter instead.

Fix the Coverity issue:

Error: COPY_PASTE_ERROR (CWE-398):
Python-3.12.2/Objects/memoryobject.c:273:14: original: ""dest->suboffsets + (dest->ndim - 1)"" looks like the original copy.
Python-3.12.2/Objects/memoryobject.c:274:14: copy_paste_error: ""dest"" in ""src->suboffsets + (dest->ndim - 1)"" looks like a copy-paste error.
Python-3.12.2/Objects/memoryobject.c:274:14: remediation: Should it say ""src"" instead?
GH-  272|       assert(dest->ndim > 0 && src->ndim > 0);
GH-  273|       return (!HAVE_SUBOFFSETS_IN_LAST_DIM(dest) &&
GH-  274|->             !HAVE_SUBOFFSETS_IN_LAST_DIM(src) &&
GH-  275|               dest->strides[dest->ndim-1] == dest->itemsize &&
GH-  276|               src->strides[src->ndim-1] == src->itemsize);
(cherry picked from commit 90b75405260467814c93738a3325645918d4ea51)

Co-authored-by: Victor Stinner <vstinner@python.org>
17 months ago[3.12] gh-120155: Fix optimize_and_assemble_code_unit() error handling (#120231)
Victor Stinner [Fri, 7 Jun 2024 15:17:06 +0000 (17:17 +0200)] 
[3.12] gh-120155: Fix optimize_and_assemble_code_unit() error handling (#120231)

gh-120155: Fix optimize_and_assemble_code_unit() error handling

Don't use 'g' before it's being initialized: don't use the 'error'
label if consts_dict_keys_inorder() failed.

Fix the Coverity issue:

Error: UNINIT (CWE-457):
Python-3.12.2/Python/compile.c:7670:5: skipped_decl: Jumping over declaration of ""g"".
Python-3.12.2/Python/compile.c:7714:5: uninit_use_in_call: Using uninitialized value ""g.g_block_list"" when calling ""_PyCfgBuilder_Fini"".
Python-3.12.2/Python/compile.c:7714:5: uninit_use_in_call: Using uninitialized value ""g.g_entryblock"" when calling ""_PyCfgBuilder_Fini"".
  7712|       Py_XDECREF(consts);
  7713|       instr_sequence_fini(&optimized_instrs);
  7714|->     _PyCfgBuilder_Fini(&g);
  7715|       return co;
  7716|   }

17 months ago[3.12] gh-110383: Improve 'old string formatting' text in tutorial (GH-120219) (...
Miss Islington (bot) [Fri, 7 Jun 2024 13:43:59 +0000 (15:43 +0200)] 
[3.12] gh-110383: Improve 'old string formatting' text in tutorial (GH-120219) (#120230)

(cherry picked from commit 225aab7f70d804174cc3a75bc04a5bb1545e5adb)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
17 months ago[3.12] gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 (GH-120213) (GH-120216)
Miss Islington (bot) [Fri, 7 Jun 2024 11:30:50 +0000 (13:30 +0200)] 
[3.12] gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 (GH-120213) (GH-120216)

* Use new methods for tracing Tcl variable.
* Fix Combobox.current() for empty combobox.
(cherry picked from commit d68a22e7a68ae09f7db61d5a1a3bd9c0360cf3ee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.12] gh-112672: Fix builtin Tkinter with Tcl 9.0 (GH-112681) (GH-120209)
Miss Islington (bot) [Fri, 7 Jun 2024 10:18:42 +0000 (12:18 +0200)] 
[3.12] gh-112672: Fix builtin Tkinter with Tcl 9.0 (GH-112681) (GH-120209)

* Add declaration of Tcl_AppInit(), missing in Tcl 9.0.
* Use Tcl_Size instead of int where needed.

(cherry picked from commit e0799352823289fafb8131341abd751923ee9c08)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.12] gh-110383: Clarify "non-integral" wording in pow() docs (GH-119688) (#120207)
Miss Islington (bot) [Fri, 7 Jun 2024 09:53:55 +0000 (11:53 +0200)] 
[3.12] gh-110383: Clarify "non-integral" wording in pow() docs (GH-119688) (#120207)

(cherry picked from commit 6646a9da26d12fc54263b22dd2916a2f710f1db7)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
17 months ago[3.12] gh-120154: Fix Emscripten/WASI pattern in case statement for LDSHARED… (#120204)
Victor Stinner [Fri, 7 Jun 2024 09:49:54 +0000 (11:49 +0200)] 
[3.12] gh-120154: Fix Emscripten/WASI pattern in case statement for LDSHARED… (#120204)

gh-120154: Fix Emscripten/WASI pattern in case statement for LDSHARED (#120173)

Fix Emscripten/WASI pattern in case statement for LDSHARED

(cherry picked from commit 47816f465e833a5257a82b759b1081e06381e528)

Co-authored-by: Michael Allwright <contact@allwright.io>
17 months ago[3.12] gh-120164: Fix test_os.test_win32_mkdir_700() (GH-120177) (#120203)
Miss Islington (bot) [Fri, 7 Jun 2024 09:35:08 +0000 (11:35 +0200)] 
[3.12] gh-120164: Fix test_os.test_win32_mkdir_700() (GH-120177) (#120203)

gh-120164: Fix test_os.test_win32_mkdir_700() (GH-120177)

Don't compare the path to avoid encoding issues.

(cherry picked from commit d5ba4fc9bc9b2d9eff2a90893e8d500e0c367237)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
17 months ago[3.12] Add Plausible for docs metrics (GH-119977) (#120194)
Miss Islington (bot) [Fri, 7 Jun 2024 07:42:37 +0000 (09:42 +0200)] 
[3.12] Add Plausible for docs metrics (GH-119977) (#120194)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Julien Palard <julien@palard.fr>
17 months ago[3.12] GH-119054: Add "Reading directories" section to pathlib docs (GH-119956) ...
Barney Gale [Fri, 7 Jun 2024 00:24:44 +0000 (01:24 +0100)] 
[3.12] GH-119054: Add "Reading directories" section to pathlib docs (GH-119956) (#120184)

Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.

(cherry picked from commit 14e1506a6d7056c38fbbc0797268dcf783f91243)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
17 months agoPost 3.12.4
Thomas Wouters [Thu, 6 Jun 2024 22:25:42 +0000 (00:25 +0200)] 
Post 3.12.4

17 months agoPython 3.12.4 v3.12.4
Thomas Wouters [Thu, 6 Jun 2024 18:20:06 +0000 (20:20 +0200)] 
Python 3.12.4

17 months ago[3.12] Restore decimal context after decimal doctests (GH-120149) (GH-120168)
Miss Islington (bot) [Thu, 6 Jun 2024 17:31:36 +0000 (19:31 +0200)] 
[3.12] Restore decimal context after decimal doctests (GH-120149) (GH-120168)

The modified context caused tests failures in several other tests.
(cherry picked from commit 2d7ff6e0e7d4c08ba84079a5c19a4a485626e1de)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.12] gh-120111: Don't use cirrus M1 macOS runners on fork (GH-120116) (GH-120153)
Łukasz Langa [Thu, 6 Jun 2024 12:30:20 +0000 (08:30 -0400)] 
[3.12] gh-120111: Don't use cirrus M1 macOS runners on fork (GH-120116) (GH-120153)

(cherry picked from commit fd104dfcb838d735ef8128e3539d7a730d403422)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months ago[3.12] typing docs: fix indentation of TypedDict deprecation notice (#120124)
Alex Waygood [Wed, 5 Jun 2024 17:37:24 +0000 (18:37 +0100)] 
[3.12] typing docs: fix indentation of TypedDict deprecation notice (#120124)

17 months ago[3.12] gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contex...
Miss Islington (bot) [Wed, 5 Jun 2024 12:02:52 +0000 (14:02 +0200)] 
[3.12] gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657) (#120106)

gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657)
(cherry picked from commit 5c02ea8bae2287a828840f5734966da23dc573dc)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
17 months ago[3.12] gh-119819: Update logging configuration to support joinable multiproc… (GH...
Miss Islington (bot) [Wed, 5 Jun 2024 06:59:15 +0000 (08:59 +0200)] 
[3.12] gh-119819: Update logging configuration to support joinable multiproc… (GH-120090) (GH-120092)

(cherry picked from commit 983efcf15b2503fe0c05d5e03762385967962b33)

17 months ago[3.12] gh-120078: Fix struct_time attr typo tm_day -> tm_mday in Doc/library/time...
Miss Islington (bot) [Wed, 5 Jun 2024 00:29:28 +0000 (02:29 +0200)] 
[3.12] gh-120078: Fix struct_time attr typo tm_day -> tm_mday in Doc/library/time.rst (GH-120084)

(cherry picked from commit b6b0dcbfc054f581b6f78602e4c2e9474e3efe21)

Co-authored-by: shurj0 <60540027+shurj0@users.noreply.github.com>
17 months ago[3.12] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) (#119644)
Jelle Zijlstra [Tue, 4 Jun 2024 19:55:45 +0000 (12:55 -0700)] 
[3.12] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) (#119644)

* [3.12] gh-119311: Fix name mangling with PEP 695 generic classes (#119464)

Fixes #119311. Fixes #119395.

(cherry picked from commit a9a74da4a0ca0645f049e67b6434a95e30592c32)

17 months ago[3.12] gh-119819: Update test to skip if _multiprocessing is unavailable. (GH-120067...
Miss Islington (bot) [Tue, 4 Jun 2024 19:43:52 +0000 (21:43 +0200)] 
[3.12] gh-119819: Update test to skip if _multiprocessing is unavailable. (GH-120067) (GH-120071)

(cherry picked from commit 109e1082ea92f89d42cd70f2cc7ca6fba6be9bab)

17 months ago[3.12] gh-120048: Make `test_imaplib` faster (GH-120050) (#120070)
Miss Islington (bot) [Tue, 4 Jun 2024 19:25:17 +0000 (21:25 +0200)] 
[3.12] gh-120048: Make `test_imaplib` faster (GH-120050) (#120070)

The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

(cherry picked from commit 710cbea6604d27c7d59ae4953bf522b997a82cc7)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.12] gh-120039: Reduce expected timeout in test_siginterrupt_off (GH-120047) (...
Miss Islington (bot) [Tue, 4 Jun 2024 18:10:41 +0000 (20:10 +0200)] 
[3.12] gh-120039: Reduce expected timeout in test_siginterrupt_off (GH-120047) (#120061)

The process is expected to time out. In the refleak builds,
`support.SHORT_TIMEOUT` is often five minutes and we run the tests six
times, so test_signal was taking >30 minutes.
(cherry picked from commit d419d468ff4aaf6bc673354d0ee41b273d09dd3f)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.12] gh-89928: Fix integer conversion of device numbers (GH-31794) (GH-120054)
Serhiy Storchaka [Tue, 4 Jun 2024 17:12:13 +0000 (20:12 +0300)] 
[3.12] gh-89928: Fix integer conversion of device numbers (GH-31794) (GH-120054)

Fix os.major(), os.minor() and os.makedev().
Support device numbers larger than 2**63-1.
Support non-existent device number (NODEV).
(cherry picked from commit 7111d9605f9db7aa0b095bb8ece7ccc0b8115c3f)

17 months ago[3.12] gh-119819: Fix regression to allow logging configuration with multipr… (GH...
Miss Islington (bot) [Tue, 4 Jun 2024 12:41:02 +0000 (14:41 +0200)] 
[3.12] gh-119819: Fix regression to allow logging configuration with multipr… (GH-120030) (GH-120034)

(cherry picked from commit 99d945c0c006e3246ac00338e37c443c6e08fc5c)

17 months ago[3.12] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) (GH-120031)
Miss Islington (bot) [Tue, 4 Jun 2024 12:17:46 +0000 (14:17 +0200)] 
[3.12] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) (GH-120031)

(cherry picked from commit dce14bb2dce7887df40ae5c13b0d13e0dafceff7)

17 months ago[3.12] gh-119070: Update test_shebang_executable_extension to always use non-installe...
Miss Islington (bot) [Tue, 4 Jun 2024 11:27:58 +0000 (13:27 +0200)] 
[3.12] gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846) (GH-120016)

gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846)
(cherry picked from commit 5c48eb0cc6c3e84aafda0a734a05ecec14fc0ccf)

17 months ago[3.12] gh-111499: Fix PYTHONMALLOCSTATS at Python exit (#120021) (#120023)
Victor Stinner [Tue, 4 Jun 2024 09:58:49 +0000 (11:58 +0200)] 
[3.12] gh-111499: Fix PYTHONMALLOCSTATS at Python exit (#120021) (#120023)

gh-111499: Fix PYTHONMALLOCSTATS at Python exit (#120021)

Call _PyObject_DebugMallocStats() earlier in Py_FinalizeEx(), before
the interpreter is deleted.

(cherry picked from commit 5a1205b641df133932ed4c65b9a4ff5724e89963)

17 months ago[3.12] gh-119821: Fix refleak in LOAD_FROM_DICT_OR_GLOBALS (#119975)
Jelle Zijlstra [Mon, 3 Jun 2024 19:26:25 +0000 (12:26 -0700)] 
[3.12] gh-119821: Fix refleak in LOAD_FROM_DICT_OR_GLOBALS (#119975)

17 months ago[3.12] Use Cirrus M1 macOS runners for CI (GH-119979) (GH-119987)
Łukasz Langa [Mon, 3 Jun 2024 16:15:54 +0000 (12:15 -0400)] 
[3.12] Use Cirrus M1 macOS runners for CI (GH-119979) (GH-119987)

(cherry picked from commit 6acb32fac3511c1d5500cac66f1d6397dcdab835)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ee Durbin <ee@python.org>
17 months ago[3.12] GH-119054: Add "Reading and writing files" section to pathlib docs (GH-119524...
Barney Gale [Sun, 2 Jun 2024 20:14:29 +0000 (21:14 +0100)] 
[3.12] GH-119054: Add "Reading and writing files" section to pathlib docs (GH-119524) (#119955)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.

(cherry picked from commit bd6d4ed6454378e48dab06f50a9be0bae6baa3a2)

17 months ago[3.12] GH-119054: Add "Querying file type and status" section to pathlib docs (GH...
Barney Gale [Sun, 2 Jun 2024 19:38:00 +0000 (20:38 +0100)] 
[3.12] GH-119054: Add "Querying file type and status" section to pathlib docs (GH-119055) (#119952)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d63362302187e5cb838c9a7cd857181142e530)

17 months ago[3.12] Improve documentation for typing.get_type_hints (GH-119928) (#119944)
Miss Islington (bot) [Sun, 2 Jun 2024 15:21:47 +0000 (17:21 +0200)] 
[3.12] Improve documentation for typing.get_type_hints (GH-119928) (#119944)

- Explicit list of what it does that is different from
  "just return __annotations__"
- Remove reference to PEP 563; adding the future import doesn't
  do anything to type aliases, and in general it will never make
  get_type_hints() less likely to fail.
- Remove example, as the Annotated docs already have a similar
  example, and it's unbalanced to have one example about this
  one edge case but not about other behaviors of the function.

(cherry picked from commit aa9fe98e0649f0a151942914ef4e2810ca6126c2)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
17 months ago[3.12] gh-119016: Remove outdated sentences from the "classes" tutorial (GH-119130...
Miss Islington (bot) [Sat, 1 Jun 2024 21:26:07 +0000 (23:26 +0200)] 
[3.12] gh-119016: Remove outdated sentences from the "classes" tutorial (GH-119130) (#119926)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
17 months ago[3.12] gh-116145: Update macOS installer to Tcl/Tk 8.6.14 (GH-116151) (GH-119922)
Miss Islington (bot) [Sat, 1 Jun 2024 20:23:05 +0000 (22:23 +0200)] 
[3.12] gh-116145: Update macOS installer to Tcl/Tk 8.6.14 (GH-116151) (GH-119922)

(cherry picked from commit 4fa95c6ec392b9fc80ad720cc4a8bd2786fc2835)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
17 months ago[3.12] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (GH-119808)...
Barney Gale [Sat, 1 Jun 2024 19:39:35 +0000 (20:39 +0100)] 
[3.12] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (GH-119808) (#119919)

Implement `shutil._rmtree_safe_fd()` using a list as a stack to avoid emitting recursion errors on deeply nested trees.

`shutil._rmtree_unsafe()` was fixed in a150679f90.

(cherry picked from commit 53b1981fb0cda6c656069e992f172fc6aad7c99c)

17 months ago[3.12] Add unique() recipe to itertools docs (gh-119911) (gh-119917)
Miss Islington (bot) [Sat, 1 Jun 2024 17:06:18 +0000 (19:06 +0200)] 
[3.12] Add unique() recipe to itertools docs (gh-119911) (gh-119917)

17 months ago[3.12] gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to ensure...
Miss Islington (bot) [Sat, 1 Jun 2024 16:29:34 +0000 (18:29 +0200)] 
[3.12] gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to ensure that the given socket is in non-blocking mode (GH-119519) (#119913)

(cherry picked from commit cf3bba3f0671d2c9fee099e3ab0f78b98b176131)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
17 months ago[3.12] Revert "[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#1… (#119905)
Victor Stinner [Sat, 1 Jun 2024 15:08:07 +0000 (17:08 +0200)] 
[3.12] Revert "[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#1… (#119905)

Revert "[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#119505)"

This reverts commit 078da88ad19e8f7474b6943edd39b7e61511bd20.

The change modified how negative values, like termios.TIOCSWINSZ, was
treated and is actually backward incompatible.

17 months ago[3.12] gh-119821: Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS (#119822...
Jelle Zijlstra [Sat, 1 Jun 2024 04:56:38 +0000 (21:56 -0700)] 
[3.12] gh-119821: Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS (#119822) (#119890)

The implementation basically copies LOAD_GLOBAL. Possibly it could be deduplicated,
but that seems like it may get hairy since the two operations have different operands.

This is important to fix in 3.14 for PEP 649, but it's a bug in earlier versions too,
and we should backport to 3.13 and 3.12 if possible.

(cherry picked from commit 80a4e3899420faaa012c82b4e82cdb6675a6a944)

17 months ago[3.12] contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119873)
Miss Islington (bot) [Fri, 31 May 2024 17:27:57 +0000 (19:27 +0200)] 
[3.12] contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119873)

Reported by Michael Kass on docs@
(cherry picked from commit f3fc800d5f17b144a752a262102b750bedcdaa14)

17 months ago[3.12] gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions...
Miss Islington (bot) [Fri, 31 May 2024 17:24:11 +0000 (19:24 +0200)] 
[3.12] gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364) (#119870)

gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364)
(cherry picked from commit 015b1fdd0ae03f94a5dfda051b020810d1c952dd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
17 months ago[3.12] gh-119585: Fix crash involving `PyGILState_Release()` and `PyThreadState_Clear...
Sam Gross [Fri, 31 May 2024 15:42:09 +0000 (11:42 -0400)] 
[3.12] gh-119585: Fix crash involving `PyGILState_Release()` and `PyThreadState_Clear()` (GH-119753) (#119861)

Make sure that `gilstate_counter` is not zero in when calling
`PyThreadState_Clear()`. A destructor called from `PyThreadState_Clear()` may
call back into `PyGILState_Ensure()` and `PyGILState_Release()`. If
`gilstate_counter` is zero, it will try to create a new thread state before
the current active thread state is destroyed, leading to an assertion failure
or crash.
(cherry picked from commit bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c)

17 months ago[3.12] gh-103194: Fix Tkinter’s Tcl value type handling for Tcl 8.7/9.0 (GH-103846...
Serhiy Storchaka [Fri, 31 May 2024 09:15:53 +0000 (12:15 +0300)] 
[3.12] gh-103194: Fix Tkinter’s Tcl value type handling for Tcl 8.7/9.0 (GH-103846) (GH-119831)

Some of standard Tcl types were renamed, removed, or no longer
registered in Tcl 8.7/9.0. This change fixes automatic conversion of Tcl
values to Python values to avoid returning a Tcl_Obj where the primary
Python types (int, bool, str, bytes) were returned in older Tcl.
(cherry picked from commit 94e9585e99abc2d060cedc77b3c03e06b4a0a9c4)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
17 months ago[3.12] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (GH-119807)
Miss Islington (bot) [Thu, 30 May 2024 21:23:38 +0000 (23:23 +0200)] 
[3.12] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (GH-119807)

(cherry picked from commit 9732ed5ca94cd8fe9ca2fc7ba5a42dfa2b7791ea)

Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.12] gh-109218: Improve documentation for the complex() constructor (GH-119687...
Serhiy Storchaka [Thu, 30 May 2024 20:52:44 +0000 (23:52 +0300)] 
[3.12] gh-109218: Improve documentation for the complex() constructor (GH-119687) (ПР-119805)

* Remove the equivalence with real+imag*1j which can be incorrect in corner
  cases (non-finite numbers, the sign of zeroes).
* Separately document the three roles of the constructor: parsing a string,
  converting a number, and constructing a complex from components.
* Document positional-only parameters of complex(), float(), int() and bool()
  as positional-only.
* Add examples for complex() and int().
* Specify the grammar of the string for complex().
* Improve the grammar of the string for float().
* Describe more explicitly the behavior when real and/or imag arguments are
  complex numbers. (This will be deprecated in future.)
(cherry picked from commit ec1ba264607b2b7b98d2602f5536a1d02981efc6)

17 months ago[3.12] gh-109218: Refactor tests for the complex() constructor (GH-119635) (GH-119796)
Miss Islington (bot) [Thu, 30 May 2024 18:05:38 +0000 (20:05 +0200)] 
[3.12] gh-109218: Refactor tests for the complex() constructor (GH-119635) (GH-119796)

* Share common classes.
* Use exactly representable floats and exact tests.
* Check the sign of zero components.
* Remove duplicated tests (mostly left after merging int and long).
* Reorder tests in more consistent way.
* Test more error messages.
* Add tests for missed cases.
(cherry picked from commit bf098d4157158e1e4b2ea78aba4ac82d72e24cff)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.12] gh-119779: Fix pyporting howto docs (GH-119785) (#119789)
Miss Islington (bot) [Thu, 30 May 2024 15:57:36 +0000 (17:57 +0200)] 
[3.12] gh-119779: Fix pyporting howto docs (GH-119785) (#119789)

gh-119779: Fix pyporting howto docs (GH-119785)
(cherry picked from commit 6fb191be15fd49da10506de29b6393ffdf59b894)

Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
17 months agogh-119690: Adds Unicode support for named pipes in _winapi (GH-119717)
Steve Dower [Thu, 30 May 2024 14:40:23 +0000 (15:40 +0100)] 
gh-119690: Adds Unicode support for named pipes in _winapi (GH-119717)

Also backports a minor improvement to test_audit.

17 months ago[3.12] gh-118055: Update the finder glossary entry (GH-118278) (GH-119774)
Miss Islington (bot) [Thu, 30 May 2024 08:57:36 +0000 (10:57 +0200)] 
[3.12] gh-118055: Update the finder glossary entry (GH-118278) (GH-119774)

gh-118055: Update the finder glossary entry (GH-118278)
(cherry picked from commit db009348b4b7a4b0aec39472ea074c1b5feeba9b)

Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com>
17 months ago[3.12] subprocess docs: Fix semantically important typo (GH-119752) (#119758)
Miss Islington (bot) [Thu, 30 May 2024 07:50:23 +0000 (09:50 +0200)] 
[3.12] subprocess docs: Fix semantically important typo (GH-119752) (#119758)

subprocess docs: Fix semantically important typo (GH-119752)

GH-25416 accidentally replaced a reference to the *stderr* argument of
`subprocess.run` with a reference to the *stdin* argument.  *stdin* is
not affected by the `check_output` option.
(cherry picked from commit 2cc3502f98bb9aea386ab55443fc077ddcdde91d)

Co-authored-by: Zachary Ware <zach@python.org>
17 months ago[3.12] GH-89727: Fix FD leak on `os.fwalk()` generator finalization. (GH-119766)...
Miss Islington (bot) [Thu, 30 May 2024 04:30:37 +0000 (06:30 +0200)] 
[3.12] GH-89727: Fix FD leak on `os.fwalk()` generator finalization. (GH-119766) (#119768)

GH-89727: Fix FD leak on `os.fwalk()` generator finalization. (GH-119766)

Follow-up to 3c890b50. Ensure we `os.close()` open file descriptors when
the `os.fwalk()` generator is finalized.
(cherry picked from commit a5fef800d31648d19cecc240a2fa0dc71371753e)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
17 months ago[3.12] GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638) (#119765)
Miss Islington (bot) [Thu, 30 May 2024 03:32:14 +0000 (05:32 +0200)] 
[3.12] GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638) (#119765)

GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638)

Implement `os.fwalk()` using a list as a stack to avoid emitting recursion
errors on deeply nested trees.
(cherry picked from commit 3c890b503c740767d0eb9a0e74b47f17a1e69452)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
17 months ago[3.12] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and...
Miss Islington (bot) [Thu, 30 May 2024 03:24:50 +0000 (05:24 +0200)] 
[3.12] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480) (#119761)

gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480)
(cherry picked from commit bf4ff3ad2e362801e87c85fffd9e140b774cef26)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
17 months ago[3.12] GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (GH...
Barney Gale [Wed, 29 May 2024 20:53:08 +0000 (21:53 +0100)] 
[3.12] GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (GH-119634) (#119749)

* GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (#119634)

Make `shutil._rmtree_unsafe()` call `os.walk()`, which is implemented
without recursion.

`shutil._rmtree_safe_fd()` is not affected and can still raise a recursion
error.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit a150679f90c6e3f017bd75cac3b8f727063cc4aa)

17 months agogh-119070: Avoid test crash due to Unicode in stderr output (GH-119747)
Steve Dower [Wed, 29 May 2024 20:51:30 +0000 (21:51 +0100)] 
gh-119070: Avoid test crash due to Unicode in stderr output (GH-119747)

17 months agogh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426)
Steve Dower [Wed, 29 May 2024 19:12:55 +0000 (20:12 +0100)] 
gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426)

17 months ago[3.12] gh-119704: Fix reference leak in the ``Python/Python-tokenize.c`` (GH-119705...
Miss Islington (bot) [Wed, 29 May 2024 07:18:04 +0000 (09:18 +0200)] 
[3.12] gh-119704: Fix reference leak in the ``Python/Python-tokenize.c`` (GH-119705) (#119708)

17 months ago[3.12] gh-119538: Add missing expat build dependencies (GH-119647) (#119686)
Miss Islington (bot) [Tue, 28 May 2024 22:10:49 +0000 (00:10 +0200)] 
[3.12] gh-119538: Add missing expat build dependencies (GH-119647) (#119686)

xmltok_impl.c and xmltok_ns.c are _included_ in xmltok.c by the C
pre-processor.

(cherry picked from commit 606be663622c6784aed4ffa55b877adbd6fe8e54)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
17 months ago[3.12] gh-119118: Fix performance regression in tokenize module (GH-119615) (#119683)
Miss Islington (bot) [Tue, 28 May 2024 20:49:02 +0000 (22:49 +0200)] 
[3.12] gh-119118: Fix performance regression in tokenize module (GH-119615) (#119683)

- Cache line object to avoid creating a Unicode object
  for all of the tokens in the same line.
- Speed up byte offset to column offset conversion by using the
  smallest buffer possible to measure the difference.

(cherry picked from commit d87b0151062e36e67f9e42e1595fba5bf23a485c)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
17 months ago[3.12] gh-119011: `type.__type_params__` now return an empty tuple (GH-119296) (...
Jelle Zijlstra [Tue, 28 May 2024 19:54:47 +0000 (12:54 -0700)] 
[3.12] gh-119011: `type.__type_params__` now return an empty tuple (GH-119296) (#119681)

(cherry picked from commit 6b240c2308a044e38623900ccb8fa58c3549d4ae)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
17 months ago[3.12] gh-119581: Add a test of InitVar with name shadowing (GH-119582) (#119673)
Miss Islington (bot) [Tue, 28 May 2024 17:42:01 +0000 (19:42 +0200)] 
[3.12] gh-119581: Add a test of InitVar with name shadowing (GH-119582) (#119673)

gh-119581: Add a test of InitVar with name shadowing (GH-119582)
(cherry picked from commit 6ec371223dff4da7719039e271f35a16a5b861c6)

Co-authored-by: Steven Troxler <steven.troxler@gmail.com>
17 months ago[3.12] Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409...
Miss Islington (bot) [Tue, 28 May 2024 14:55:43 +0000 (16:55 +0200)] 
[3.12] Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409) (GH-119482)

Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409)
(cherry picked from commit ffa24aab107b5bc3c6ad31a6a245c226bf24b208)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
17 months ago[3.12] [doc] Clarify the nature of the root logger in the `logging` documentation...
Miss Islington (bot) [Tue, 28 May 2024 14:04:19 +0000 (16:04 +0200)] 
[3.12] [doc] Clarify the nature of the root logger in the `logging` documentation (GH-119440) (GH-119652)

(cherry picked from commit b407ad38fb93585332c370b8fa56905fb238cdfd)

17 months ago[3.12] Re-order imports to align with zipp 3.18.2 (GH-119587) (#119590)
Miss Islington (bot) [Tue, 28 May 2024 12:49:38 +0000 (14:49 +0200)] 
[3.12] Re-order imports to align with zipp 3.18.2 (GH-119587) (#119590)

Re-order imports to align with zipp 3.18.2 (GH-119587)
(cherry picked from commit 5482a939ac18f4cd861d212c759960af8fa2b19d)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
17 months agogh-118263: Add additional arguments to path_t (Argument Clinic type) in posixmodule...
Nice Zombies [Tue, 28 May 2024 10:13:01 +0000 (12:13 +0200)] 
gh-118263: Add additional arguments to path_t (Argument Clinic type) in posixmodule (GH-119608)

17 months ago[3.12] gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861...
Miss Islington (bot) [Tue, 28 May 2024 09:50:26 +0000 (11:50 +0200)] 
[3.12] gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861) (#119648)

gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861)
(cherry picked from commit 669175bf8edc2c02d48401bac0e4c7d99a33f15b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
17 months ago[3.12] Misc cleanups and wording improvements for the itertools docs (gh-119631)
Raymond Hettinger [Mon, 27 May 2024 18:43:08 +0000 (13:43 -0500)] 
[3.12] Misc cleanups and wording improvements for the itertools docs (gh-119631)

17 months ago[3.12] gh-119580: Improve version added section for convenience variable (GH-119583...
Miss Islington (bot) [Mon, 27 May 2024 18:04:01 +0000 (20:04 +0200)] 
[3.12] gh-119580: Improve version added section for convenience variable (GH-119583) (#119625)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
17 months ago[3.12] Docs: Only install sphinx-autobuild for `make htmllive` (GH-119607) (#119622)
Miss Islington (bot) [Mon, 27 May 2024 17:35:57 +0000 (19:35 +0200)] 
[3.12] Docs: Only install sphinx-autobuild for `make htmllive` (GH-119607) (#119622)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months ago[3.12] gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475...
Miss Islington (bot) [Mon, 27 May 2024 12:22:23 +0000 (14:22 +0200)] 
[3.12] gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475) (#119603)

gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475)
(cherry picked from commit 3b26cd8ca0e6c65e4b61effea9aa44d06e926797)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
17 months ago[3.12] Fix typos in HISTORY documentation (GH-119453) (#119598)
Miss Islington (bot) [Mon, 27 May 2024 08:04:05 +0000 (10:04 +0200)] 
[3.12] Fix typos in HISTORY documentation (GH-119453) (#119598)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
17 months ago[3.12] docs: fix a few typos identified by codespell (GH-119516) (#119571)
Hugo van Kemenade [Sun, 26 May 2024 08:15:57 +0000 (11:15 +0300)] 
[3.12] docs: fix a few typos identified by codespell (GH-119516) (#119571)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
17 months ago[3.12] FAQ: Add reference to Python version numbering scheme (GH-119225) (#119545)
Miss Islington (bot) [Sat, 25 May 2024 14:19:35 +0000 (16:19 +0200)] 
[3.12] FAQ: Add reference to Python version numbering scheme (GH-119225) (#119545)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months ago[3.12] Misc improvements to the docs for itertools (gh-119532)
Raymond Hettinger [Fri, 24 May 2024 22:35:38 +0000 (17:35 -0500)] 
[3.12] Misc improvements to the docs for itertools (gh-119532)

17 months ago[3.12] Regen ``Doc/requirements-oldest-sphinx.txt`` (GH-119520) (#119523)
Miss Islington (bot) [Fri, 24 May 2024 20:01:53 +0000 (22:01 +0200)] 
[3.12] Regen ``Doc/requirements-oldest-sphinx.txt`` (GH-119520) (#119523)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
17 months ago[3.12] GH-119496: accept UTF-8 BOM in .pth files (GH-119509)
Miss Islington (bot) [Fri, 24 May 2024 14:52:09 +0000 (16:52 +0200)] 
[3.12] GH-119496: accept UTF-8 BOM in .pth files (GH-119509)

`Out-File -Encoding utf8` and similar commands in Windows Powershell 5.1 emit
UTF-8 with a BOM marker, which the regular `utf-8` codec decodes incorrectly.

`utf-8-sig` accepts a BOM, but also works correctly without one.

This change also makes .pth files match the way Python source files are handled.

(cherry picked from commit bf5b6467f8cc06759f3396ab1a8ad64fe7d1db2e)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
17 months ago[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#119505)
Victor Stinner [Fri, 24 May 2024 12:53:41 +0000 (14:53 +0200)] 
[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#119505)

gh-69214: Fix fcntl.ioctl() request type (#119498)

Use an 'unsigned long' instead of an 'unsigned int' for the request
parameter of fcntl.ioctl() to support requests larger than UINT_MAX.

(cherry picked from commit 92fab3356f4c61d4c73606e4fae705c6d8f6213b)

17 months ago[3.12] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119487)
Miss Islington (bot) [Fri, 24 May 2024 02:12:23 +0000 (04:12 +0200)] 
[3.12] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119487)

gh-119317: findall instead of traverse for docutils nodes (GH-119319)
(cherry picked from commit 0867bce45768454ee31bee95ca33fdc2c9d8b0fa)

Co-authored-by: Carlos Meza <hire@carlosmeza.com>
17 months ago[3.12] [3.13] gh-119461: Fix ThreadedVSOCKSocketStreamTest (GH-119465) (GH-119479...
Miss Islington (bot) [Thu, 23 May 2024 23:23:55 +0000 (01:23 +0200)] 
[3.12] [3.13] gh-119461: Fix ThreadedVSOCKSocketStreamTest (GH-119465) (GH-119479) (#119484)

[3.13] gh-119461: Fix ThreadedVSOCKSocketStreamTest (GH-119465) (GH-119479)

gh-119461: Fix ThreadedVSOCKSocketStreamTest (GH-119465)

Fix ThreadedVSOCKSocketStreamTest: if get_cid() returns the host
address or the "any" address, use the local communication address
(loopback): VMADDR_CID_LOCAL.

On Linux 6.9, apparently, the /dev/vsock device is now available but
get_cid() returns VMADDR_CID_ANY (-1).

(cherry picked from commit c750061047ee520d8299334df4b112fd983d7e48)

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

Co-authored-by: Victor Stinner <vstinner@python.org>
17 months ago[3.12] gh-90562: Mention slots pitfall in dataclass docs (GH-107391) (#119351)
Miss Islington (bot) [Thu, 23 May 2024 06:16:23 +0000 (08:16 +0200)] 
[3.12] gh-90562: Mention slots pitfall in dataclass docs (GH-107391) (#119351)

Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months ago[3.12] gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across Interpreters...
Eric Snow [Wed, 22 May 2024 22:26:58 +0000 (18:26 -0400)] 
[3.12] gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across Interpreters (gh-119331) (gh-119425)

_PyArg_Parser holds static global data generated for modules by Argument Clinic.  The _PyArg_Parser.kwtuple field is a tuple object, even though it's stored within a static global.  In some cases the tuple is statically allocated and thus it's okay that it gets shared by multiple interpreters.  However, in other cases the tuple is set lazily, allocated from the heap using the active interprepreter at the point the tuple is needed.

This is a problem once that interpreter is destroyed since _PyArg_Parser.kwtuple becomes at dangling pointer, leading to crashes.  It isn't a problem if the tuple is allocated under the main interpreter, since its lifetime is bound to the lifetime of the runtime.  The solution here is to temporarily switch to the main interpreter.  The alternative would be to always statically allocate the tuple.

This change also fixes a bug where only the most recent parser was added to the global linked list.

(cherry picked from commit 81865002aee8eaaeb3c7e402f86183afa6de77bf)

17 months ago[3.12] gh-70795: Rework RLock documentation (GH-103853) (#119437)
Miss Islington (bot) [Wed, 22 May 2024 20:21:42 +0000 (22:21 +0200)] 
[3.12] gh-70795: Rework RLock documentation (GH-103853) (#119437)

gh-70795: Rework RLock documentation (GH-103853)

Attempted to simultaneously reduce verbosity, while more descriptively
describing behavior.

Fix links (RLock acquire/release previously linking to Lock
acquire/release, seems like bad copy pasta).

Add a seealso for with-locks.

Switch section to use bullet points.

---------

(cherry picked from commit 2fbea81d646688cf438be1dc0be82112a9ae4325)

Co-authored-by: uıɐɾ ʞ ʇɐɯɐs <_@skj.io>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
17 months agogh-118507 : Refactor ntpath native functions (gh-119381)
Nice Zombies [Wed, 22 May 2024 14:49:26 +0000 (16:49 +0200)] 
gh-118507 : Refactor ntpath native functions (gh-119381)

This refactoring will make future backports easier without changing behaviours,
apart from correcting a bug when passing a pipe to `ntpath.isfile`.

17 months ago[3.12] gh-118643: Fix AttributeError in the email module (GH-119099) (GH-119390)
Miss Islington (bot) [Wed, 22 May 2024 11:08:05 +0000 (13:08 +0200)] 
[3.12] gh-118643: Fix AttributeError in the email module (GH-119099) (GH-119390)

Fix regression introduced in gh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in gh-100884.
(cherry picked from commit 858b9e85fcdd495947c9e892ce6e3734652c48f2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.12] Fix version number in use_load_tests deprecation reference (GH-119151) (GH...
Miss Islington (bot) [Wed, 22 May 2024 09:49:41 +0000 (11:49 +0200)] 
[3.12] Fix version number in use_load_tests deprecation reference (GH-119151) (GH-119387)

Deprecation took place in d78742a260ba09e53c844de7b1fd11a11c674945 (3.5)
(cherry picked from commit aee8f03abbebfb76357f459dfb297026862e3c0b)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
17 months ago[3.12] Clarify that dklen is expected in bytes for the hashlib functions (GH-106624...
Miss Islington (bot) [Wed, 22 May 2024 08:58:03 +0000 (10:58 +0200)] 
[3.12] Clarify that dklen is expected in bytes for the hashlib functions (GH-106624) (GH-119384)

(cherry picked from commit 5adf78f546a5dc3f5b8eeaa209a2e8437ae96ac8)

Co-authored-by: Mathijs Mortimer <thiezn@users.noreply.github.com>
17 months ago[3.12] gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrin...
Miss Islington (bot) [Wed, 22 May 2024 01:22:05 +0000 (03:22 +0200)] 
[3.12] gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings (GH-119330) (#119371)

(cherry picked from commit 0e3c8cda1f04c983994e76aea93600dbb4714832)

Co-authored-by: Landon Wood <landon@elkrange.com>
17 months ago[3.12] gh-119189: Add yet more tests for mixed Fraction arithmetic (GH-119298) (GH...
Miss Islington (bot) [Tue, 21 May 2024 22:49:16 +0000 (00:49 +0200)] 
[3.12] gh-119189: Add yet more tests for mixed Fraction arithmetic (GH-119298) (GH-119347)

(cherry picked from commit 10b1bd926a5546e0f5cbd1a47d00dc5ff84f1979)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.12] Fix typos in documentation (GH-119295) (#119338)
Miss Islington (bot) [Tue, 21 May 2024 22:33:32 +0000 (00:33 +0200)] 
[3.12] Fix typos in documentation (GH-119295) (#119338)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
17 months ago[3.12] gh-110383: Document `socket.makefile()` accepts combined modes (GH-119150...
Miss Islington (bot) [Tue, 21 May 2024 18:52:56 +0000 (20:52 +0200)] 
[3.12] gh-110383: Document `socket.makefile()` accepts combined modes (GH-119150) (#119325)

The supported mode values are 'r', 'w', and 'b', or a combination of those.
(cherry picked from commit 62a29be5bb01c2d0f72d8f9b1b5539816e65310c)

Co-authored-by: Daniel Williams <dann0a@gmail.com>
17 months ago[3.12] GH-110383: Improve Tutorial for Input Ouput (GH-119230) (GH-119327)
Miss Islington (bot) [Tue, 21 May 2024 17:54:20 +0000 (19:54 +0200)] 
[3.12] GH-110383: Improve Tutorial for Input Ouput (GH-119230) (GH-119327)

GH-110383: Improve Tutorial for Input Ouput (GH-119230)

(cherry picked from commit 9db2fd7edaa9d03e8c649c3bb0e8d963233cde22)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
17 months ago[3.12] Docs: Ensure no warnings are found in the NEWS file before a given line number...
Hugo van Kemenade [Tue, 21 May 2024 14:40:16 +0000 (10:40 -0400)] 
[3.12] Docs: Ensure no warnings are found in the NEWS file before a given line number (GH-119221) (#119266)

17 months ago[3.12] gh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows...
Miss Islington (bot) [Tue, 21 May 2024 04:09:30 +0000 (06:09 +0200)] 
[3.12] gh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows blurry (GH-119175) (#119290)

gh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows blurry (GH-119175)

------

(cherry picked from commit 538ed5e4818aa0d0aa759634e8bfa23e317434a1)

Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>