Commit graph

119510 commits

Author SHA1 Message Date
Miss Islington (bot)
0403cb41bf
[3.12] gh-120289: Add external timer in traverse of _lsprof.Profiler (GH-121998) (#122001)
gh-120289: Add external timer in traverse of _lsprof.Profiler (GH-121998)
(cherry picked from commit eaf094c09b)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-07-19 04:05:08 +00:00
Miss Islington (bot)
001584da03
[3.12] gh-120289: Disallow disable() and clear() in external timer to prevent use-after-free (GH-120297) (#121989)
gh-120289: Disallow disable() and clear() in external timer to prevent use-after-free (GH-120297)
(cherry picked from commit 1ab1778283)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-07-18 16:37:49 -07:00
Miss Islington (bot)
f88ec9a203
[3.12] gh-64308: Remove TestProgram from the unittest docs (GH-121675) (GH-121743)
gh-64308: Remove TestProgram from the unittest docs (GH-121675)
(cherry picked from commit f6f4022a35)

Co-authored-by: Jan Musílek <jan.musilek@nic.cz>
2024-07-18 15:27:01 +02:00
Miss Islington (bot)
1d915aaf5c
[3.12] gh-121874: Define audit-event open parameters consistently (GH-121883) (GH-121955)
Use same names for parameters to avoid triggering a race-condition in Sphinx
that causes non-deterministic output.
(cherry picked from commit 24cf867bed)

Co-authored-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2024-07-18 10:12:40 +00:00
Miss Islington (bot)
3279a4fbff
[3.12] gh-119698: fix a special case in symtable.Class.get_methods (GH-121802) (#121910)
(cherry picked from commit 6682d91678)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-17 22:32:29 +00:00
Miss Islington (bot)
a6516de08b
[3.12] gh-78889: Stop IDLE Shell freezes from sys.stdout.shell.xyz (GH-121876) (#121912)
gh-78889: Stop IDLE Shell freezes from sys.stdout.shell.xyz (GH-121876)

Problem occurred when attribute xyz could not be pickled.
Since this is not trivial to selectively fix, block all
attributes (other than 'width').  IDLE does not access them
and they are private implementation details.
(cherry picked from commit 58753f33e4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-07-17 14:03:54 +00:00
Serhiy Storchaka
874eed6cfe
[3.12] gh-121153: Fix some errors with use of _PyLong_CompactValue() (GH-121154)
* The result has type Py_ssize_t, not intptr_t.
* Type cast between unsigned and signed integer types should be explicit.
* Downcasting should be explicit.
* Fix integer overflow check in sum().
(cherry picked from commit 1801545)
2024-07-17 07:58:25 +00:00
sobolevn
6a19d22a19
[3.12] gh-121834: Improve complex C-API docs (GH-121835) (#121897)
* [3.12] gh-121834: Improve `complex` C-API docs (GH-121835)
(cherry picked from commit 72dccd6073)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-07-17 07:30:18 +00:00
Miss Islington (bot)
6e0ba93dfa
[3.12] gh-121842: Improve coverage of PyBytes_FromStringAndSize (GH-121843) (#121894)
gh-121842: Improve coverage of `PyBytes_FromStringAndSize` (GH-121843)
(cherry picked from commit f6c7d8d79c)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-07-17 07:16:25 +00:00
Miss Islington (bot)
a15ed5661f
[3.12] gh-121453: Update the Doc/templates/download.html download files size estimates and support download .texi format. (GH-121454) (#121891)
Co-authored-by: Wulian233 <1055917385@qq.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-07-17 06:27:55 +00:00
Miss Islington (bot)
7057d5e270
[3.12] gh-121871: Allow overriding docs build date with SOURCE_DATE_EPOCH (GH-121872) (#121887)
Co-authored-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2024-07-17 00:19:09 -06:00
Miss Islington (bot)
9d996b5205
[3.12] gh-121160: Add some tests for readline.set_history_length (GH-121326) (GH-121857)
(cherry picked from commit 263c7e611b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-07-16 17:16:00 +02:00
Sviatoslav Sydorenko (Святослав Сидоренко)
61d5e87892
[3.12] Fix using check_source flags as bool (GH-121848) (#121855) 2024-07-16 14:15:05 +00:00
Miss Islington (bot)
106d6456ca
[3.12] gh-121791: Check for NULL in MethodDescriptor2_new in _testcapi (GH-121792) (#121840)
gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (GH-121792)
(cherry picked from commit 8b6d475581)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-07-16 08:51:50 +00:00
Miss Islington (bot)
52df6c427c
[3.12] gh-85453: Fix 'timezone' vs. 'time zone' spelling issues in datetime.rst (GH-118449) (#121838)
(cherry picked from commit 1755df7b3b)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-07-16 08:23:40 +00:00
Miss Islington (bot)
d4f57ccc3a
[3.12] gh-119189: Fix the power operator for Fraction (GH-119242) (GH-119835)
When using the ** operator or pow() with Fraction as the base
and an exponent that is not rational, a float, or a complex, the
fraction is no longer converted to a float.
(cherry picked from commit b9965ef282)

Co-authored-by: Joshua Herman <30265+zitterbewegung@users.noreply.github.com>
2024-07-16 10:44:05 +03:00
Kirill Podoprigora
b455a5a55c
[3.12] gh-121657: Display correct error message for yield from outsid… (GH-121769)
(cherry picked from commit 178e44de8f)

Co-authored-by: Gregor <36135323+gege-hoho@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-15 21:26:10 +02:00
Miss Islington (bot)
d870f4130b
[3.12] Fix cache restoration for Hypothesis CI job (GH-121756) (#121760)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk@sydorenko.org.ua>
2024-07-14 05:46:18 -06:00
Miss Islington (bot)
7a4b55d602
[3.12] gh-121660: Fix ga_getitem by explicitly checking for NULL result (GH-121661) (#121762)
gh-121660: Fix `ga_getitem` by explicitly checking for `NULL` result (GH-121661)
(cherry picked from commit bb802db8cf)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-07-14 11:37:00 +00:00
Miss Islington (bot)
004758e3a4
[3.12] gh-121749: Fix discrepancy in docs for PyModule_AddObjectRef (GH-121750) (GH-121753)
(cherry picked from commit 26dfb27712)

Co-authored-by: Dominic H <dom@dominic.sk>
2024-07-14 12:31:58 +02:00
Miss Islington (bot)
863c0a3c51
[3.12] gh-120012: clarify the behaviour of multiprocessing.Queue.empty on closed queues. (GH-120102) (#120470)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-07-14 04:25:09 -06:00
Miss Islington (bot)
98340a0e25
[3.12] gh-121708: Improve test coverage for unittest.util (GH-121713) (GH-121737)
(cherry picked from commit 901ea411bf)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2024-07-14 10:58:55 +02:00
Miss Islington (bot)
b6cb209d5d
[3.12] gh-73159 Added clarifications in multiprocessing docs on that objects are pickled. (GH-121686) (#121728)
gh-73159 Added clarifications in multiprocessing docs on that objects are pickled. (GH-121686)

Added explicit comments about that objects are pickled when transmitted via multiprocessing queues and pipes.
(cherry picked from commit b5805892d5)

Co-authored-by: Ulrik Södergren <ulrik@digitalfotografen.se>
2024-07-13 20:13:52 +00:00
Miss Islington (bot)
20d145512a
[3.12] gh-120452: improve documentation about private name mangling (GH-120451) (#121716)
gh-120452: improve documentation about private name mangling (GH-120451)
(cherry picked from commit f4d6e45c1e)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-07-13 15:11:33 +00:00
Miss Islington (bot)
920625309c
[3.12] gh-120823: Fix doc for ftplib.FTP.retrbinary() (GH-121697) (GH-121706)
(cherry picked from commit 422855ad21)

Co-authored-by: mirelagrigoras <47386964+mirelagrigoras@users.noreply.github.com>
Co-authored-by: Mirela Andreea GRIGORAS <magrigoras@bitdefender.com>
2024-07-13 16:35:03 +02:00
Miss Islington (bot)
e32b752808
[3.12] gh-121671: Increase test coverage of ast.get_docstring (GH-121674) (GH-121690)
(cherry picked from commit 0a26aa5007)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2024-07-13 13:20:00 +00:00
Miss Islington (bot)
e4c8d89186
[3.12] gh-96765: Update ConfigParser.read() docs with multi-file read example (GH-121664) (GH-121688)
(cherry picked from commit fc21781175)

Co-authored-by: Timon Viola <44016238+timonviola@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-13 15:07:30 +02:00
Hugo van Kemenade
377ff9d584
[3.12] NEWS: Fix Sphinx warnings and increase threshold for new news nits (GH-121482) (#121514)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-07-13 12:54:50 +00:00
Miss Islington (bot)
32bbc36796
[3.12] gh-99242 Ignore error when running regression tests under certain conditions. (GH-121663) (GH-121670)
gh-99242 Ignore error when running regression tests under certain conditions. (GH-121663)
(cherry picked from commit 0759cecd9d)

Co-authored-by: Bas Bloemsaat <bas@bloemsaat.com>
Co-authored-by: Kevin Diem <kg.diem@gmail.com>
2024-07-13 12:24:17 +02:00
Eric Snow
0ec761a96a
[3.12] gh-117482: Fix Builtin Types Slot Wrappers (gh-121632)
When builtin static types are initialized for a subinterpreter, various "tp" slots have already been inherited (for the main interpreter).  This was interfering with the logic in add_operators() (in Objects/typeobject.c), causing a wrapper to get created when it shouldn't.  This change fixes that by preserving the original data from the static type struct and checking that.

(cherry picked from commit 5250a03133, AKA gh-121602)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-07-11 21:20:08 +00:00
sobolevn
5492f84c14
[3.12] gh-121615: Improve module.rst C-API docs with better error descriptions (GH-121616) (#121619)
(cherry picked from commit e6264b44dc)
2024-07-11 09:12:06 +00:00
Miss Islington (bot)
847c803c13
[3.12] gh-107851: Fix spurious failures in fcntl eintr tests (GH-121556) (#121586)
On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
(cherry picked from commit af9f6de6ea)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-10 14:54:45 +00:00
Miss Islington (bot)
06b2ba3831
[3.12] gh-121567: Improve slice C-API docs by mentioning exceptions (GH-121568) (#121579)
gh-121567: Improve `slice` C-API docs by mentioning exceptions (GH-121568)
(cherry picked from commit 84a5597b08)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-07-10 11:03:22 +00:00
Serhiy Storchaka
d87b03a88d
[3.12] Improve zipimport tests (GH-121535) (GH-121570) (GH-121576)
(cherry picked from commit 35c9399078)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 22a0bdbf9a)
2024-07-10 10:50:50 +00:00
Miss Islington (bot)
e47fec034e
[3.12] gh-121571: Do not use EnvironmentError in tests, use OSError instead (GH-121572) (#121575)
gh-121571: Do not use `EnvironmentError` in tests, use `OSError` instead (GH-121572)
(cherry picked from commit e2822360da)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-07-10 10:35:29 +00:00
Miss Islington (bot)
ac4276cc7a
[3.12] GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428) (#121566)
GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428)
(cherry picked from commit 9585a1a2a2)

Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
2024-07-10 08:06:41 +00:00
Miss Islington (bot)
e1a223431f
[3.12] gh-121533: Improve PyCell_[Get,Set] docs: mention the exceptions (GH-121534) (#121540)
gh-121533: Improve `PyCell_[Get,Set]` docs: mention the exceptions (GH-121534)
(cherry picked from commit 649d5b6d7b)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-09 19:03:12 +03:00
Miss Islington (bot)
f24f31656c
[3.12] gh-121333: Clarify what is the default executor for asyncio.run_in_executor (GH-121335) (#121525)
gh-121333: Clarify what is the default executor for asyncio.run_in_executor (GH-121335)
(cherry picked from commit facf9862da)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-07-09 15:06:40 +05:30
Sam Gross
4b04696527
[3.12] gh-121018: Fix typo in NEWS entry (GH-121510) (#121516)
(cherry picked from commit 218edaf0ff)
2024-07-08 17:19:29 -04:00
Miss Islington (bot)
da7f6745b8
[3.12] gh-121461: Fix os.path.normpath documentation indentation (GH-121466) (#121473)
gh-121461: Fix os.path.normpath documentation indentation (GH-121466)
(cherry picked from commit bf74db731b)

Co-authored-by: CBerJun <121291537+CBerJun@users.noreply.github.com>
2024-07-08 03:58:26 +00:00
Miss Islington (bot)
dcfe198867
[3.12] Regen `Doc/requirements-oldest-sphinx.txt` (GH-121437) (#121442)
Regen ``Doc/requirements-oldest-sphinx.txt`` (GH-121437)

regen dependencies
(cherry picked from commit 53e12025cd)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-07-06 18:11:28 +00:00
Miss Islington (bot)
e7cea781bd
[3.12] Update example of str.split, bytes.split (GH-121287) (#121416)
Update example of str.split, bytes.split (GH-121287)

In `{str,bytes}.strip(chars)`, multiple characters are not treated as a
prefix/suffix, but as individual characters. This may make users confuse
whether `split` has similar behavior.
Users may incorrectly expect that
`'Good morning, John.'.split(', .') == ['Good', 'morning', 'John']`

Adding a bit of clarification in the doc.

(cherry picked from commit 892e3a1b70)

Co-authored-by: Yuxin Wu <ppwwyyxxc@gmail.com>
Co-authored-by: Yuxin Wu <ppwwyyxx@users.noreply.github.com>
2024-07-05 13:23:00 -07:00
Miss Islington (bot)
9e542f9a46
[3.12] gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391) (#121393)
gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391)

The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
(cherry picked from commit db39bc42f9)

Co-authored-by: Josh Brobst <jbrobst@proton.me>
2024-07-05 06:59:06 +00:00
Miss Islington (bot)
de86aaa160
[3.12] gh-90437: Fix __main__.py documentation wording (GH-116309) (GH-121386)
gh-90437: Fix __main__.py documentation wording (GH-116309)
(cherry picked from commit cb688bab08)

Co-authored-by: Ali Tavallaie <tavallaie@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Frank Dana <ferdnyc@gmail.com>
2024-07-04 22:55:54 +00:00
Miss Islington (bot)
4bf4cc22c4
[3.12] gh-121084: Fix test_typing random leaks (GH-121360) (#121372)
gh-121084: Fix test_typing random leaks (GH-121360)

Clear typing ABC caches when running tests for refleaks (-R option):
call _abc_caches_clear() on typing abstract classes and their
subclasses.
(cherry picked from commit 5f660e8e2c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-04 18:00:08 +00:00
Miss Islington (bot)
8d3f44ad01
[3.12] gh-121355: Fix incorrect word in simple_stmts.rst (GH-121356) (#121363)
(cherry picked from commit 715ec630dd)

Co-authored-by: Jongbum Won <71166964+Wondaeng@users.noreply.github.com>
2024-07-04 13:43:31 +00:00
Miss Islington (bot)
81f575427e
[3.12] gh-117983: Defer import of threading for lazy module loading (GH-120233) (GH-121350)
gh-117983: Defer import of threading for lazy module loading (GH-120233)

As noted in gh-117983, the import importlib.util can be triggered at
interpreter startup under some circumstances, so adding threading makes
it a potentially obligatory load.
Lazy loading is not used in the stdlib, so this removes an unnecessary
load for the majority of users and slightly increases the cost of the
first lazily loaded module.

An obligatory threading load breaks gevent, which monkeypatches the
stdlib. Although unsupported, there doesn't seem to be an offsetting
benefit to breaking their use case.

For reference, here are benchmarks for the current main branch:

```
❯ hyperfine -w 8 './python -c "import importlib.util"'
Benchmark 1: ./python -c "import importlib.util"
  Time (mean ± σ):       9.7 ms ±   0.7 ms    [User: 7.7 ms, System: 1.8 ms]
  Range (min … max):     8.4 ms …  13.1 ms    313 runs
```

And with this patch:

```
❯ hyperfine -w 8 './python -c "import importlib.util"'
Benchmark 1: ./python -c "import importlib.util"
  Time (mean ± σ):       8.4 ms ±   0.7 ms    [User: 6.8 ms, System: 1.4 ms]
  Range (min … max):     7.2 ms …  11.7 ms    352 runs
```

Compare to:

```
❯ hyperfine -w 8 './python -c pass'
Benchmark 1: ./python -c pass
  Time (mean ± σ):       7.6 ms ±   0.6 ms    [User: 5.9 ms, System: 1.6 ms]
  Range (min … max):     6.7 ms …  11.3 ms    390 runs
```

This roughly halves the import time of importlib.util.
(cherry picked from commit 94f50f8ee6)

Co-authored-by: Chris Markiewicz <effigies@gmail.com>
2024-07-03 21:09:00 +00:00
Vinay Sajip
399e516d28
[3.12] gh-121035: Update PNG image for logging flow diagram. (GH-121323) (GH-121325)
(cherry picked from commit 26d24eeb90)
2024-07-03 13:02:02 +01:00
Vinay Sajip
10818024c8
[3.12] gh-121035: Further improve logging flow diagram with respect to dark/light modes. (GH-121265) (GH-121321)
(cherry picked from commit 089835469d)
2024-07-03 11:40:26 +01:00
Vinay Sajip
c3f393c8ad
[3.12] gh-121035: Improve logging flow diagram for dark/light modes. (GH-121254) (GH-121316)
(cherry picked from commit bfe0e4d769)
2024-07-03 10:48:34 +01:00