Commit graph

131563 commits

Author SHA1 Message Date
Miss Islington (bot)
5751633fac
[3.15] gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634) (GH-151100)
(cherry picked from commit 54de5475cd)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
2026-06-08 18:58:11 +00:00
Miss Islington (bot)
e795bd4be7
[3.15] gh-119949: Refactor test_exc() helper in test_format.py (GH-135452) (GH-150329)
Use assertRaisesRegex() context and fix
https://github.com/python/cpython/pull/119781#pullrequestreview-2088240959

(cherry picked from commit 0851700a9d)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-06-08 18:01:52 +00:00
Miss Islington (bot)
99979753b3
[3.15] gh-149816: Fix SNI callback callable race (GH-150018) (GH-150099)
(cherry picked from commit 8b31d08e62)

Co-authored-by: Kirill Ignatev <kiri11@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-06-08 21:01:31 +03:00
Miss Islington (bot)
199751ea6a
[3.15] gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087) (#151093)
gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087)

Remove references to server.handler_instance. This attribute has been
removed in 2022 by commit 3ae975f1ac.
(cherry picked from commit a9002349cb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-08 17:25:50 +00:00
Miss Islington (bot)
86e291e662
[3.15] gh-106318: Add examples to the str.isdigit() method docs (GH-144721)
(cherry picked from commit f051c68923)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-08 12:59:46 +00:00
Miss Islington (bot)
39f232219e
[3.15] gh-141623: Clarify operator function descriptions (GH-141846)
(cherry picked from commit bd5fa31c5f)

Co-authored-by: Doron Behar <doron.behar@gmail.com>
2026-06-08 12:21:22 +00:00
Miss Islington (bot)
0f964f4679
[3.15] Mention frozendict in object.__hash__() documentation (GH-148867) (#151077)
(cherry picked from commit e3762114e5)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
2026-06-08 11:47:55 +00:00
Miss Islington (bot)
1f3ee9248a
[3.15] gh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation (GH-151058)
(cherry picked from commit a1873300ee)

Co-authored-by: Christian Zinck <christian.zinck@gmail.com>
2026-06-08 10:32:43 +00:00
Miss Islington (bot)
550d9b62dd
[3.15] Docs: Fix missing colon in bisect example function (GH-151061) (GH-151067)
Docs: Fix missing colon in `bisect` example function (GH-151061)
(cherry picked from commit 16ede813eb)

Co-authored-by: Sergio López Gómez <sergiolopezgmz.dam@gmail.com>
2026-06-08 09:47:41 +00:00
Miss Islington (bot)
2185b73dff
[3.15] Update an error message in the 'Functional Programming HOWTO' (GH-151047)
(cherry picked from commit 81965c1683)

Co-authored-by: saber-bit <bryanventura0324@gmail.com>
2026-06-07 18:25:37 +01:00
Miss Islington (bot)
d3ca26983d
[3.15] gh-150599: Prevent bz2 decompressor reuse after errors (GH-150600)
(cherry picked from commit 5755d0f083)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-07 17:48:30 +01:00
Miss Islington (bot)
a642d1ab38
[3.15] gh-151021: Fix mmap empty searches past the end (GH-151023) (GH-151041)
(cherry picked from commit f2cab7b0cf)

Co-authored-by: esadomer <54475303+esadomer@users.noreply.github.com>
2026-06-07 13:27:26 +00:00
Miss Islington (bot)
d7aef33bd7
[3.15] gh-148954: Escape methodname in xmlrpc.client.dumps() to prevent XML injection (GH-148968) (GH-151033)
(cherry picked from commit ab930175e7)

Co-authored-by: Sanyam Kumat <124618873+sanyamk23@users.noreply.github.com>
2026-06-07 10:52:40 +03:00
Miss Islington (bot)
96073736a4
[3.15] gh-50948: IDLE: Warn if saving a file will overwrite a newer version (GH-17578) (GH-151026)
(cherry picked from commit 69851a6407)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Guilherme Polo <ggpolo@gmail.com>
Co-authored-by: Priya Pappachan <priyapappachan010@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-07 00:11:55 +03:00
Miss Islington (bot)
9352936b4e
[3.15] gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (GH-149612) (#151017)
This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.
(cherry picked from commit 884ac3e3ec)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-06-06 13:13:52 +00:00
Miss Islington (bot)
ad8a3d33be
[3.15] gh-150662: Stop unbounded memory growth in Tachyon --gecko collector (GH-150845) (#151000) 2026-06-06 13:45:53 +01:00
Miss Islington (bot)
ec9b40d740
[3.15] Doc: fix order of PyLong_FromUnsignedLongLong (GH-150937) (GH-151012)
(cherry picked from commit 4833b2031e)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2026-06-06 15:06:37 +03:00
Miss Islington (bot)
3c1c9ba285
[3.15] Delete mention encoding and errors for importlib.resources.path() (GH-143111) (GH-151014)
(cherry picked from commit fded34d6fe)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
2026-06-06 11:59:53 +00:00
Miss Islington (bot)
0a2e7af44b
[3.15] gh-149835: Use realpath() instead of abspath() in shutil.move() (GH-149986) (GH-151009)
(cherry picked from commit fab449bddb)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
2026-06-06 10:29:57 +00:00
Miss Islington (bot)
934ae3ed15
[3.15] gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing (GH-150275) (#150996)
gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing (GH-150275)
(cherry picked from commit 262625fa30)

Co-authored-by: Grant Herman <grantlouisherman041@gmail.com>
2026-06-06 03:46:55 +01:00
Miss Islington (bot)
4a3d6f9793
[3.15] Use time.monotonic in OrderedDict LRU cache example (GH-150986) (#150991)
Use `time.monotonic` in OrderedDict LRU cache example (GH-150986)
(cherry picked from commit ea4c85552b)

Co-authored-by: Ilya Nikolaev <65247719+ilya-nikolaev@users.noreply.github.com>
2026-06-06 01:59:30 +03:00
Miss Islington (bot)
d0a263d6d6
[3.15] gh-149977: Fix extra output of -m test test_lazy_import, again (GH-150965) (#150975)
gh-149977: Fix extra output of `-m test test_lazy_import`, again (GH-150965)
(cherry picked from commit 9b4090c48e)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-05 15:46:57 +00:00
Miss Islington (bot)
06ffcde725
[3.15] gh-146527: Fix memory leak in _PyGC_Fini() (GH-150969) (#150970)
gh-146527: Fix memory leak in _PyGC_Fini() (GH-150969)

Free generation_stats allocated by _PyGC_Init().

Fix Python/gc.c: Python/gc_free_threading.c was already fixed.
(cherry picked from commit 0036565e81)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-05 14:11:37 +00:00
Miss Islington (bot)
68f814eb71
[3.15] gh-53144: Improve charset support in the email package (GH-149942) (GH-150967)
Defer to the codecs module for all aliases.
Use MIME/IANA names for all IANA registered charsets.
Fix email.contentmanager.set_text_content().
(cherry picked from commit c195a046f8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-05 13:22:33 +00:00
Miss Islington (bot)
e8384cf1a0
[3.15] gh-149891: Add more encoding aliases (GH-149892) (GH-150961)
Support all aliases officially registered in IANA, except
Extended_UNIX_Code_Packed_Format_for_Japanese.

New names:
KSC_5601, KS_C_5601-1989, iso-ir-149, GB_2312-80, windows-936, mac,
CCSID00858, CCSID01140, and a number of "cs"-prefixed names.

Fix csHPRoman8, which was not normalized.
(cherry picked from commit 49f4ecfb08)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-05 15:45:22 +03:00
Miss Islington (bot)
85e75a73d4
[3.15] gh-150907: Fix dynamic_annotations.h when built with C++ and Valgrind (GH-150914) (#150962)
gh-150907: Fix dynamic_annotations.h when built with C++ and Valgrind (GH-150914)

Add extern "C++" scope for the C++ template.

Fix test_cppext when Python is built with --with-valgrind.
(cherry picked from commit c32501261a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-05 12:41:19 +00:00
Miss Islington (bot)
d8af158eb6
[3.15] gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328) (#150957)
gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328)

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: gh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"
(cherry picked from commit e4db68b9c9)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-05 12:09:13 +00:00
Miss Islington (bot)
675ed8a749
[3.15] gh-62825: Fix encoding aliases "KS_C_5601-1987", "KS X 1001", etc (GH-150933) (GH-150946)
They are now aliases of CP949 instead of EUC-KR.
(cherry picked from commit 45562c6f4f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-05 14:41:22 +03:00
sobolevn
b48c208bb0
[3.15] gh-150899: Do not reset custom -Xlazy_imports mode in test_lazy_imports (GH-150900) (#150947)
(cherry picked from commit 2f064fbc0b)
2026-06-05 08:43:27 +00:00
Miss Islington (bot)
a13fd39832
[3.15] gh-145177: Bump emscripten version to 4.0.19 (GH-150926) (#150939)
Bumps the emscripten version to 4.0.19.
(cherry picked from commit c83d3d789e)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2026-06-05 06:25:21 +00:00
Miss Islington (bot)
1e1a9d9b41
[3.15] Add shebang documentation for PyManager 26.3b1 (GH-150931)
(cherry picked from commit e28a2f4930)

Co-authored-by: Steve Dower <steve.dower@python.org>
2026-06-04 20:45:28 +00:00
Miss Islington (bot)
c6d64cc60d
[3.15] gh-150913: Fix sqlite3.Blob validation for empty slice assignment (GH-150915) (GH-150923)
ass_subscript_slice() returned early when the computed slice length
was zero, bypassing validation performed for non-empty slices.
(cherry picked from commit fc9c4db130)

Co-authored-by: Jiseok CHOI <jiseok.dev@gmail.com>
2026-06-04 14:10:30 +00:00
Miss Islington (bot)
42a41cc69f
[3.15] gh-150750: Fix a race condition in deque.index with free-threading (GH-150779) (#150920)
gh-150750: Fix a race condition in `deque.index` with free-threading (GH-150779)
(cherry picked from commit d83d50b5b7)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-04 13:58:59 +00:00
Miss Islington (bot)
253c51837f
[3.15] gh-106318: Add doctest role and a 'See also' to the str.split() docs (GH-144367)
(cherry picked from commit a96cba5c4a)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-06-04 14:23:33 +01:00
Miss Islington (bot)
f3956c659a
[3.15] Fix 2 broken links in documentation (GH-150892)
(cherry picked from commit cb064e746d)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-04 09:51:34 +00:00
Miss Islington (bot)
5a83d1bb7f
[3.15] Correct Stable ABI documentation for METH_FASTCALL (GH-149593) (GH-150853)
The current documentation says:

>
> METH_FASTCALL
>    Part of the Stable ABI since version 3.7.
>
> [...]
>
>   Added in version 3.7.
>
>    Changed in version 3.10: METH_FASTCALL is now part of the stable ABI.

so is contradictory about when it was added to the Stable ABI.  Looking at the header it seems like 3.10 is right.
(cherry picked from commit 58beae7319)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2026-06-04 11:50:39 +02:00
Miss Islington (bot)
0ad93968fe
[3.15] gh-149473: Emit audit event on calling os.environ.clear() (GH-149768) (#150094)
gh-149473: Emit audit event on calling os.environ.clear() (GH-149768)
(cherry picked from commit 29415c071f)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-04 08:47:38 +00:00
Miss Islington (bot)
6b46aac7d6
[3.15] gh-150436: Skip subprocess test on STATUS_DLL_INIT_FAILED (GH-150704) (#150713)
gh-150436: Skip subprocess test on STATUS_DLL_INIT_FAILED (GH-150704)

If a subprocess spawned with CREATE_NEW_CONSOLE creation flag fails
with STATUS_DLL_INIT_FAILED return code, skip the test. It's likely a
memory allocation failure in the desktop heap memory which caused the
DLL init failure.
(cherry picked from commit e8034dd841)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-04 08:46:08 +00:00
Miss Islington (bot)
624384d974
[3.15] gh-149521: Do not update last_profiled_frame if it's not changed (GH-149522) (#149542)
Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
2026-06-04 11:31:47 +03:00
Miss Islington (bot)
d7505294df
[3.15] gh-148613: Fix race in gc_set_threshold and gc_get_threshold (GH-150356) (#150841)
gh-148613: Fix race in `gc_set_threshold` and `gc_get_threshold` (GH-150356)
(cherry picked from commit 41eb8ee2bb)

Co-authored-by: Edward Xu <xuxiangad@gmail.com>
2026-06-04 12:43:46 +05:30
Miss Islington (bot)
e26ad524ec
[3.15] gh-145177: Fix Emscripten help text (GH-150874) (#150894)
Removes some stray commas in help text.
(cherry picked from commit 57d444612d)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2026-06-04 00:20:08 +00:00
Miss Islington (bot)
54bd7c0258
[3.15] gh-132467: Document and test that generic aliases are not classes (GH-133504) (#150854)
gh-132467: Document and test that generic aliases are not classes (GH-133504)
(cherry picked from commit 5915a1fb9d)

Co-authored-by: Abduaziz π <mail@ziyodov.uz>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-06-03 08:26:36 -07:00
Miss Islington (bot)
24f5d3d598
[3.15] gh-146636: Add Free-threaded Stable ABI migration guide (GH-150580) (#150844)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-06-03 17:55:35 +03:00
Hugo van Kemenade
381bda9395
[3.15] Docs: Replace hardcoded SOURCE_URI with patchlevel check (GH-150850) (#150855) 2026-06-03 16:49:58 +03:00
Miss Islington (bot)
21a4ac77be
[3.15] gh-91099: fix[imaplib]: call Exception with string instance (GH-31823) (#150811)
* bpo-46943: fix[imaplib]: call Exception with string instance

Adjust the behavior of 'login' to be similar to `authenticate()`,
where self.error is called with a str() instance.
(cherry picked from commit 29805f00a1)

Co-authored-by: Florian Best <spaceone@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2026-06-03 09:12:46 -04:00
Miss Islington (bot)
0f08c550bc
[3.15] gh-141004: Document unstable perf map functions in ceval.h (GH-143492) (GH-150849)
gh-141004: Document unstable perf map functions in `ceval.h` (GH-143492)
(cherry picked from commit 6453065db9)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
2026-06-03 12:44:34 +00:00
Miss Islington (bot)
c69521fdec
[3.15] Fix a typo in SSLSocket docs (GH-150839) (GH-150848)
Fix a typo in `SSLSocket` docs (GH-150839)
(cherry picked from commit 5553e003ca)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
2026-06-03 12:27:56 +00:00
Miss Islington (bot)
f8cea98b4e
[3.15] gh-149805: Fix SystemError when compiling __classdict__ class annotation (GH-149806)
(cherry picked from commit c52d2b16dd)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-03 09:39:22 +01:00
Miss Islington (bot)
accc0c8315
[3.15] gh-148587: Document sys.lazy_modules (GH-150742)
(cherry picked from commit e3fa52d953)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-06-03 09:36:50 +01:00
Miss Islington (bot)
53e7f2400a
[3.15] gh-150723: Fix perf jitdump files on macOS (GH-150728) (#150832)
gh-150723: Fix perf jitdump files on macOS (GH-150728)

The perf jitdump format defines the thread id field of the JR_CODE_LOAD
record as a 32-bit value, but on macOS it was declared as a uint64_t
(since pthread_threadid_np() returns a uint64_t). Those extra 8 bytes
plus alignment padding shifted every following field, so parsers reading
the file by the spec misread code_size as the code address and failed to
resolve any Python frames.

Declare thread_id as uint32_t on all platforms and truncate the macOS
thread id when writing the record. The value is only informational.
Symbols are resolved by address, and not thread ids so truncation is
safe here.

* Use mach_absolute_time for macOS jitdump timestamps

On macOS the jitdump file is consumed by profilers such as samply, which
timestamp their samples using mach_absolute_time(). The jitdump events were
stamped with clock_gettime(CLOCK_MONOTONIC), a different clock domain that
keeps advancing while the system is asleep, so the JIT code mappings could be
off by days relative to the samples and no Python frame would resolve. Stamp
jitdump events with mach_absolute_time() on macOS so they share the sampler's
clock domain. Linux continues to use CLOCK_MONOTONIC to stay aligned with perf.

Exercise the -Xperf_jit (jitdump) backend through samply and assert that
Python frames resolve, exercising the binary jitdump path end to end.
Skipped when samply is not installed.
(cherry picked from commit 494f2e3c92)

Co-authored-by: Nazım Can Altınova <canaltinova@gmail.com>
2026-06-03 00:41:24 +00:00