Commit graph

127947 commits

Author SHA1 Message Date
Miss Islington (bot)
d912e9a852
[3.14] gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) (GH-138268) (GH-138943)
(cherry picked from commit 537133d2b6)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-10-07 21:24:01 +02:00
Miss Islington (bot)
cde02ae782
[3.14] gh-139283: correctly handle size limit in cursor.fetchmany() (GH-139296) (GH-139441)
Passing a negative or zero size to `cursor.fetchmany()` made it fetch all rows
instead of none.

While this could be considered a security vulnerability, it was decided to treat
this issue as a regular bug as passing a non-sanitized *size* value in the first
place is not recommended.
(cherry picked from commit bc172ee830)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 21:23:08 +02:00
Miss Islington (bot)
cd8fc3aad3
[3.14] gh-95844: Move help_url code to a help module function (GH-129971) (#138484)
gh-95844: Move help_url code to a help module function (GH-129971)

---------
(cherry picked from commit 3b4cd88563)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-10-07 15:14:54 -04:00
Miss Islington (bot)
2f14d23013
[3.14] gh-139210: Fix use-after-free in xml.etree.ElementTree.iterparse() (GH-139211) (GH-139455)
(cherry picked from commit c86eb4d3ac)

Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 21:13:27 +02:00
Miss Islington (bot)
df739f33d3
[3.14] gh-131178: Add tests for site command-line interface (GH-133582) (GH-137832)
gh-131178: Add tests for `site` command-line interface  (GH-133582)
(cherry picked from commit 03f5519d77)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
2025-10-07 19:11:43 +00:00
Brett Cannon
c7326813f5
[3.14] Always use the latest dev container image in devcontainer.json (GH-138003)
This is a manual backport of 14319a99e5 .
2025-10-07 12:07:36 -07:00
Miss Islington (bot)
ffc67b3505
[3.14] gh-138004: Fix setting a thread name on OpenIndiana (GH-138017) (#138384)
gh-138004: Fix setting a thread name on OpenIndiana (GH-138017)

Encode Solaris/Illumos thread names to ASCII, since
OpenIndiana does not support non-ASCII names.

Add tests for setting non-ASCII name for the main thread.
(cherry picked from commit c19db1d2b8)

Co-authored-by: jadonduff <jadon_duff@icloud.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 20:58:35 +02:00
Stan Ulbrych
a893270c6d
[3.14] gh-71648: Optimize PNG files (GH-138842) (GH-138851)
* Only keep > 1 kb savings
(cherry picked from commit 2e8f64c931)
2025-10-07 20:52:12 +02:00
Miss Islington (bot)
4429554223
[3.14] gh-116738: make cProfile module thread-safe (GH-138229) (#138575)
gh-116738: make `cProfile` module thread-safe (GH-138229)
(cherry picked from commit 8554c0917e)

Co-authored-by: Alper <alperyoney@fb.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-07 18:51:22 +00:00
Gregory P. Smith
e51acb3fa6
[3.14] gh-134698: Hold a lock when the thread state is detached in ssl (GH-134724) (GH-137107)
* [3.14] gh-134698: Hold a lock when the thread state is detached in `ssl` (GH-134724)

Lock when the thread state is detached.
(cherry picked from commit e047a35b23)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>

* Only lock the SSL context, not the SSL socket.

This solves a deadlock when a socket is blocked while waiting on data,
which ended up causing a major regression in 3.13.6 (see gh-137583).

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-07 18:49:22 +00:00
Miss Islington (bot)
ed9c0c3cbe
[3.14] gh-137477: Fix inspect.getblock() for generator expressions (GH-137488) (#137993)
gh-137477: Fix inspect.getblock() for generator expressions (GH-137488)

This fixes also inspect.getsourcelines() and inspect.getsource().
(cherry picked from commit eae9d7de1c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 20:48:40 +02:00
Miss Islington (bot)
137c784fbf
[3.14] gh-136914: Fix support of cached functions and properties in DocTest's lineno computation (GH-136930) (#137616)
gh-136914: Fix support of cached functions and properties in DocTest's lineno computation (GH-136930)

Previously, DocTest's lineno of functions and methods decorated with
functools.cache(), functools.lru_cache() and functools.cached_property()
was not properly returned (None was returned) because the
computation relied on inspect.isfunction() which does not consider the
decorated result as a function.

We now use the more generic inspect.isroutine(), as elsewhere
in doctest's logic.

Also, added a special case for functools.cached_property().
(cherry picked from commit fece15d29f)

Co-authored-by: Denis Laxalde <denis@laxalde.org>
2025-10-07 20:48:10 +02:00
Miss Islington (bot)
ac147be05f
[3.14] gh-137440: Update comment in Python/hamt.c on importing for testing (GH-137441) (#137519)
gh-137440: Update comment in Python/hamt.c on importing for testing (GH-137441)

Switch from `_testcapi` to `_testinternalcapi`.
(cherry picked from commit 7ab68cd506)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-10-07 20:47:26 +02:00
Miss Islington (bot)
e09f33e5bf
[3.14] gh-137433: Fix deadlock with stop-the-world and daemon threads (gh-137735) (GH-138965)
There was a deadlock originally seen by Memray when a daemon thread
enabled or disabled profiling while the interpreter was shutting down.
I think this could also happen with garbage collection, but I haven't
seen that in practice.

The daemon thread could be hung while trying acquire the global rwmutex
that prevents overlapping global and per-interpreter stop-the-world events.
Since it already held the main interpreter's stop-the-world lock, it
also deadlocked the main thread, which is trying to perform interpreter
finalization.

Swap the order of lock acquisition to prevent this deadlock.
Additionally, refactor `_PyParkingLot_Park` so that the global buckets
hashtable is left in a clean state if the thread is hung in
`PyEval_AcquireThread`.

(cherry picked from commit 90fe3250f8)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-07 20:46:52 +02:00
Miss Islington (bot)
db8b943259
[3.14] GH-92266: Remove embedded tabs from `c-analyzer/cpython/_parser.py` (GH-137622) (#139718)
GH-92266: Remove embedded tabs from ``c-analyzer/cpython/_parser.py`` (GH-137622)
(cherry picked from commit 2212ae5557)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-07 18:45:49 +00:00
Miss Islington (bot)
c4be405fe9
[3.14] gh-137044: Support large limit values in getrlimit() and setrlimit() (GH-137338) (#137506)
gh-137044: Support large limit values in getrlimit() and setrlimit() (GH-137338)

* Return large limit values as positive integers instead of negative integers
  in resource.getrlimit().
* Accept large values and reject negative values (except RLIM_INFINITY)
  for limits in resource.setrlimit().
(cherry picked from commit baefaa6cba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 20:43:12 +02:00
Miss Islington (bot)
b414ad1043
[3.14] gh-81325: Support path-like objects with streaming TarFile (GH-137188) (#137365)
gh-81325: Support path-like objects with streaming TarFile (GH-137188)
(cherry picked from commit 3ec3d05345)

Co-authored-by: Alexander Urieles <aeurielesn@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-10-07 20:40:42 +02:00
Miss Islington (bot)
a868c6a70d
[3.14] gh-136520: Clarify docs for _pack_ & _align_ (GH-137036) (#137381)
gh-136520: Clarify docs for _pack_ & _align_ (GH-137036)

Move docs to the reference section & reduce the “tutorial” part to a quick intro & link.

Clarify what values are accepted.

Add macro/attribute equivalents.

Discourage _align_ values that aren't powers of two.
(cherry picked from commit 8943bb722f)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 20:39:57 +02:00
Miss Islington (bot)
14e8decde7
[3.14] gh-137273: Fix debug assertion failure in locale.setlocale() on Windows (GH-137300) (#137305)
gh-137273: Fix debug assertion failure in locale.setlocale() on Windows (GH-137300)

It happened when there were at least 16 characters after dot in the
locale name.
(cherry picked from commit 718e0c89ba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 20:39:13 +02:00
Erlend E. Aasland
ebbfd8f51a
[3.14] gh-138736: Fix sqlite3.Connection.blobopen 'row' parameter type and naming (#138738) (GH-139062)
(cherry picked from commit 8eb106240f)

Co-authored-by: chiri <chirizxc@proton.me>
2025-10-07 20:38:26 +02:00
Miss Islington (bot)
4bb33ff1c1
[3.14] gh-138779: Use the dev_t converter for st_rdev (GH-138780) (#138926)
gh-138779: Use the dev_t converter for st_rdev (GH-138780)

This allows to support device numbers larger than 2**63-1.
(cherry picked from commit 43013f72f0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 00:06:55 +05:30
Miss Islington (bot)
77b4ed2a37
[3.14] gh-138489: Add missing build-details.json step for building wasm (GH-139302) (GH-139557)
(cherry picked from commit db53ca30d7)

Signed-off-by: Ho Kim <ho.kim@ulagbulag.io>
Co-authored-by: Ho Kim <ho.kim@ulagbulag.io>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-07 20:35:38 +02:00
Miss Islington (bot)
29cffb1c02
[3.14] fix comment reference from man 7 signal to man 7 signal-safety (GH-138554) (#138594)
fix comment reference from man 7 signal to man 7 signal-safety (GH-138554)
(cherry picked from commit 2f5ace780b)


docs: fix comment reference from man 7 signal to man 7 signal-safety

Co-authored-by: mqudah <mohghq@gmail.com>
2025-10-07 19:34:15 +01:00
Miss Islington (bot)
0a517786af
[3.14] Bump mypy to 1.17.1 (GH-137542) (#137543)
Bump mypy to 1.17.1 (GH-137542)
(cherry picked from commit fb1cb00030)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-10-07 19:32:55 +01:00
Miss Islington (bot)
e2c901782d
[3.14] gh-138952: Document platform.machine() output casing inconsistency across platforms (GH-138962) (#139045)
gh-138952:  Document platform.machine() output casing inconsistency across platforms (GH-138962)
(cherry picked from commit dd15a2e11e)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-10-07 19:30:21 +01:00
Miss Islington (bot)
8db6615886
[3.14] gh-129368: In PyRun C API docs, clarify what a "start token" is (GH-129935) (#139042)
gh-129368: In PyRun C API docs, clarify what a "start token" is (GH-129935)
(cherry picked from commit e1eca8b308)

Co-authored-by: Rajhans Jadhao <rajhans.jadhao@gmail.com>
2025-10-07 19:30:05 +01:00
Serhiy Storchaka
700d425564
[3.14] Update the dbm documentation (GH-137919) (#137962)
Unify documentation for all backends, enumerate all not implemented mapping
methods, document particularities of implemented mapping methods.
(cherry picked from commit 8700404f86)
2025-10-07 19:26:00 +01:00
Serhiy Storchaka
b4d8faa221
[3.14] Update the availability info in the resource docs (#137939)
Update the availability info in the resource docs
2025-10-07 19:25:34 +01:00
Miss Islington (bot)
99c1d09016
[3.14] gh-130102: drop "require numeric arguments" from pow() docs (GH-137456) (#137536)
gh-130102: drop "require numeric arguments" from pow() docs (GH-137456)
(cherry picked from commit 37b5a0d671)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Senthil Kumaran <senthil@python.org>
2025-10-07 19:25:25 +01:00
Miss Islington (bot)
2de18f251a
[3.14] gh-138772: Add tests for Turtle.dot() signature (GH-138773) (GH-139326)
(cherry picked from commit 2462807b70)

Co-authored-by: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com>
2025-10-07 20:24:59 +02:00
Miss Islington (bot)
f899c849d4
[3.14] Remove unmatched closing parenthesis (GH-139082) (#139099)
Remove unmatched closing parenthesis (GH-139082)
(cherry picked from commit d22b25081b)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-10-07 19:24:17 +01:00
Miss Islington (bot)
08673d8a51
[3.14] gh-116738: add multi-threaded tests for resource module on free-threading builds (GH-138504) (#138793)
gh-116738: add multi-threaded tests for `resource` module on free-threading builds (GH-138504)
(cherry picked from commit 32e1e0699f)

Co-authored-by: Alper <alperyoney@fb.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-07 18:23:58 +00:00
Miss Islington (bot)
898be571a2
[3.14] Doc/library/zoneinfo.rst: Fix typo (GH-139190) (#139229)
(cherry picked from commit 4fb338d844)
2025-10-07 19:23:39 +01:00
Miss Islington (bot)
7c26f0fe4e
[3.14] gh-115119: Defer --with-system-libmpdec removal to 3.16 (GH-139318) (#139347)
gh-115119: Defer `--with-system-libmpdec` removal to 3.16 (GH-139318)
(cherry picked from commit 0aab07ccf7)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-10-07 19:23:18 +01:00
Miss Islington (bot)
6d94af4b98
[3.14] gh-139327: fix some reference leaks in sqlite3 error branches (GH-139328) (GH-139471)
(cherry picked from commit d0a3eff9d6)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-07 20:22:20 +02:00
Miss Islington (bot)
b4c3c0f4bf
[3.14] gh-139308: Skip test_special_chars_csh on NetBSD due to csh variable expansion issue (GH-139341) (GH-139559)
(cherry picked from commit ae6e7f572c)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
2025-10-07 20:20:57 +02:00
Miss Islington (bot)
3a880241c6
[3.14] Replace ambiguous word "pound" by "hash" in difflib docs (GH-139601) (GH-139616)
(cherry picked from commit dadbb2662a)

Co-authored-by: George Ogden <38294960+George-Ogden@users.noreply.github.com>
2025-10-07 20:19:50 +02:00
Miss Islington (bot)
9eee7fe717
[3.14] gh-135944: Add a "Runtime Components" Section to the Execution Model Docs (gh-135945) (#139509)
gh-135944: Add a "Runtime Components" Section to the Execution Model Docs (gh-135945)

The section provides a brief overview of the Python runtime's execution environment.  It is meant to be implementation agnostic,
(cherry picked from commit 46a1f0a9ff)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-10-07 19:19:42 +01:00
Miss Islington (bot)
85c45571ae
[3.14] gh-139646: fix typo in pickletools error message (GH-139647) (GH-139649)
(cherry picked from commit 36a6c2cdfa)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
2025-10-07 20:19:01 +02:00
Kumar Aditya
23cc8f789d
[3.14] gh-132551: make io.BytesIO thread safe (GH-132616) (#138551)
* [3.14] gh-132551: make `io.BytesIO` thread safe (GH-132616)
(cherry picked from commit 5dd3a3a58c)

Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-07 23:48:28 +05:30
Miss Islington (bot)
bf397e272c
[3.14] gh-133467: fix data race in type_set_name (GH-137302) (#137303)
gh-133467: fix data race in `type_set_name` (GH-137302)

Fix data race in `type_set_name` by assigning name under stop the world pause making it thread safe in free-threading.
(cherry picked from commit e99bc7fd44)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-07 18:18:23 +00:00
Miss Islington (bot)
070993b8ad
[3.14] gh-135729: Store reference to globals in Interpreter._decref (GH-139104) (GH-139112)
* gh-135729: Store reference to globals in `Interpreter._decref` (GH-139104)
(cherry picked from commit 571210b8f3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-07 14:18:15 -04:00
Miss Islington (bot)
5b64b59618
[3.14] gh-138854: Skip test_script_shadowing_stdlib_cwd_failure on AIX (GH-138855) (GH-139674)
(cherry picked from commit 171f787a29)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-10-07 20:16:55 +02:00
Miss Islington (bot)
f38a015552
[3.14] gh-75989: TarFile.extractall and TarFile.extract now overwrite symlinks when extracting hardlinks (GH-137316) (GH-139705)
(cherry picked from commit 481d5b5455)

Co-authored-by: Alexander Urieles <aeurielesn@users.noreply.github.com>
2025-10-07 20:16:20 +02:00
Miss Islington (bot)
d76a0ce4d0
[3.14] gh-137025: Include `python.worker.mjs` in the Emscripten Web Example (GH-137236) (#137272)
gh-137025: Include ``python.worker.mjs`` in the Emscripten Web Example (GH-137236)
(cherry picked from commit d5191ba99b)

Co-authored-by: adam j hartz <hz@mit.edu>
2025-10-07 19:15:33 +01:00
Sergey B Kirpichev
058c2770a2
[3.14] gh-122450: Expand documentation for `Rational and Fraction` (GH-136800) (#137363)
(cherry picked from commit b266fbc9ec)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 19:15:22 +01:00
Miss Islington (bot)
134586aaf3
[3.14] gh-137390: Add missing line continuation character in configure.ac (GH-137391) (#137394)
gh-137390: Add missing line continuation character in configure.ac (GH-137391)
(cherry picked from commit 001461a292)

Co-authored-by: markmcclain <markmcclain@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-10-07 19:15:05 +01:00
Miss Islington (bot)
94f57ac206
[3.14] gh-131885: Use positional-only markers for `max() and min()` (GH-131868) (#137656)
gh-131885: Use positional-only markers for ``max()`` and ``min()`` (GH-131868)
(cherry picked from commit dd079db4b9)

Co-authored-by: Evan Kohilas <ekohilas@users.noreply.github.com>
2025-10-07 19:14:40 +01:00
Miss Islington (bot)
572e4332cf
[3.14] gh-135629: rewrite language reference section on except* to improve clarity (GH-136150) (#139059)
gh-135629: rewrite language reference section on except* to improve clarity (GH-136150)
(cherry picked from commit a651ec9524)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-10-07 19:14:16 +01:00
Adam Turner
b1fa3414b3
[3.14] gh-105812: Use the `:deco:` role in place of manual decorator markup (GH-139619) (#139627)
(cherry picked from commit 3195da0b1a)
2025-10-07 19:13:35 +01:00