Commit graph

119362 commits

Author SHA1 Message Date
Miss Islington (bot)
a9f2daf1ab
[3.12] GH-115983: skip building shared modules for testing under WASI (GH-116528) (#120316)
GH-115983: skip building shared modules for testing under WASI (GH-116528)
(cherry picked from commit 8c094c3095)

Co-authored-by: Brett Cannon <brett@python.org>
2024-06-10 13:27:04 +00:00
Serhiy Storchaka
7545b7cb63
[3.12] bpo-24766: doc= argument to subclasses of property not handled correctly (GH-2487) (GH-120312)
(cherry picked from commit 4829522b8d)

Co-authored-by: E. M. Bray <erik.bray@lri.fr>
2024-06-10 10:32:45 +00:00
Miss Islington (bot)
ff980e3f7a
[3.12] gh-120155: Fix Coverity issue in zoneinfo load_data() (GH-120232) (#120311)
gh-120155: Fix Coverity issue in zoneinfo load_data() (GH-120232)

Declare the 'rv' varaible at the top of the load_data() function to
make sure that it's initialized before the first 'goto error' which
uses 'rv' (return rv).

Fix the Coverity issue:

Error: UNINIT (CWE-457):
Python-3.12.2/Modules/_zoneinfo.c:1233:5: skipped_decl: Jumping over declaration of ""rv"".
Python-3.12.2/Modules/_zoneinfo.c:1284:5: uninit_use: Using uninitialized value ""rv"".
  1282|       }
  1283|
  1284|->     return rv;
  1285|   }
  1286|
(cherry picked from commit b90bd3e5bb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-10 10:12:25 +00:00
Miss Islington (bot)
82c93ea55a
[3.12] gh-119666: fix multiple class-scope comprehensions referencing __class__ (GH-120295) (#120300) 2024-06-10 00:37:15 -04:00
Miss Islington (bot)
b134f47574
[3.12] gh-120276: Fix incorrect email.header.Header maxlinelen default (GH-120277) (GH-120278)
(cherry picked from commit 7c016deae6)

Co-authored-by: Clinton <pygeek@users.noreply.github.com>
2024-06-08 17:26:01 +00:00
Miss Islington (bot)
58657d0dc1
[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 5d59b870ef)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-08 16:28:21 +00:00
Miss Islington (bot)
46e69f8c25
[3.12] gh-120244: Fix re.sub() reference leak (GH-120245) (GH-120265)
(cherry picked from commit 38a25e9560)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2024-06-08 14:10:44 +03:00
Serhiy Storchaka
88f67df22c
[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 2080425154)

Co-authored-by: Enrico Tröger <enrico.troeger@uvena.de>
2024-06-08 09:46:25 +00:00
Miss Islington (bot)
479655a27a
[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 95f4db88d5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-08 08:09:55 +00:00
Nikita Sobolev
1e7903d549
[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 10fb1b8f36)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-07 16:41:45 +00:00
Miss Islington (bot)
ec7c9d330f
[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 90b7540526)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-07 16:26:03 +00:00
Victor Stinner
b3b5278475
[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|   }
2024-06-07 17:17:06 +02:00
Miss Islington (bot)
9cdf696075
[3.12] gh-110383: Improve 'old string formatting' text in tutorial (GH-120219) (#120230)
(cherry picked from commit 225aab7f70)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-06-07 13:43:59 +00:00
Miss Islington (bot)
ac68d83fec
[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 d68a22e7a6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-07 14:30:50 +03:00
Miss Islington (bot)
ec139c8fae
[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 e079935282)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-07 10:18:42 +00:00
Miss Islington (bot)
501cd99c8e
[3.12] gh-110383: Clarify "non-integral" wording in pow() docs (GH-119688) (#120207)
(cherry picked from commit 6646a9da26)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
2024-06-07 09:53:55 +00:00
Victor Stinner
315611aac8
[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 47816f465e)

Co-authored-by: Michael Allwright <contact@allwright.io>
2024-06-07 09:49:54 +00:00
Miss Islington (bot)
3730f60f39
[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 d5ba4fc9bc)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
2024-06-07 09:35:08 +00:00
Miss Islington (bot)
92a38e9874
[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>
2024-06-07 10:42:37 +03:00
Barney Gale
59224b8fdc
[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 14e1506a6d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-06-07 01:24:44 +01:00
Thomas Wouters
0e7b4d25d4 Post 3.12.4 2024-06-07 00:25:42 +02:00
Thomas Wouters
8e8a4baf65 Python 3.12.4 2024-06-06 20:26:44 +02:00
Miss Islington (bot)
b03d71d0d8
[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 2d7ff6e0e7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-06 17:31:36 +00:00
Łukasz Langa
94eee78759
[3.12] gh-120111: Don't use cirrus M1 macOS runners on fork (GH-120116) (GH-120153)
(cherry picked from commit fd104dfcb8)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-06 14:30:20 +02:00
Alex Waygood
c5d1fbd4ce
[3.12] typing docs: fix indentation of TypedDict deprecation notice (#120124) 2024-06-05 10:37:24 -07:00
Miss Islington (bot)
376c734216
[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 5c02ea8bae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-05 12:02:52 +00:00
Miss Islington (bot)
8d199774cb
[3.12] gh-119819: Update logging configuration to support joinable multiproc… (GH-120090) (GH-120092)
(cherry picked from commit 983efcf15b)
2024-06-05 07:59:15 +01:00
Miss Islington (bot)
c46621bf33
[3.12] gh-120078: Fix struct_time attr typo tm_day -> tm_mday in Doc/library/time.rst (GH-120084)
(cherry picked from commit b6b0dcbfc0)

Co-authored-by: shurj0 <60540027+shurj0@users.noreply.github.com>
2024-06-05 00:29:28 +00:00
Jelle Zijlstra
dc40226ea1
[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 a9a74da4a0)
2024-06-04 19:55:45 +00:00
Miss Islington (bot)
008f9dd027
[3.12] gh-119819: Update test to skip if _multiprocessing is unavailable. (GH-120067) (GH-120071)
(cherry picked from commit 109e1082ea)
2024-06-04 20:43:52 +01:00
Miss Islington (bot)
210cd98f75
[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 710cbea660)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-04 19:25:17 +00:00
Miss Islington (bot)
c8c23aa86e
[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 d419d468ff)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-06-04 18:10:41 +00:00
Serhiy Storchaka
f98ec7574a
[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 7111d9605f)
2024-06-04 17:12:13 +00:00
Miss Islington (bot)
0e150c36de
[3.12] gh-119819: Fix regression to allow logging configuration with multipr… (GH-120030) (GH-120034)
(cherry picked from commit 99d945c0c0)
2024-06-04 13:41:02 +01:00
Miss Islington (bot)
fe68908c54
[3.12] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) (GH-120031)
(cherry picked from commit dce14bb2dc)
2024-06-04 13:17:46 +01:00
Miss Islington (bot)
b5c3394fce
[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 5c48eb0cc6)
2024-06-04 13:27:58 +02:00
Victor Stinner
e3e7607167
[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 5a1205b641)
2024-06-04 09:58:49 +00:00
Jelle Zijlstra
3bf7a5079c
[3.12] gh-119821: Fix refleak in LOAD_FROM_DICT_OR_GLOBALS (#119975) 2024-06-03 12:26:25 -07:00
Łukasz Langa
0480fd628a
[3.12] Use Cirrus M1 macOS runners for CI (GH-119979) (GH-119987)
(cherry picked from commit 6acb32fac3)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ee Durbin <ee@python.org>
2024-06-03 18:15:54 +02:00
Barney Gale
059be67b51
[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 bd6d4ed645)
2024-06-02 21:14:29 +01:00
Barney Gale
85020647c2
[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 81d6336230)
2024-06-02 20:38:00 +01:00
Miss Islington (bot)
c8de0ec7b9
[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 aa9fe98e06)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-02 15:21:47 +00:00
Miss Islington (bot)
e57a4a19a1
[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>
2024-06-01 21:26:07 +00:00
Miss Islington (bot)
46545d3244
[3.12] gh-116145: Update macOS installer to Tcl/Tk 8.6.14 (GH-116151) (GH-119922)
(cherry picked from commit 4fa95c6ec3)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2024-06-01 20:23:05 +00:00
Barney Gale
feb7870b46
[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 53b1981fb0)
2024-06-01 20:39:35 +01:00
Miss Islington (bot)
60393f5f14
[3.12] Add unique() recipe to itertools docs (gh-119911) (gh-119917) 2024-06-01 12:06:18 -05:00
Miss Islington (bot)
55f65156cb
[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 cf3bba3f06)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-01 16:29:34 +00:00
Victor Stinner
34a0e7a824
[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 078da88ad1.

The change modified how negative values, like termios.TIOCSWINSZ, was
treated and is actually backward incompatible.
2024-06-01 17:08:07 +02:00
Jelle Zijlstra
6d9677d78e
[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 80a4e38994)
2024-05-31 21:56:38 -07:00
Miss Islington (bot)
2f7fada580
[3.12] contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119873)
Reported by Michael Kass on docs@
(cherry picked from commit f3fc800d5f)
2024-05-31 17:27:57 +00:00