Commit Graph

131553 Commits

Author SHA1 Message Date
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
Miss Islington (bot) 1c2daa08fb [3.15] gh-150319: Replace all documentation which says "See PEP 585" (GH-150325) (#150808)
gh-150319: Replace all documentation which says "See PEP 585" (GH-150325)

* Replace all documentation which says "See PEP 585"

The following classes in the stdlib get simple updates:

- array.array
- asyncio.Future
- asyncio.Task
- collections.defaultdict
- collections.deque
- contextvars.ContextVar
- contextvars.Token
- ctypes.Array
- os.DirEntry
- re.Match
- re.Pattern
- string.templatelib.Interpolation
- string.templatelib.Template
- types.MappingProxyType
- queue.SimpleQueue
- weakref.ref

The following classes are documented publicly as functions, and are
therefore updated internally (`__class_getitem__.__doc__`) but not in the
public docs:

- functools.partial
- itertools.chain

The following builtin types have updates to `__class_getitem__.__doc__`
but not to any documentation pages:

- BaseExceptionGroup
- coroutines (from generators)
- dict
- enumerate
- frozendict
- frozenset
- generators (and async generators)
- list
- memoryview
- set
- slice
- tuple

Special cases:

- union objects are now documented as "supporting class-level []",
  rather than anything to do with generics.

- Templates might be generic over a single type (union, in theory) or
  over a TypeVarTuple. As this is not currently fully settled, it is
  marked with a comment and a mild hint that it is a single type is used
  (namely, "type" is singular rather than "types", plural)

* Apply suggestions from code review



* Correct several class getitem docs

And expand the text for tuples.



* Add notes on generic typing of builtins

* Fix typo in tuple.__class_getitem__ docstring

* Typo fix: malformed refs

Fix `generic` links which weren't marked as `:ref:`.

* Strike unnecessary docs on generic-ness



* Apply suggestions from code review

These are applied at both the originally indicated locations and in the
corresponding docstring definitions.



* Update Doc/library/re.rst



* Update Objects/enumobject.c



* Remove tuple generic doc in 'stdtypes' page

This is covered in more detail in the cross-linked typing documentation.
The other copy of this documentation -- in the docstring for
`tuple.__class_getitem__` -- is left in place.

* Fix whitespace around new doc of generics

Per review, do not introduce or remove whitespace such that section
breaks are altered by the introduction of doc on various generic types.

In most cases, this is a removal of an extra line.

In one case (Arrays), it is the reintroduction of a line.

Additionally, two other minor fixes are included:
- incorrect indent on 'defaultdicts'
- make `mappingproxy.__class_getitem__.__doc__` consistent with other
  mapping type generic docs



* Move placement of memoryview generic note

Previous placement was at the end of the main docstring, which is
consistent with other types but places it after a section on various
methods (which makes it read somewhat inconsistently). Moving it up
helps resolve.



* Ensure sphinxdoc does not start sentences lowercase

Lowercase class names at the start of sentences are marked out with the
`class` role. In the case of `deque`, documentation already refers to
these as `Deques`, so this form is preferred.

* Apply suggestions from code review



* Fix line endings and wrap more tightly

Line endings fixed by pre-commit ; also re-wrapped the MappingProxyType
text which was too long.

* Use 'ContextVars' style in sphinx doc

---------
(cherry picked from commit 50fe49c879)

Co-authored-by: Stephen Rosen <sirosen@globus.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-02 20:40:52 +00:00
Miss Islington (bot) d5f93ce156 [3.15] gh-141627: Fix BufferedRandom inheritance documentation (GH-141629) (GH-150801)
BufferedRandom does not inherit from BufferedReader and BufferedWriter
in the C implementation.
(cherry picked from commit 551bc2cb5e)

Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
2026-06-02 22:23:15 +03:00
Miss Islington (bot) 0aa9f434ad [3.15] Fix description of the function parameter of shutil.register_archive_format() (GH-145087) (GH-150804)
(cherry picked from commit 18c6d3ccc3)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2026-06-02 19:20:49 +00:00
Hugo van Kemenade 49c92ac874 Merge branch '3.15' of https://github.com/python/cpython into 3.15 2026-06-02 20:35:34 +03:00
Hugo van Kemenade a138769594 Post 3.15.0b2 2026-06-02 20:34:33 +03:00
Miss Islington (bot) fd0a7fd5ba [3.15] gh-101913: changed wording of docstring for _parsedate_tz (GH-134446) (#150796)
Fixed incorrect word.
(cherry picked from commit f7e0fb60cf)

Co-authored-by: Gustaf <79180496+gostak-dd@users.noreply.github.com>
Co-authored-by: Gustaf <79180496+GGyll@users.noreply.github.com>
2026-06-02 11:31:56 -04:00
Hugo van Kemenade 94a64bbc6c Python 3.15.0b2 v3.15.0b2 2026-06-02 18:28:41 +03:00
Miss Islington (bot) 13a7cce363 [3.15] Silence experimental coroutine deprecation warnings (GH-150788) (#150794)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
2026-06-02 15:20:39 +00:00
Miss Islington (bot) 33b2879c3a [3.15] gh-149187: Document frozendict() under 'Built-in Functions' (GH-149185)
(cherry picked from commit 86867edb84)

Co-authored-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2026-06-02 15:18:03 +01:00
Miss Islington (bot) b17bcfdf7e [3.15] gh-150766: export _PyGC_VisitFrameStack and _PyGC_VisitStackRef functions (GH-150767) (#150787)
gh-150766: export `_PyGC_VisitFrameStack` and `_PyGC_VisitStackRef` functions (GH-150767)
(cherry picked from commit df34a2f712)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-06-02 13:36:52 +00:00