Compare commits

..

1538 commits

Author SHA1 Message Date
Hugo van Kemenade
57e0d177c2 Python 3.14.1 2025-12-02 14:51:37 +02:00
Hugo van Kemenade
49fe7574d9
[3.14] Revert "gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-119455)" (#142184)
Fix a potential virtual memory allocation denial of service in http.server (GH-119455)"
2025-12-02 12:06:25 +00:00
Petr Viktorin
82274c491a
[3.14] Document None for timeout argument of select.select (GH-142177) (#142182) 2025-12-02 13:45:07 +02:00
Miss Islington (bot)
b053c2abf0
[3.14] gh-140281: Update free threading Python HOWTO for 3.14 (gh-140566) (gh-142173)
(cherry picked from commit 2dc28eb8b0)

Co-authored-by: Krishna-web-hub <masterkiran27@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-12-02 01:06:15 -05:00
Miss Islington (bot)
15a25f44ee
[3.14] gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949) (#142171)
gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949)
(cherry picked from commit 5e58548ebe)

Co-authored-by: LloydZ <35182391+cocolato@users.noreply.github.com>
2025-12-02 05:06:26 +00:00
Miss Islington (bot)
5c5670eb45
[3.14] gh-142048: Fix quadratically increasing GC delays (gh-142051) (gh-142166)
The GC for the free threaded build would get slower with each collection due
to effectively double counting objects freed by the GC.
(cherry picked from commit eb892868b3)

Co-authored-by: Kevin Wang <kevmo314@gmail.com>
2025-12-02 00:30:11 +00:00
Hugo van Kemenade
7642070807
[3.14] Revert "GH-91636: Clear weakrefs created by finalizers. (GH-136401) (#141993)" (#142152) 2025-12-01 20:34:37 +02:00
Miss Islington (bot)
4ce27904b5
[3.14] gh-119451: Fix a potential denial of service in http.client (GH-119454) (#142138)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-01 20:34:09 +02:00
Miss Islington (bot)
afce34fbf0
[3.14] gh-141930: Use the regular IO stack to write .pyc files for a better error message on failure (GH-141931) (#142021)
Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2025-12-01 18:43:50 +02:00
Miss Islington (bot)
521fb36561
[3.14] gh-141004: Document descriptor and dict proxy type objects (GH-141803) (GH142147)
gh-141004: Document descriptor and dict proxy type objects (GH-141803)
(cherry picked from commit 52f9b5f580)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-12-01 15:57:31 +00:00
Miss Islington (bot)
b64441e485
[3.14] gh-119342: Fix a potential denial of service in plistlib (GH-119343) (GH-142143)
Reading a specially prepared small Plist file could cause OOM because file's
read(n) preallocates a bytes object for reading the specified amount of
data. Now plistlib reads large data by chunks, therefore the upper limit of
consumed memory is proportional to the size of the input file.
(cherry picked from commit 694922cf40)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-01 15:54:58 +00:00
Serhiy Storchaka
29c657a1f2
[3.14] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-119455)
The CGI server on Windows could consume the amount of memory specified
in the Content-Length header of the request even if the client does not
send such much data. Now it reads the POST request body by chunks,
so that the memory consumption is proportional to the amount of sent
data.
2025-12-01 12:59:09 +00:00
Miss Islington (bot)
c4054f7aa8
[3.14] Docs: Upgrade Sphinx to 9.0 (GH-142114) (#142128)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-01 11:22:05 +00:00
Miss Islington (bot)
9cb5a93e07
[3.14] gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH-142101) (#142124)
gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH-142101)

Document not calling Popen.wait after Popen.communicate times out.

Closes GH-141473
(cherry picked from commit 3e2c557493)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-12-01 02:55:28 +00:00
Miss Islington (bot)
8899ed52f2
[3.14] gh-142066: Fix grammar in multiprocessing Pipes and Queues (GH-142121) (#142122)
gh-142066: Fix grammar in multiprocessing Pipes and Queues (GH-142121)
(cherry picked from commit 981ce0cf3a)


docs: Fix grammar in multiprocessing Pipes and Queues (gh-142066)

Co-authored-by: Tadej Magajna <tmagajna@gmail.com>
2025-12-01 02:19:48 +00:00
Miss Islington (bot)
4dbf8e14ba
[3.14] gh-142067: Add missing default value for param in multiprocessing.Pipe's doc (GH-142109) (#142120)
gh-142067: Add missing default value for param in `multiprocessing.Pipe`'s doc (GH-142109)
(cherry picked from commit 229ed3dd1f)

Co-authored-by: flovent <flbven@protonmail.com>
2025-11-30 21:15:39 +00:00
Hugo van Kemenade
b95d16a338
[3.14] gh-133146: Add the old public get_value method to documentation and refactor code. (GH-133301) (#142110)
also uses it within the internals in a few places.
(cherry picked from commit db098a475a)

Co-authored-by: Duprat <yduprat@gmail.com>
2025-11-30 13:06:56 -08:00
Miss Islington (bot)
3824ad0286
[3.14] Improve clarity in tutorial introduction (GH-140669) (#142112)
Co-authored-by: Thierry Martos <81799048+ThierryMT@users.noreply.github.com>
2025-11-30 12:53:05 +00:00
Miss Islington (bot)
52731c4e62
[3.14] gh-140373: Correctly emit PY_UNWIND event when generator is closed (GH-140767) (#140816)
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-11-30 14:35:14 +02:00
Miss Islington (bot)
58c0af9984
[3.14] gh-139741: Make dist-pdf docs archive build work for macOS (GH-140837) (#141229)
Co-authored-by: Naitree Zhu <Naitreey@gmail.com>
2025-11-30 12:34:12 +00:00
Miss Islington (bot)
212b096b2a
[3.14] gh-140042: Removing unsafe call to sqlite3_shutdown (GH-141690) (#141793)
Co-authored-by: Prithviraj Chaudhuri <p.chaudhuri1993@gmail.com>
2025-11-30 14:32:11 +02:00
Miss Islington (bot)
848a2ebe53
[3.14] gh-136063: fix quadratic-complexity parsing in email.message._parseparam (GH-136072) (#140827)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-30 14:30:56 +02:00
Miss Islington (bot)
1011c0c38f
[3.14] gh-132795: Add docs for multiprocessing.Semaphore.locked (GH-133299) (#142111)
Co-authored-by: Duprat <yduprat@gmail.com>
2025-11-30 12:19:30 +00:00
Miss Islington (bot)
3d448061a1
[3.14] GH-141808: Do not generate the jit stencils twice in case of PGO builds on Windows. (GH-142043) (#142100)
GH-141808: Do not generate the jit stencils twice in case of PGO builds on Windows. (GH-142043)

* do not build the jit stencils twice in case of PGO builds on Windows

* blurb it
(cherry picked from commit f2ca1581ca)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-11-29 21:09:19 +00:00
Miss Islington (bot)
85591009d1
[3.14] Docs: Prepare for Sphinx 9 (GH-142057) (#142091)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-11-29 17:15:25 +02:00
Miss Islington (bot)
612213c0f4
[3.14] GH-121970: Remove Docutils list monkeypatch (GH-142056) (#142088) 2025-11-29 14:56:29 +00:00
Miss Islington (bot)
fed2af6f9e
[3.14] GH-91636: Clear weakrefs created by finalizers. (GH-136401) (#141993)
GH-91636: Clear weakrefs created by finalizers. (GH-136401)

Weakrefs to unreachable garbage that are created during running of
finalizers need to be cleared.  This avoids exposing objects that
have `tp_clear` called on them to Python-level code.
(cherry picked from commit b6b99bf7f1)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2025-11-28 23:34:36 -08:00
Itamar Oren
f7d17ac9f8
[3.14] gh-140011: Delete importdl assertion that prevents importing embedded modules from packages (GH-141605) (#141986)
gh-140011: Delete importdl assertion that prevents importing embedded modules from packages (GH-141605)

(cherry picked from commit 27f62eb711)
2025-11-28 23:30:57 -08:00
Miss Islington (bot)
d8a72b4c5e
[3.14] GH-141963: Clarify argparse documentation (GH-141964) (#142076)
GH-141963: Clarify argparse documentation (GH-141964)

Clarify argparse documentation

Tightens the phrasing for several argparse actions.
(cherry picked from commit cfcd52490d)

Co-authored-by: Moshe Kaplan <mosheekaplan@gmail.com>
2025-11-29 07:28:50 +00:00
Miss Islington (bot)
20b910ca8b
[3.14] Fix multiprocessing queue test_get() (GH-142024) (#142070)
Fix multiprocessing queue test_get() (GH-142024)

* Replace sleep() with support.sleeping_retry().
* Test get_nowait() first.
* Restore previously disabled test.

Fix the failure:

FAIL: test_get (test.test_multiprocessing_spawn.test_processes.WithProcessesTestQueue.test_get)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/_test_multiprocessing.py", line 1208, in test_get
    self.assertEqual(queue_empty(queue), False)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: True != False
(cherry picked from commit 5e749d3743)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-29 07:25:46 +00:00
Miss Islington (bot)
23d771a5de
[3.14] Docs: multi-disk ZIP files -> multipart ZIP files (GH-141962) (#142074)
Docs: multi-disk ZIP files -> multipart ZIP files (GH-141962)

* Remove some old currentlies
* multi-disk -> multipart
* Sentence case headings
(cherry picked from commit 890fe5aad5)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-29 07:17:39 +00:00
Miss Islington (bot)
3d8ad2d366
[3.14] gh-141994: Warn of XXE vulnerability in documentation of SAX feature xml.sax.handler.feature_external_ges (GH-141996) (#142072)
gh-141994: Warn of XXE vulnerability in documentation of SAX feature `xml.sax.handler.feature_external_ges` (GH-141996)

Doc/library/xml.sax.handler.rst: Warn of XXE with feature_external_ges

Related to commit baa9f33897
(cherry picked from commit 440bcb9456)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2025-11-29 07:14:02 +00:00
Miss Islington (bot)
6b799e1591
[3.14] gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush error when closed (GH-142061) (#142064)
gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush error when closed (GH-142061)

gh-70560: gh-74389: subprocess.Popen.communicate() now ignores stdin.flush error when closed

with a unittest and news entry.
(cherry picked from commit 923056b2d4)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-11-28 23:03:05 -08:00
Miss Islington (bot)
c7f741100b
[3.14] gh-87512: Fix subprocess using timeout= on Windows blocking with a large input= (GH-142058) (#142068)
gh-87512: Fix `subprocess` using `timeout=` on Windows blocking with a large `input=` (GH-142058)

On Windows, Popen._communicate() previously wrote to stdin synchronously, which could block indefinitely if the subprocess didn't consume input= quickly and the pipe buffer filled up. The timeout= parameter was only checked when joining the reader threads, not during the stdin write.

This change moves the Windows stdin writing to a background thread (similar to how stdout/stderr are read in threads), allowing the timeout to be properly enforced. If timeout expires, TimeoutExpired is raised promptly and the writer thread continues in the background. Subsequent calls to communicate() will join the existing writer thread.

Adds test_communicate_timeout_large_input to verify that TimeoutExpired is raised promptly when communicate() is called with large input and a timeout, even when the subprocess doesn't consume stdin quickly.

This test already passed on POSIX (where select() is used) but failed on Windows where the stdin write blocks without checking the timeout.
(cherry picked from commit 5b1862bdd8)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-11-29 06:47:04 +00:00
Miss Islington (bot)
476089479d
[3.14] gh-141473: Fix subprocess.Popen.communicate to send input to stdin upon a subsequent post-timeout call (GH-141477) (#142059)
gh-141473: Fix subprocess.Popen.communicate to send input to stdin upon a subsequent post-timeout call (GH-141477)

* gh-141473: Fix subprocess.Popen.communicate to send input to stdin
* Docs: Clarify that `input` is one time only on `communicate()`
* NEWS entry
* Add a regression test.

---------
(cherry picked from commit 526d7a8bb4)

Co-authored-by: Artur Jamro <artur.jamro@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-11-28 22:21:43 -08:00
Miss Islington (bot)
c1d3e2523b
[3.14] GH-134453: Fix subprocess memoryview input handling on POSIX (GH-134949) (#142062)
GH-134453: Fix subprocess memoryview input handling on POSIX (GH-134949)

Fix inconsistent subprocess.Popen.communicate() behavior between Windows
and POSIX when using memoryview objects with non-byte elements as input.

On POSIX systems, the code was incorrectly comparing bytes written against
element count instead of byte count, causing data truncation for large
inputs with non-byte element types.

Changes:
- Cast memoryview inputs to byte view when input is already a memoryview
- Fix progress tracking to use len(input_view) instead of len(self._input)
- Add comprehensive test coverage for memoryview inputs

🤖 Generated with [Claude Code](https://claude.ai/code)



* old-man-yells-at-ReST
* Update 2025-05-30-18-37-44.gh-issue-134453.kxkA-o.rst
* assertIsNone review feedback
* fix memoryview_nonbytes test to fail without our fix on main, and have a nicer error.

Thanks to Peter Bierma @ZeroIntensity for the code review.
(cherry picked from commit cc6bc4c97f)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-11-29 04:52:14 +00:00
Miss Islington (bot)
a1dd248022
[3.14] gh-116008: Detect freed thread state in faulthandler (GH-141988) (#142013)
gh-116008: Detect freed thread state in faulthandler (GH-141988)

Add _PyMem_IsULongFreed() function.
(cherry picked from commit d5d9e89dde)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-27 20:34:00 +00:00
Stan Ulbrych
64d6bde38f
[3.14] gh-98896: resource_tracker: use json&base64 to allow arbitrary shared memory names (GH-138473) (GH-141922)
Co-authored-by: Rani Pinchuk <33353578+rani-pinchuk@users.noreply.github.com>
2025-11-27 13:17:39 +01:00
Victor Stinner
ad60d8963e
[3.14] gh-125434: Display thread name in faulthandler on Windows (#142011)
* gh-125434: Display thread name in faulthandler on Windows (#140675)

(cherry picked from commit 313145eab5)

* gh-125434: Fix non-ASCII thread names in faulthandler on Windows (#140700)

Add _Py_DumpWideString() function to dump a wide string as ASCII. It
supports surrogate pairs.

Replace _Py_EncodeLocaleRaw() with _Py_DumpWideString()
in write_thread_name().

(cherry picked from commit 80f20f58b2)
2025-11-27 12:05:37 +00:00
Miss Islington (bot)
f47e928574
[3.14] gh-116738: Fix thread-safety issue in re module for free threading (gh-141923) (gh-141990)
Added atomic operations to `scanner_begin()` and `scanner_end()` to prevent
race conditions on the `executing` flag in free-threaded builds. Also added
tests for concurrent usage of the `re` module.

Without the atomic operations, `test_scanner_concurrent_access()` triggers
`assert(self->executing)` failures, or a thread sanitizer run emits errors.
(cherry picked from commit bc9e63dd9d)

Co-authored-by: Alper <alperyoney@fb.com>
2025-11-26 21:08:39 +00:00
Petr Viktorin
96bc021d7c
[3.14] gh-141909: Add PyModuleDef_Slot and earlier Py_mod_* constants to stable ABI manifest (#141910) (GH-141978)
These were added to the limited API in 3.5-3.13.
Not including them in `Misc/stable_abi.toml` was a bug.

(cherry picked from commit 202fce0dbd)
2025-11-26 15:35:04 +01:00
Petr Viktorin
69021e9acf
[3.14] GH-139653: Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack. (GH-141711) (GH-141944)
Only raises if the stack pointer is both below the limit *and* above the stack base.
This prevents false positives for user-space threads, as the stack pointer will be outside those bounds
if the stack has been swapped.

Cherry-picked from commit c25a070759

Co-authored-by: Mark Shannon <mark@hotpy.org>
2025-11-26 12:54:56 +01:00
Miss Islington (bot)
20a677d75a
[3.14] gh-141004: Document missing PyThread* APIs (GH-141810) (GH-141954)
gh-141004: Document missing `PyThread*` APIs (GH-141810)
(cherry picked from commit a89ee4b9c2)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-25 17:58:44 +00:00
Miss Islington (bot)
9969c4280f
[3.14] gh-140911: Ensure that UserString.index() and UserString.rindex() accept UserString as argument (GH-140945) (GH-141946)
(cherry picked from commit e6174ee981)

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-11-25 13:56:05 +00:00
Miss Islington (bot)
630074b7ce
[3.14] gh-141004: Document PyOS_mystr(n)icmp (GH-141760) (#141947)
gh-141004: Document `PyOS_mystr(n)icmp` (GH-141760)
(cherry picked from commit f445c452ea)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-25 13:51:02 +00:00
Petr Viktorin
32a38a2523
[3.14] gh-139653: Add PyUnstable_ThreadState_SetStackProtection() (GH-139668) (#141661)
Co-authored-by: Rok Mandeljc <rok.mandeljc@gmail.com>
Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-25 14:21:53 +01:00
Alexander Nordin
11e3fc9636
[3.14] gh-138199: Address potential confusion re: threading (GH-138200) (GH-141928)
gh-138199: Address potential confusion regarding threading in the `asyncio` HOWTO (GH-138200)

(cherry picked from commit a4f4225213)
2025-11-25 06:52:47 -05:00
Miss Islington (bot)
add73fdda0
[3.14] gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908) (#141918)
gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908)

* test_hashlib: better handle support for SHA3

It's possible that the SSL library supports only SHA3 algo and doesn't
have SHAKE one.

The current test wrongly detect this and set both HASH and HASHXOF to
None expecting to have the extra SHA3 attributes present but this should
only be true for SHAKE algo.

To better handle this, move the HASH condition to a dedicated try-expect
condition and check if HASHXOF is None in the relevant code effectively
checking if SHA3 is supported by the SSL library but SHAKE algo needs to
use the sha3module one.

---------
(cherry picked from commit fee7782650)

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Co-authored-by: Christian Marangi <ansuelsmth@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-11-25 02:20:35 +01:00
Miss Islington (bot)
7ccdbbd04e
[3.14] Fix implicit import in test_monitoring.py (gh-141795) (gh-141920)
(cherry picked from commit 369ce2b139)

Co-authored-by: SubbaraoGarlapati <53627478+SubbaraoGarlapati@users.noreply.github.com>
2025-11-24 20:19:20 +00:00
Miss Islington (bot)
0f2f4c0e60
[3.14] gh-141004: Document stack effect C APIs (GH-141843) (GH-141916)
gh-141004: Document stack effect C APIs (GH-141843)
(cherry picked from commit e1f1df4082)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-24 17:24:41 +00:00
Miss Islington (bot)
9e309c140f
[3.14] gh-141004: Document PyImport_Inittab (GH-141844) (GH-141915)
gh-141004: Document `PyImport_Inittab` (GH-141844)
(cherry picked from commit 5f35702bb6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-24 12:16:31 -05:00
Miss Islington (bot)
f8b0c90208
[3.14] gh-129441: Fix some flakiness in test_instrumentation (gh-141881) (gh-141913)
Most of the `self.assertTrue(self.called)` checks are flaky because
the worker threads may sometimes finish before the main thread calls
`self.during_threads()`.
(cherry picked from commit 71126ab19c)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-11-24 16:44:54 +00:00
Miss Islington (bot)
cabaa47668
[3.14] gh-116749: Fix code comment for _PyConfig_GIL_DEFAULT (gh-141804) (gh-141911)
(cherry picked from commit c490ffb7ac)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-11-24 16:10:59 +00:00
Miss Islington (bot)
7b8fb9072d
[3.14] gh-106318: Add examples for str.join() (GH-140315) (#141906)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-24 14:59:22 +00:00
Miss Islington (bot)
3edc944ec4
[3.14] gh-106318: Add example for str.format() (GH-137018) (#141904)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2025-11-24 14:56:59 +00:00
Hugo van Kemenade
9e46e1b05c
[3.14] gh-106318: Add example for str.isalpha() (GH-137557) (#141901)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-24 14:28:49 +00:00
Miss Islington (bot)
a47ed2e904
[3.14] gh-106318: Add example for str.isascii() (GH-137558) (#141898)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-24 14:07:58 +00:00
Miss Islington (bot)
17c5d6d58d
[3.14] gh-141004: Document Py_ARRAY_LENGTH (GH-141601) (GH-141895)
gh-141004: Document `Py_ARRAY_LENGTH` (GH-141601)
(cherry picked from commit e0773eacb7)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-24 13:40:01 +00:00
Miss Islington (bot)
6511eb0f06
[3.14] gh-106318: Add example for str.isdecimal() (GH-137559) (#141893)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-24 15:20:02 +02:00
Miss Islington (bot)
40fd66bab8
[3.14] gh-135335: Simplify preload regression test using __main__ (GH-138686) (#141886)
gh-135335: Simplify preload regression test using __main__ (GH-138686)

Simplify preload regression test using `__main__`

With the fix for gh-126631 `__main__` modules can be preloaded and the regression
test for gh-135335 can be simplified to just use a self-contained script rather
than requiring a module.

Note this assumes and implicitly tests that `__main__` is preloaded by default.
(cherry picked from commit 425f24e4fa)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-11-23 19:09:34 -08:00
Stefano Rivera
394db662a5
[3.14] GH-139914: Handle stack growth direction on HPPA (GH-140028) (#141404)
* [3.14] GH-139914: Handle stack growth direction on HPPA (GH-140028)

Adapted from a patch for Python 3.14 submitted to the Debian BTS by John David Anglin https://bugs.debian.org/1105111#20

* Forgot to update test_call

* WTF typo
2025-11-23 15:55:33 -08:00
Miss Islington (bot)
73c9870366
[3.14] gh-141865: Fix translation of strings in changes.py extension (GH-141882) (#141883)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-23 17:34:01 +00:00
Miss Islington (bot)
1a798d30d8
[3.14] gh-120158: Fix inconsistent monitoring state when setting events too frequently (gh-141845) (gh-141879)
If we overflowed the global version counter (i.e., after 2*24 calls to
`_PyMonitoring_SetEvents`), we bailed out after setting global monitoring
events but before instrumenting code objects, which led to assertion errors
later on.

Also add a `time.sleep()` to `test_free_threading.test_monitoring` to avoid
overflowing the global version counter.
(cherry picked from commit e457d60daa)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-11-23 15:31:56 +00:00
Miss Islington (bot)
59ab1edb00
[3.14] gh-98552: Revert (unneeded, already done elsewhere) "flush std streams in the multiprocessing forkserver before fork (GH-141849)" (GH-141871) (#141872)
gh-98552: Revert (unneeded, already done elsewhere) "flush std streams in the multiprocessing forkserver before fork (GH-141849)" (GH-141871)

Revert (unneeded, already done elsewhere) "gh-98552: flush std streams in the multiprocessing forkserver before fork (GH-141849)"

This reverts commit 58badb1711.
(cherry picked from commit 614a28b3da)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-11-23 10:17:20 +00:00
Miss Islington (bot)
061965c584
[3.14] gh-98552: flush std streams in the multiprocessing forkserver before fork (GH-141849) (#141851)
gh-98552: flush std streams in the multiprocessing forkserver before fork (GH-141849)

* flush std streams in the multiprocessing forkserver before fork

* NEWS
(cherry picked from commit 58badb1711)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-11-22 12:23:22 -08:00
Miss Islington (bot)
adc2cc21eb
[3.14] GH-101100: Resolve reference warnings in library/stdtypes.rst (GH-138420) (#141855)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-11-22 21:33:09 +02:00
Miss Islington (bot)
5755ce0a87
[3.14] gh-101100: Fix sphinx warnings in library/unittest.rst (GH-140109) (#141853)
Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-22 21:23:59 +02:00
Miss Islington (bot)
972aa93692
[3.14] gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802) (#141847)
gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802)

* gh-141801: Use accessors for ASN1_STRING fields

While ASN1_STRING is currently exposed, it is better to use the
accessors. See https://github.com/openssl/openssl/issues/29117 where, if
the type were opaque, OpenSSL's X509 objects could be much more
memory-efficient.

* Update Modules/_ssl.c



* Update Modules/_ssl.c



---------
(cherry picked from commit c41fce08a5)

Co-authored-by: David Benjamin <davidben@davidben.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-22 10:53:06 -08:00
Miss Islington (bot)
c9a4a3d502
[3.14] gh-141600: Fix musl version detection on Void Linux (GH-141850)
(cherry picked from commit 08477dbf30)

Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2025-11-22 18:47:47 +00:00
Miss Islington (bot)
43d8b7f1ac
[3.14] gh-141612: improve test_trampoline_works_with_forks coverage (GH-141613) (#141824)
gh-141612: improve `test_trampoline_works_with_forks` coverage (GH-141613)
(cherry picked from commit f15f6d0ba3)

Co-authored-by: Paresh Joshi <rahulj9223@gmail.com>
2025-11-22 10:38:52 +01:00
Cody Maloney
cfcf7652f6
[3.14] gh-129559: add bytearray.resize thread safety test for free-threading (GH-141739) (#141835)
[3.14] gh-129559: add `bytearray.resize` thread safety test for free-threading  (GH-141739)
(cherry picked from commit 019c315a8e)
2025-11-22 09:41:20 +05:30
Miss Islington (bot)
8d5cf98e45
[3.14] gh-141729: Doc PyTypeObject.tp_vectorcall grammar fix (GH-141730) (#141815)
gh-141729: Doc PyTypeObject.tp_vectorcall grammar fix (GH-141730)

[3.14] Doc PyTypeObject.tp_vectorcall grammar fix
(cherry picked from commit 20b69aac0d)

Co-authored-by: Michael Kiper <77862413+michaelkiper@users.noreply.github.com>
Co-authored-by: makiper <michael.kiper@jpl.nasa.gov>
2025-11-21 23:14:43 +03:00
Miss Islington (bot)
5bca7f4d7a
[3.14] gh-137422: Fix race condition in PyImport_AddModuleRef (gh-141822) (gh-141830)
(cherry picked from commit 2d50dd242e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-11-21 18:57:30 +00:00
Miss Islington (bot)
af586d8d26
[3.14] gh-116738: Make csv module thread-safe (gh-141365) (gh-141825)
Added a critical section to protect the states of `ReaderObj` and `WriterObj` in the free-threading build. Without the critical sections, both new free-threading tests were crashing.
(cherry picked from commit fb26d9c2ef)

Co-authored-by: Alper <alperyoney@fb.com>
2025-11-21 16:47:13 +00:00
Victor Stinner
5398d088f4
[3.14] gh-141784: Fix _remote_debugging_module.c compilation on 32-bit Linux (#141796) (#141800)
gh-141784: Fix _remote_debugging_module.c compilation on 32-bit Linux (#141796)

Include Python.h before system headers to make sure that
_remote_debugging_module.c uses the same types (ABI) than Python.

(cherry picked from commit 722f4bb8c9)
2025-11-20 18:13:03 +01:00
Miss Islington (bot)
730ff82bdf
[3.14] Docs: Fix typo in socketserver documentation (GH-140956) (#141799)
Co-authored-by: Thomas Ballard <thomasballard0503@gmail.com>
2025-11-20 16:35:09 +00:00
Miss Islington (bot)
1253a8b2df
[3.14] GH-137841: Open tzdata/zones file with UTF-8 encoding (GH-137872) (#141607)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-11-20 18:23:40 +02:00
Miss Islington (bot)
f1bed5baf0
[3.14] gh-141004: Document missing PyDateTime* APIs (GH-141543) (GH-141791)
gh-141004: Document missing `PyDateTime*` APIs (GH-141543)
(cherry picked from commit 4273616ebf)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-20 13:54:48 +00:00
Miss Islington (bot)
fa40aab2aa
[3.14] gh-141004: Document missing generator APIs (GH-141409) (GH-141789)
gh-141004: Document missing generator APIs (GH-141409)
(cherry picked from commit 2da7ecc680)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-20 13:52:07 +00:00
Miss Islington (bot)
59fa59e381
[3.14] gh-141004: Document Py_MakePendingCalls (GH-141137) (GH-141787)
gh-141004: Document `Py_MakePendingCalls` (GH-141137)
(cherry picked from commit ce701032a3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-20 13:48:11 +00:00
Miss Islington (bot)
daf98fe5bd
[3.14] gh-141757: Comply with pickle protocol in test_reduce_5tuple (GH-141759) (GH-141782)
The 5th element of the __reduce__ tuple should be an iterator.
(cherry picked from commit 41b9ad5b38)

Co-authored-by: Arseny Boykov <36469655+Bobronium@users.noreply.github.com>
2025-11-20 09:22:52 +00:00
Miss Islington (bot)
83cfd87568
[3.14] gh-141489: Simplify closure/freevar iteration in annotationlib._build_closure() (GH-141490) (#141776)
gh-141489: Simplify closure/freevar iteration in `annotationlib._build_closure()` (GH-141490)
(cherry picked from commit a35c683da5)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
2025-11-20 04:33:18 +00:00
Miss Islington (bot)
072eeaf84c
[3.14] gh-132657: optimize PySet_Contains for frozenset (GH-141183) (gh-141773)
(cherry picked from commit 7211a34fe1)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-11-19 17:01:49 -08:00
Miss Islington (bot)
c05e71f61e
[3.14] gh-132657: avoid locks and refcounting in frozenset lookups (GH-136107) (gh-141772)
gh-132657: avoid locks and refcounting in `frozenset` lookups (GH-136107)
(cherry picked from commit f58a7c7175)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2025-11-19 17:00:42 -08:00
Miss Islington (bot)
f6552d2c58
[3.14] Remove GvR from '_stdauthor' in Doc/conf.py (GH-141765) (#141767)
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Guido van Rossum <gvanrossum@microsoft.com>
2025-11-19 20:36:24 +00:00
Miss Islington (bot)
8eed63e973
[3.14] Move the NEWS entry for gh-141659 to the correct section (GH-141744) (GH-141766)
(cherry picked from commit fbc31d14ff)

Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
2025-11-19 20:17:51 +00:00
Miss Islington (bot)
d05be32758
[3.14] gh-141004: Document Py_LOCAL and Py_LOCAL_INLINE (GH-141725) (GH-141761)
gh-141004: Document `Py_LOCAL` and `Py_LOCAL_INLINE` (GH-141725)
(cherry picked from commit 3149d64c93)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-19 18:38:09 +00:00
Sam Gross
b7c25eabd6
[3.14] gh-139103: fix free-threading dataclass.__init__ perf issue (gh-141596) (gh-141750)
The dataclasses `__init__` function is generated dynamically by a call to `exec()` and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when assigned as an attribute to type objects to avoid reference count contention when creating dataclass instances.
(cherry picked from commit ce79154176)

Co-authored-by: Edward Xu <xuxiangad@gmail.com>
2025-11-19 15:00:51 +00:00
Miss Islington (bot)
8c796889ff
[3.14] gh-141570: can_colorize: Expect fileno() to raise OSError, as documented (GH-141716) (#141747)
gh-141570: can_colorize: Expect fileno() to raise OSError, as documented (GH-141716)

In Fedora, we've been given a slightly incomplete reproducer for a problematic
Python 3.14 color-related change in argparse that leads to an exception when
Python is used from mod_wsgi: https://bugzilla.redhat.com/2414940

mod_wsgi replaces sys.stdout with a custom object that raises OSError on .fileno():

8460dbfcd5/src/server/wsgi_logger.c (L434-L440)

This should be supported, as the documentation of fileno explicitly says:

> An OSError is raised if the IO object does not use a file descriptor.

https://docs.python.org/3.14/library/io.html#io.IOBase.fileno

The previously expected exception inherits from OSError,
so it is still expected.

Fixes https://github.com/python/cpython/issues/141570
(cherry picked from commit 96f496a949)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-19 14:29:15 +00:00
Miss Islington (bot)
562e23f9d5
[3.14] gh-140875: Fix handling of unclosed charrefs before EOF in HTMLParser (GH-140904) (GH-141745)
(cherry picked from commit 95296a9d40)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-11-19 12:43:24 +00:00
Miss Islington (bot)
36ad4be1d9
[3.14] Correct class name from PullDom to PullDOM (GH-141207) (#141743)
Co-authored-by: Guo Ci <zguoci@gmail.com>
2025-11-19 13:07:01 +02:00
Miss Islington (bot)
ff8829892a
[3.14] gh-138189: Link references to type slots (GH-141410) (GH-141718)
(cherry picked from commit 4695ec109d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-19 10:30:11 +01:00
Miss Islington (bot)
7cb15f93fe
[3.14] gh-141659: Fix bad file descriptor error in subprocess on AIX (GH-141660) (GH-141738)
/proc/self does not exist on AIX.
(cherry picked from commit 92c5de73b8)

Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
2025-11-19 08:05:01 +00:00
Miss Islington (bot)
daff2a9c3c
[3.14] gh-141692: Add a slice-specific lib folder to iOS XCframeworks. (GH-141693) (#141733)
Modifies the iOS XCframework to include a lib folder for each slice that
contains a symlinked version of the libPython dynamic library.
(cherry picked from commit 7b0b708675)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-11-19 02:25:34 +00:00
Miss Islington (bot)
9543c2efc3
[3.14] gh-141691: Apply ruff rules to Apple folder. (GH-141694) (#141728)
Add ruff configuration to run over the Apple build tooling and testbed script.
(cherry picked from commit 17636ba48c)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-11-18 23:14:31 +00:00
Sergey B Kirpichev
ed5c854c6a
[3.14] gh-141004: Document Py_HUGE_VAL/IS_FINITE/IS_INFINITE/IS_NAN (GH-141544) (#141698)
(cherry picked from commit 630cd37bfa)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-18 14:32:44 +01:00
Serhiy Storchaka
d89eb2f984
[3.14] gh-140873: Fix the singledispatchmethod documentation (GH-141523)
It does not support non-descriptor callables yet.
2025-11-18 13:16:39 +02:00
Miss Islington (bot)
3388413fc5
[3.14] Add missing backticks in os and decimal docs (GH-141699) (#141705)
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2025-11-18 10:37:49 +00:00
Miss Islington (bot)
cf2524f2b7
[3.14] gh-141004: Document Py_MEMCPY (GH-141676) (GH-141685)
gh-141004: Document `Py_MEMCPY` (GH-141676)
(cherry picked from commit 16ea9505ce)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-17 22:57:47 +00:00
Miss Islington (bot)
aa887aa2a8
[3.14] gh-141004: Document PyODict* APIs (GH-141136) (GH-141677)
gh-141004: Document `PyODict*` APIs (GH-141136)
(cherry picked from commit b3626321b6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-17 19:46:23 +00:00
Miss Islington (bot)
060118ae91
[3.14] gh-141497: Make ipaddress.IP{v4,v6}Network.hosts() always returning an iterator (GH-141547) (GH-141673)
(cherry picked from commit 6b1bdf6c7a)

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-11-17 17:56:55 +00:00
Serhiy Storchaka
8db1aadd65
[3.14] gh-130693: Add more tests for tkinter.Text.search() (GH-130848) (GH-141669) 2025-11-17 16:26:30 +00:00
Miss Islington (bot)
cc315dc6d4
[3.14] gh-130160: Add anchors to CLI Usage section for cmdline (GH-133182) (#141664)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-11-17 14:57:26 +00:00
Miss Islington (bot)
cf141ab1b8
[3.14] fix memory order of _Py_atomic_store_uint_release (GH-141562) (GH-141663)
(cherry picked from commit 7800b78067)

Co-authored-by: SubbaraoGarlapati <53627478+SubbaraoGarlapati@users.noreply.github.com>
2025-11-17 14:38:00 +00:00
Miss Islington (bot)
eeb5fbf5f7
[3.14] gh-141650: Fix typo in xml.sax.saxutils.unescape documentation (GH-141652) (#141654)
Co-authored-by: Tamzin Hadasa Kelly <tk.infinity@gmail.com>
2025-11-17 13:02:03 +00:00
Miss Islington (bot)
eead7b43bc
[3.14] gh-136057: Allow step and next to step over for loops (GH-136160) (#141640)
gh-136057: Allow step and next to step over for loops (GH-136160)
(cherry picked from commit 8be3b2f479)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-11-16 22:22:11 +00:00
Gregory P. Smith
0d8fb0b852
[3.14] gh-137109: refactor warning about threads when forking (GH-141438) (GH-141614)
This splits the OS API specific functionality to get the number of threads out
from the fallback Python method and warning raising code itself.  This way the
OS APIs can be queried before we've run
`os.register_at_fork(after_in_parent=...)` registered functions which
themselves may (re)start threads that would otherwise be detected.

This is best effort.  If the OS APIs are either unavailable or fail, the
warning generating code still falls back to looking at the Python threading
state after the CPython interpreter world has been restarted and the
after_in_parent calls have been made.  The common case for most Linux and macOS
environments should work today.

This also lines up with the existing TODO refactoring, we may choose to expose
this API to get the number of OS threads in the `os` module in the future.

Note: This is a simplified backport that maintains the void return type
for warn_about_fork_with_threads() and keeps PyErr_Clear() in the warning path,
as the error handling changes from fd8f42d3d1 are not needed in 3.14.
2025-11-16 19:45:29 +00:00
Tian Gao
58c9d25675
[3.14] gh-125115 : Refactor the pdb parsing issue so positional arguments can pass through (GH-140933) (#141635)
(cherry-picked from commit 5348c200f5)
2025-11-16 19:35:42 +00:00
Miss Islington (bot)
c9eb5cb1c0
[3.14] gh-141004: Document missing PyCFunction* and PyCMethod* APIs (GH-141253) (GH-141637)
gh-141004: Document missing `PyCFunction*` and `PyCMethod*` APIs (GH-141253)
(cherry picked from commit be699d6c7c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-16 19:31:25 +00:00
Miss Islington (bot)
10db8ee968
[3.14] gh-141004: Document the PyPickleBuffer_* C API (GH-141630) (GH-141632)
gh-141004: Document the `PyPickleBuffer_*` C API (GH-141630)
(cherry picked from commit e33afa7ddb)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-16 18:56:41 +00:00
Miss Islington (bot)
79c136f87b
[3.14] GH-141312: Allow only integers to longrangeiter_setstate state (GH-141317) (GH-141559)
This fixes an assertion error when the new computed start is not an integer.
(cherry picked from commit 10bec7c1eb)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-11-15 21:30:25 +02:00
Sergey Miryanov
21e43d5e83
[3.14] GH-141509: Fix warning about remaining subinterpreters (GH-141528) (GH-141566)
(cherry picked from commit fa245df4a0)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-15 13:56:52 -05:00
Miss Islington (bot)
8a67e3c2b0
[3.14] gh-140938: Raise ValueError for infinite inputs to stdev/pstdev (GH-141531) (#141575)
gh-140938: Raise ValueError for infinite inputs to stdev/pstdev (GH-141531)

Raise ValueError for infinite inputs to stdev/pstdev
(cherry picked from commit f0a8bc737a)



---

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-14 18:58:40 -08:00
Miss Islington (bot)
17e7aad5e3
[3.14] gh-141579: Fix perf_jit backend in sys.activate_stack_trampoline() (GH-141580) (#141581)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-11-15 02:49:54 +00:00
Miss Islington (bot)
d582b6f1ab
[3.14] gh-136442: Fix unittest to return exit code 5 when setUpClass raises an exception (GH-136487) (#141576)
gh-136442: Fix unittest to return exit code 5 when setUpClass raises an exception (GH-136487)
(cherry picked from commit 53d65c840e)

Co-authored-by: Takuya UESHIN <ueshin@happy-camper.st>
2025-11-15 01:25:19 +00:00
Gregory P. Smith
a2442fda6e
[3.14] GH-139596: Cease caching config.cache & ccache in GH Actions (#141429)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-14 21:25:33 +02:00
Miss Islington (bot)
1cde019ecd
[3.14] gh-114203: skip locking if object is already locked by two-mutex critical section (GH-141476) (#141564)
gh-114203: skip locking if object is already locked by two-mutex critical section (GH-141476)
(cherry picked from commit f26ed455d5)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-11-14 18:38:30 +00:00
Miss Islington (bot)
959578e5d1
[3.14] gh-140691: urllib.request: Close FTP control socket if data socket can't connect (GH-140835) (GH-141555)
(cherry picked from commit f2bce51b98)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: codenamenam <bluetire27@gmail.com>
2025-11-14 17:27:33 +01:00
Miss Islington (bot)
2f23c88243
[3.14] gh-139344: Remove pending removal notice for undeprecated importlib.resources API (GH-141507) (GH-141558)
(cherry picked from commit 49e74210cb)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-14 16:32:05 +01:00
Miss Islington (bot)
dbe64ee95f
Add PyManager troubleshooting steps for direct launch of script files (GH-141530)
(cherry picked from commit b101e9d36b)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-11-14 15:29:39 +00:00
Miss Islington (bot)
72a8ea773b
[3.14] gh-141004: Document PyOS_InterruptOccurred (GH-141526) (GH-141549)
gh-141004: Document `PyOS_InterruptOccurred` (GH-141526)
(cherry picked from commit ef90261be5)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-14 11:26:37 +00:00
Miss Islington (bot)
dd28db664b
[3.14] gh-137969: Fix double evaluation of ForwardRefs which rely on globals (GH-140974) (#141527)
gh-137969: Fix double evaluation of `ForwardRef`s which rely on globals (GH-140974)
(cherry picked from commit 209eaff68c)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
2025-11-13 13:26:58 -08:00
Mikhail Efimov
af20b880fc
[3.14] gh-140104: Set next_instr properly in the JIT during exceptions (GH-140233) (GH-141495) 2025-11-13 18:47:25 +00:00
Miss Islington (bot)
c5e0ce73f9
[3.14] gh-141004: Document PyErr_RangedSyntaxLocationObject (GH-141521) (#141525)
gh-141004: Document `PyErr_RangedSyntaxLocationObject` (GH-141521)

PyErr_RangedSyntaxLocationObject
(cherry picked from commit 196f1519cd)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-13 18:05:09 +00:00
Mikhail Efimov
48b7d75aaf
[3.14] gh-140936: Fix JIT assertion crash at finalization if some generator is alive (GH-140969) (GH-141494)
gh-140936: Fix JIT assertion crash at finalization if some generator is alive (GH-140969)
2025-11-13 16:11:57 +00:00
Miss Islington (bot)
425e423f9f
[3.14] gh-141004: Document PyCode_Optimize (GH-141378) (GH-141514)
gh-141004: Document `PyCode_Optimize` (GH-141378)
(cherry picked from commit d7862e9b1b)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-13 15:15:27 +00:00
Miss Islington (bot)
f43e5955eb
[3.14] gh-141004: Document C APIs for dictionary keys, values, and items (GH-141009) (GH-141512)
gh-141004: Document C APIs for dictionary keys, values, and items (GH-141009)
(cherry picked from commit f72768f30e)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-13 15:08:35 +00:00
Miss Islington (bot)
55cf97d8dd
[3.14] gh-140748: socket_helper.transient_internet: Unwrap UrlError.__cause__ (GH-140749) (GH-141505)
(cherry picked from commit 75a1cbdd38)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-13 13:58:37 +01:00
Miss Islington (bot)
7b8c257933
[3.14] gh-140601: Refactor ElementTree.iterparse() tests (GH-141499) (GH-141502)
Split existing tests on smaller methods and move them to separate class.
Rename variable "content" to "it".
Use BytesIO instead of StringIO.
Add few more tests.
(cherry picked from commit 2fbd396666)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-11-13 12:03:09 +00:00
Miss Islington (bot)
79195df23c
[3.14] gh-140260: fix data race in _struct module initialization with subinterpreters (GH-140909) (#141501)
gh-140260: fix data race in `_struct` module initialization with subinterpreters (GH-140909)
(cherry picked from commit 63548b3699)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-11-13 17:23:22 +05:30
Miss Islington (bot)
7e9400c3e6
[3.14] gh-103847: fix cancellation safety of asyncio.create_subprocess_exec (GH-140805) (#141446)
gh-103847: fix cancellation safety of `asyncio.create_subprocess_exec` (GH-140805)
(cherry picked from commit ef474cfafb)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-11-13 17:03:04 +05:30
Miss Islington (bot)
42e0468209
[3.14] gh-141004: Document PyRun_InteractiveOneObject (GH-141405) (GH-141485)
gh-141004: Document `PyRun_InteractiveOneObject` (GH-141405)
(cherry picked from commit 26b7df2430)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-12 22:58:52 +00:00
Miss Islington (bot)
0b44bc3379
[3.14] gh-124111: Fix TCL 9 thread detection (GH-141482)
(cherry picked from commit dc0987080e)

Co-authored-by: Michael Cho <michael@michaelcho.dev>
2025-11-12 22:43:31 +00:00
Miss Islington (bot)
4316180426
[3.14] gh-141442: Add escaping to iOS testbed arguments (GH-141443) (#141479)
Xcode concatenates the test argument array, losing quoting in the process.
(cherry picked from commit 558936bec1)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-11-12 22:15:34 +00:00
Miss Islington (bot)
996c00384d
[3.14] gh-141412: Use reliable target URL for urllib example (GH-141474)
The endpoint used for demonstrating reading URLs is no longer
stable. This change substitutes a target over which we have more
control.
(cherry picked from commit fbcac79951)

Co-authored-by: Bob Kline <bkline@users.noreply.github.com>
2025-11-12 18:40:20 +00:00
Miss Islington (bot)
fe3826cbaf
[3.14] gh-141004: Document Py_MATH_{E, PI, TAU} constants (GH-141373) (#141471)
gh-141004: Document `Py_MATH_{E, PI, TAU}` constants (GH-141373)
(cherry picked from commit f1330b35b8)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-12 17:02:38 +00:00
Miss Islington (bot)
24bf09b42c
[3.14] gh-141004: Document PyType_SUPPORTS_WEAKREFS (GH-141408) (GH-141470)
gh-141004: Document `PyType_SUPPORTS_WEAKREFS` (GH-141408)
(cherry picked from commit 9cd5427d96)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-12 16:44:17 +00:00
Miss Islington (bot)
ba73decce1
[3.14] gh-132657: add regression test for PySet_Contains with unhashable type (GH-141411) (#141468)
gh-132657: add regression test for `PySet_Contains` with unhashable type (GH-141411)
(cherry picked from commit 2ac738d325)

Co-authored-by: M Bussonnier <bussonniermatthias@gmail.com>
2025-11-12 15:49:09 +00:00
Mohsin Mehmood
92c14a91d2
[3.14] gh-141314: Fix TextIOWrapper.tell() assertion failure with standalone carriage return (GH-141331) (GH-141453)
The assertion was checking wrong variable (skip_back vs skip_bytes).
(cherry picked from commit af80fac425)
2025-11-12 12:40:02 +02:00
Miss Islington (bot)
e9c11b7495
[3.14] gh-141042: fix sNaN's packing for mixed floating-point formats (GH-141107) (#141459)
gh-141042: fix sNaN's packing for mixed floating-point formats (GH-141107)
(cherry picked from commit 23d85a2a3f)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-11-12 10:33:34 +00:00
Miss Islington (bot)
75b5157e84
[3.14] gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333) (GH-141457)
Fix error in assertion which causes failure if pos is equal to PY_SSIZE_T_MAX.
Fix undefined behavior in read() and readinto() if pos is larger that the size
of the underlying buffer.
(cherry picked from commit 7d54374f9c)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-11-12 10:23:26 +00:00
Miss Islington (bot)
b883ad17cd
[3.14] gh-141370: document undefined behavior of Py_ABS() (GH-141439) (GH-141454)
(cherry picked from commit 20f53df07d)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-11-12 09:56:47 +00:00
Peter Bierma
604a5a6a11
[3.14] gh-141004: Document PyBytes_Repr and PyBytes_DecodeEscape (GH-141407) (GH-141440)
* gh-141004: Document `PyBytes_Repr` and `PyBytes_DecodeEscape` (GH-141407)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
(cherry picked from commit 37e2762ee1)
2025-11-12 02:06:36 +00:00
Miss Islington (bot)
df045716e0
[3.14] GH-137618: Require Python 3.10 to Python 3.15 for PYTHON_FOR_REGEN (GH-137619) (#141437)
GH-137618: Require Python 3.10 to Python 3.15 for PYTHON_FOR_REGEN (GH-137619)

* Require Python 3.11 to Python 3.15 for PYTHON_FOR_REGEN

* NEWS

* keep allowing python 3.10

---------
(cherry picked from commit 9ce99c6c19)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-11-11 17:33:49 -08:00
Miss Islington (bot)
947354e338
[3.14] gh-138621: Increase test coverage for csv.DictReader and csv.Sniffer (GH-138622) (#141436)
gh-138621: Increase test coverage for csv.DictReader and csv.Sniffer (GH-138622)

* Increase test coverage for csv.DictReader and csv.Sniffer

Previously there were no tests for the DictReader fieldnames
setter, the case where a StopIteration was encountered when trying
to determine the fieldnames from the content or the case where
Sniffer could not find a delimiter.

* Revert whitespace change to comment

* Add a test that csv.Sniffer.has_header checks up to 20 rows

* Replace name and age with letter and offset



* Address review comment

---------
(cherry picked from commit 0e88be6f55)

Co-authored-by: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-11-12 00:58:15 +00:00
Miss Islington (bot)
21c9c919aa
[3.14] gh-137952: update csv.Sniffer().has_header() docs to describe the actual off-by-onish behavior (GH-137953) (#141434)
gh-137952: update `csv.Sniffer().has_header()` docs to describe the actual off-by-onish behavior (GH-137953)

* checks 21, not 20
* Say "header" instead of "first row" to disambiguate per review.

---------
(cherry picked from commit 0d7b48a8f5)

Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-11 16:13:10 -08:00
Miss Islington (bot)
83c3eae099
[3.14] gh-138775: fix handle python -m base64 stdin correct with EOF signal (GH-138776) (#141432)
gh-138775: fix handle `python -m base64` stdin correct with EOF signal (GH-138776)

* fix: handle  stdin correct with EOF single.
* fix: flollow the comments when pipe stdin use buffer
* Apply suggestions from code review
* fix: apply review comments in Lib/base64.py
* fix: address comments
* Reword comment and NEWS entry.

---------
(cherry picked from commit f5c2a41f9a)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-11-12 00:12:57 +00:00
Miss Islington (bot)
91f33ef3c8
[3.14] gh-141004: Document PyFile_OpenCode and PyFile_OpenCodeObject (GH-141413) (GH-141425)
gh-141004: Document `PyFile_OpenCode` and `PyFile_OpenCodeObject` (GH-141413)
(cherry picked from commit 2befce86e6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-11 16:48:29 -05:00
Miss Islington (bot)
03fca07f83
Add documentation for Python install manager's install_dir, global_dir and download_dir (GH-140223)
(cherry picked from commit 336154f4b0)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-11-11 20:08:52 +00:00
Miss Islington (bot)
dc00dcfe88
[3.14] gh-140193: Forward port test_exec_set_nomemory_hang from 3.13 (GH-140187) (#141420)
gh-140193: Forward port test_exec_set_nomemory_hang from 3.13 (GH-140187)

* chore: test_exec_set_nomemory_hang from 3.13
* fix: apply comments
* Update Lib/test/test_exceptions.py
* Update Lib/test/test_exceptions.py
* fix: windows too long name 60 times is enough

---------
(cherry picked from commit 0f09bda643)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-11 19:53:31 +00:00
Miss Islington (bot)
7618a40a17
[3.14] gh-139533: fix refs to code without proper markups on turtledemo doc (GH-139534) (#141421)
gh-139533: fix refs to code without proper markups on turtledemo doc (GH-139534)
(cherry picked from commit c903d76832)


gh-139533: fix refs to code without proper markups on turtledemo documentation

Co-authored-by: Marco Barbosa <aureliobarbosa@gmail.com>
2025-11-11 19:42:13 +00:00
Miss Islington (bot)
068bddce88
[3.14] gh-141004: Document PyType_Unwatch (GH-141414) (GH-141418)
gh-141004: Document `PyType_Unwatch` (GH-141414)
(cherry picked from commit 759a048d4b)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-11 17:28:14 +00:00
Sergey B Kirpichev
8b9494099a
[3.14] gh-141004: document Py_INFINITY and Py_NAN macros (GH-141145) (#141399)
(cherry picked from commit d69447445c)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-11 14:52:37 +01:00
Miss Islington (bot)
a468ba0a9d
[3.14] gh-140379: add hyperlinks to list and set (GH-140399) (#141386)
gh-140379: add hyperlinks to list and set (GH-140399)

add hyperlinks to list and set
(cherry picked from commit 92741c59f8)

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-11-11 06:08:45 +00:00
Miss Islington (bot)
ec836f2ad6
[3.14] gh-140485: Catch ChildProcessError in multiprocessing resource tracker (GH-141132) (#141384)
gh-140485: Catch ChildProcessError in multiprocessing resource tracker (GH-141132)
(cherry picked from commit 9cb8c52d5e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-11 05:24:24 +00:00
Miss Islington (bot)
6d31d085f0
[3.14] gh-140578: Doc: Remove sencence implying that concurrent.futures.ThreadPoolExecutor does not exist (GH-140689) (#141382)
gh-140578: Doc: Remove sencence implying that concurrent.futures.ThreadPoolExecutor does not exist (GH-140689)

* Doc: Remove sencence implying that concurrent.futures.ThreadPoolExecutor does not exist

Closes GH-140578

* Add NEWS.d entry for gh-140578

---------
(cherry picked from commit 46b58e1bb9)

Co-authored-by: Louis <paternal@users.noreply.github.com>
Co-authored-by: Louis Paternault <spalax@gresille.org>
2025-11-11 04:56:07 +00:00
Miss Islington (bot)
462e2255ef
[3.14] gh-141174: Improve annotationlib._Stringifier test coverage (GH-141220) (#141358)
gh-141174: Improve `annotationlib._Stringifier` test coverage (GH-141220)

* Test `_Stringifier.__convert_to_ast()` for containers

* Test partial evaluation of `ForwardRef`s in `_Stringifier`
(cherry picked from commit 55ea132313)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
2025-11-10 21:44:05 +00:00
Miss Islington (bot)
9a5cf6f62c
[3.14] gh-141004: Document missing frame APIs (GH-141189) (GH-141379)
gh-141004: Document missing frame APIs (GH-141189)
(cherry picked from commit 86513f6c2e)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-10 21:42:10 +00:00
Miss Islington (bot)
96820d872f
[3.14] gh-141004: Document PyType_FastSubclass (GH-141313) (GH-141368)
gh-141004: Document `PyType_FastSubclass` (GH-141313)
(cherry picked from commit ed0a5fd8ca)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-10 17:52:15 +00:00
Miss Islington (bot)
9f42519431
[3.14] GH-141212: Fix possible memory leak in gc_mark_span_push (gh-141213) (gh-141364)
(cherry picked from commit f835552946)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-11-10 16:55:01 +00:00
Miss Islington (bot)
63a3737ce7
[3.14] gh-139707: Specify winreg, msvcrt and winsound module availability in docs (GH-140429) (GH-141351)
(cherry picked from commit 13fa313beb)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-10 17:40:46 +01:00
Miss Islington (bot)
a1889959d3
[3.14] gh-141174: Improve ForwardRef test coverage (GH-141175) (#141354)
gh-141174: Improve `ForwardRef` test coverage (GH-141175)

* Test unsupported format in ForwardRef.evaluate()

* Test dict cell closure with multiple variables

* Test all options in ForwardRef repr

* Test ForwardRef being a final class
(cherry picked from commit 19b573025e)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
2025-11-10 15:19:54 +00:00
Miss Islington (bot)
4b9ed4e642
[3.14] gh-141174: Improve annotationlib.call_annotate_function() test coverage (GH-141176) (#141355)
gh-141174: Improve `annotationlib.call_annotate_function()` test coverage (GH-141176)

* Test passing unsupported Format values to call_annotate_function()

* Test call_evaluate_function with fake globals that raise errors

* Fix typo and comparison in test_fake_global_evaluation
(cherry picked from commit 1110e8f6a4)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
2025-11-10 15:19:48 +00:00
Jelle Zijlstra
727cdcba8e
[3.14] gh-137530: generate an __annotate__ function for dataclasses __init__ (GH-137711) (#141352)
(cherry picked from commit 12837c6363)

Co-authored-by: David Ellis <ducksual@gmail.com>
2025-11-10 07:14:32 -08:00
Miss Islington (bot)
9221030909
[3.14] gh-141174: Improve annotationlib.get_annotations() test coverage (GH-141286) (#141353)
gh-141174: Improve `annotationlib.get_annotations()` test coverage (GH-141286)

* Test `get_annotations(format=Format.VALUE)` for stringized annotations on custom objects

* Test `get_annotations(format=Format.VALUE)` for stringized annotations on wrapped partial functions

* Update test_stringized_annotations_with_star_unpack() to actually test stringized annotations

* Test __annotate__ returning a non-dict

* Test passing globals and locals to stringized `get_annotations()`
(cherry picked from commit 06b62282c7)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
2025-11-10 15:11:42 +00:00
Miss Islington (bot)
7618754d53
[3.14] gh-141343: Fix swapped words in sorted doc (GH-141357)
(cherry picked from commit 59b793b0dd)

Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-11-10 15:01:30 +00:00
Stan Ulbrych
c12a0bef40
[3.14] gh-139707: Add docs for optional modules (GH-140171) (GH-141204)
(cherry picked from commit d2ce6d708a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Author: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-10 15:20:00 +01:00
Miss Islington (bot)
44a3d6c69b
[3.14] gh-140500: Update download.html instructions (GH-141320) (#141347)
Co-authored-by: Karina Souza <97332018+KarinaS0uza@users.noreply.github.com>
Co-authored-by: Joseph Anthony Pasquale Holsten <joseph@josephholsten.com>
2025-11-10 12:45:48 +00:00
Miss Islington (bot)
c09a65914d
[3.14] gh-141004: Document pyctype.h macros (GH-141272) (GH-141340)
gh-141004: Document `pyctype.h` macros (GH-141272)
(cherry picked from commit df19261621)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-10 10:12:55 +00:00
Miss Islington (bot)
b5ae8082a6
[3.14] gh-141004: Document Py_DTSF_* macros (GH-141310) (GH-141329)
gh-141004: Document `Py_DTSF_*` macros (GH-141310)
(cherry picked from commit 9b0179fa87)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-10 00:48:48 +00:00
Miss Islington (bot)
6cbb8cb1f7
[3.14] gh-62480: De-personalize "Partial mocking" section in unittest.mock examples (GH-141321) (#141326)
gh-62480: De-personalize "Partial mocking" section in `unittest.mock` examples (GH-141321)

* Refine some wording in unittest partial mock doc

Some of the descriptions were addressed in first person,
but have now been changed to address the user reading the documentation instead.
(cherry picked from commit b618731781)

Co-authored-by: KarnbirKhera <166065758+KarnbirKhera@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2025-11-09 18:08:30 -06:00
Miss Islington (bot)
5c345ed61a
[3.14] gh-62480: De-personalize "Mocking Unbound Methods" section in unittest.mock examples (GH-141322) (#141324)
gh-62480: De-personalize "Mocking Unbound Methods" section in `unittest.mock` examples (GH-141322)

* Rewrite Mocking Unbound Methods paragraph to second person
(cherry picked from commit ec85d3cbfe)

Co-authored-by: Elena O <31424287+oklena@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-09 17:51:07 -06:00
Miss Islington (bot)
6e659bf645
[3.14] gh-141004: Document PySuper_Type (GH-141315) (GH-141318)
gh-141004: Document `PySuper_Type` (GH-141315)
(cherry picked from commit 14c62227f9)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-09 20:01:04 +00:00
Miss Islington (bot)
86c63099ed
[3.14] gh-140980: document SET_FUNCTION_ATTRIBUTE flag for annotate function (GH-141306) (#141316)
gh-140980: document `SET_FUNCTION_ATTRIBUTE` flag for `annotate` function  (GH-141306)
(cherry picked from commit 6f20ea1e2d)

Co-authored-by: Lakshya Upadhyaya <lakshya.upadhyaya05@gmail.com>
2025-11-09 19:04:48 +00:00
Miss Islington (bot)
428f787d58
[3.14] gh-141004: Document PyClassMethod* and PyStaticMethod* APIs (GH-141296) (GH-141308)
gh-141004: Document `PyClassMethod*` and `PyStaticMethod*` APIs (GH-141296)
(cherry picked from commit 807db68ddd)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-09 18:09:39 +00:00
Miss Islington (bot)
86824651bc
[3.14] gh-141004: Document PyFunction_SetKwDefaults (GH-141294) (GH-141304)
gh-141004: Document `PyFunction_SetKwDefaults` (GH-141294)
(cherry picked from commit 18529b580b)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-09 17:55:09 +00:00
Miss Islington (bot)
42878e862a
[3.14] gh-141004: Document PyExceptionInstance* APIs (GH-141301) (GH-141302)
gh-141004: Document `PyExceptionInstance*` APIs (GH-141301)
(cherry picked from commit b5a0c72492)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-09 12:20:24 -05:00
Miss Islington (bot)
a8b27305e8
[3.14] gh-141004: Document Py_func_type_input (GH-141273) (GH-141298)
gh-141004: Document `Py_func_type_input` (GH-141273)
(cherry picked from commit 8dd8498286)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-09 16:27:53 +00:00
Miss Islington (bot)
d7aace78e9
[3.14] gh-140530: fix a reference leak in an error path for raise exc from cause (GH-140908) (#141282)
gh-140530: fix a reference leak in an error path for `raise exc from cause` (GH-140908)

Fix a reference leak in `raise E from T` when `T` is an exception
subtype for which `T.__new__` does not return an exception instance.
(cherry picked from commit 0c77e7c23b)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-09 17:04:26 +01:00
Miss Islington (bot)
cb458715a6
[3.14] gh-141004: document curses C API (GH-141254) (#141292)
gh-141004: document `curses` C API (GH-141254)
(cherry picked from commit dbe40904a7)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-09 15:50:21 +00:00
Miss Islington (bot)
afa52a101e
[3.14] gh-141004: Document PyWeakref_CheckRefExact (GH-141279) (GH-141290)
gh-141004: Document `PyWeakref_CheckRefExact` (GH-141279)
(cherry picked from commit 60155329a0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-09 15:40:20 +00:00
Miss Islington (bot)
7905374d50
[3.14] gh-141004: Document deprecated aliases for memory allocation (GH-141146) (GH-141288)
gh-141004: Document deprecated aliases for memory allocation (GH-141146)
(cherry picked from commit 1d738dea63)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-09 15:12:52 +00:00
Miss Islington (bot)
d6b4f4b10f
[3.14] gh-100218: correctly set errno when socket.if_{nametoindex,indextoname} raise OSError (GH-140905) (#141284)
gh-100218: correctly set `errno` when `socket.if_{nametoindex,indextoname}` raise `OSError` (GH-140905)

Previously, socket.if_nametoindex() and socket.if_indextoname() could raise
an `OSError` with a `None` errno. Now, the errno from libc is propagated.
(cherry picked from commit 3ce2d57b2f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-09 13:11:43 +00:00
Miss Islington (bot)
432432bfc8
[3.14] gh-141127: Clarify os.symlink() documentation for argument order (GH-141144) (#141278)
gh-141127: Clarify os.symlink() documentation for argument order (GH-141144)
(cherry picked from commit 7ae440f262)

Co-authored-by: Chilla Kalyan <127284726+chillakalyan@users.noreply.github.com>
2025-11-09 11:19:09 +01:00
Miss Islington (bot)
d8a2b8a4f8
[3.14] gh-141004: Document Py_BUILD_ASSERT* macros (GH-141266) (GH-141269)
gh-141004: Document `Py_BUILD_ASSERT*` macros (GH-141266)
(cherry picked from commit 0ac890bea7)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-08 19:27:41 +00:00
Miss Islington (bot)
f98211852a
[3.14] gh-141004: Document the PyDoc_VAR macro (GH-141263) (GH-141264)
gh-141004: Document the `PyDoc_VAR` macro (GH-141263)
(cherry picked from commit 545299773b)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-08 18:18:04 +00:00
Miss Islington (bot)
ba0b8214ea
[3.14] gh-141004: Document PyBUF_WRITEABLE (GH-141255) (GH-141261)
gh-141004: Document `PyBUF_WRITEABLE` (GH-141255)
(cherry picked from commit 5e5fc0404e)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-08 17:36:00 +00:00
Miss Islington (bot)
6c50a72efe
[3.14] gh-141004: Document PyErr_ProgramTextObject and PyErr_ProgramText (GH-141250) (GH-141256)
gh-141004: Document `PyErr_ProgramTextObject` and `PyErr_ProgramText` (GH-141250)
(cherry picked from commit be1c72a45d)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-08 15:54:06 +00:00
Miss Islington (bot)
7db06be57f
[3.14] gh-141246: Link to correct Windows docs in time.sleep() doc (GH-141248) (#141251)
gh-141246: Link to correct Windows docs in `time.sleep()` doc (GH-141248)
(cherry picked from commit 6545a4e8f8)

Co-authored-by: 莯凛 <1348292515@qq.com>
2025-11-08 15:02:35 +00:00
Miss Islington (bot)
41944be1e1
[3.14] gh-141004: correctly document Py_HASH_* and PyHASH_* as hash_info attributes (GH-141233) (#141234)
gh-141004: correctly document `Py_HASH_*` and `PyHASH_*` as `hash_info` attributes (GH-141233)
(cherry picked from commit 87942d911b)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-08 12:28:01 +00:00
Serhiy Storchaka
1a080199af
[3.14] gh-140615: Update docstrings in the fcntl module (GH-140619) (GH-141231)
* Refer to bytes objects or bytes-like objects instead of strings.
* Remove backticks -- they do not have effect on formatting.
* Re-wrap lines to ensure the pydoc output fits in 80 columns.
(cherry picked from commit 610377056b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-11-08 11:16:45 +00:00
Miss Islington (bot)
24619962e0
[3.14] gh-140793: Improve documentatation and tests for the ensure_ascii option in the json module (GH-140906) (GH-141227)
* Document that ensure_ascii=True forces escaping not only non-ASCII, but also
  non-printable characters (the only affected ASCII character is U+007F).
* Ensure that the help output for the json module does not exceed 80
  columns (except one long line in an example and generated lines).
* Add more tests.
(cherry picked from commit 7e90bac3cc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-11-08 10:32:44 +00:00
Miss Islington (bot)
de00dde9de
[3.14] gh-141004: Document Py_HASH_* macros (GH-141205) (#141225)
* gh-141004: Document `Py_HASH_*` macros (GH-141205)

(cherry picked from commit 3989e12d39)
(cherry picked from commit 8cec3d3a9d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-08 09:19:34 +00:00
Miss Islington (bot)
5dc8ecc5bc
[3.14] gh-141004: Document PyTraceBack* APIs (GH-141192) (GH-141210)
gh-141004: Document `PyTraceBack*` APIs (GH-141192)
(cherry picked from commit d13ee0ae18)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-07 18:52:45 +00:00
Hugo van Kemenade
b3377c3b41
[3.14] gh-140826: Update winreg's docstring (GH-141050) (GH-141200)
(cherry picked from commit bea0d3d12b)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-11-07 20:38:26 +02:00
Miss Islington (bot)
b59832041a
[3.14] gh-141004: Document PyErr_WarnExplicitFormat (GH-141187) (GH-141202)
gh-141004: Document `PyErr_WarnExplicitFormat` (GH-141187)
(cherry picked from commit 9420795b47)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-07 16:26:40 +00:00
Miss Islington (bot)
9f8ec95bb0
[3.14] gh-141004: Document PyCapsule_Type (GH-141079) (GH-141199)
gh-141004: Document `PyCapsule_Type` (GH-141079)
(cherry picked from commit 7af9b5354d)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-07 14:16:43 +00:00
Miss Islington (bot)
28493a5a62
[3.14] Update NaNs handling description in c-api/float.rst (GH-141179) (#141194)
Update NaNs handling description in `c-api/float.rst` (GH-141179)

Clarified the behavior of NaNs on IEEE platforms regarding signaling and quiet NaNs.
(cherry picked from commit 920286d6b2)

Co-authored-by: W. H. Wang <mattwang44@gmail.com>
2025-11-07 13:40:59 +00:00
Miss Islington (bot)
7c3539bd09
[3.14] Clarify argument/result ownership/validity for PyModule_* functions (GH-141159) (GH-141190)
(cherry picked from commit ffd64737d0)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-07 13:23:29 +00:00
Miss Islington (bot)
d729087c06
[3.14] gh-139246: zero-width word paste can be wrong in default repl (GH-139254) (GH-140796)
gh-139246: zero-width word paste can be wrong in default repl (GH-139254)

(cherry picked from commit 4e6dba0ef7)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: grayjk <grayjk@gmail.com>
2025-11-07 13:50:06 +01:00
Miss Islington (bot)
cb8b2bad34
[3.14] gh-141141: Make base64.b85decode() thread safe (GH-141149) (GH-141184)
(cherry picked from commit a7bf27f7f5)

Co-authored-by: Benel Tayar <86257734+beneltayar@users.noreply.github.com>
2025-11-07 11:14:51 +00:00
Miss Islington (bot)
cf48ead02b
[3.14] gh-140734: fix off-by-one error when comparing to _SUN_PATH_MAX (GH-140903) (#141181)
gh-140734: fix off-by-one error when comparing to `_SUN_PATH_MAX` (GH-140903)

The limit includes a NULL terminator.
(cherry picked from commit 9a19900673)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-07 10:27:14 +00:00
Miss Islington (bot)
a49d0ccdb8
[3.14] gh-141125: delete unused import textwrap in interpreter.py (GH-141126) (#141177)
gh-141125: delete unused import textwrap in interpreter.py (GH-141126)
(cherry picked from commit c77441ef1d)

Co-authored-by: yihong <zouzou0208@gmail.com>
2025-11-07 00:29:25 +00:00
Miss Islington (bot)
229846e841
[3.14] Minor documentation improvements (GH-140626) (#141160)
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2025-11-06 17:19:30 +00:00
Miss Islington (bot)
5c2476a4c9
[3.14] gh-141004: Document Py_GetRecursionLimit and Py_SetRecursionLimit (GH-141151) (GH-141156)
gh-141004: Document `Py_GetRecursionLimit` and `Py_SetRecursionLimit` (GH-141151)
(cherry picked from commit 0b260305d3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-06 16:45:31 +00:00
Stan Ulbrych
ebf54596bf
[3.14] gh-140939: Fix memory leak in _PyBytes_FormatEx error path (GH-140957) (#141154)
(cherry picked from commit d6c89a2df2)
2025-11-06 16:20:03 +00:00
Miss Islington (bot)
5d10409e33
[3.14] gh-141004: Document PyLong_FromPid and PyLong_AsPid (GH-141028) (GH-141142)
gh-141004: Document `PyLong_FromPid` and `PyLong_AsPid` (GH-141028)
(cherry picked from commit bcc524f82d)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-06 14:07:56 +00:00
Miss Islington (bot)
eac7b9fa97
[3.14] gh-141004: Document Py_hexdigits (GH-141059) (GH-141138)
gh-141004: Document `Py_hexdigits` (GH-141059)
(cherry picked from commit 54110e20e0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-06 13:56:41 +00:00
Miss Islington (bot)
cd5508d322
[3.14] gh-141004: Document built-in iterator types in the C API (GH-141006) (GH-141134)
gh-141004: Document built-in iterator types in the C API (GH-141006)

Adds documentation for each of the following:

- PyEnum_Type
- PyFilter_Type
- PyMap_Type
- PyReversed_Type
- PyZip_Type

In addition, PyRange_Type and PyRange_Check are also documented.
(cherry picked from commit 1697cb5710)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-06 12:35:02 +00:00
Hugo van Kemenade
7168553c00
[3.14] gh-138189: Document type slots, and other constants, as part of Limited API (GH-138190) (GH-141131)
(cherry picked from commit d81e1ef0f3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-06 12:39:19 +01:00
Serhiy Storchaka
fd17ee026f
[3.14] gh-125346: Add more base64 tests (GH-141061) (GH-141130)
Add more tests for the altchars argument of b64decode() and for the map01
argument of b32decode().
(cherry picked from commit 13360efd38)
2025-11-06 11:03:59 +00:00
Miss Islington (bot)
6d5636c7c6
[3.14] gh-137232: Update free-threading HOWTOs with up-to-date info for 3.14 (GH-140817) (#141129)
(cherry picked from commit 86ab7bb87a)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2025-11-06 10:25:50 +00:00
Hugo van Kemenade
8f0581c077
[3.14] Add FFY00 to CODEOWNERS for generate-build-details (GH-139561) (#141080)
Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
2025-11-06 11:18:46 +02:00
Miss Islington (bot)
47ede24d49
[3.14] Minor fixes to idle.rst and regenerate help.html (GH-140037) (#141121)
Minor fixes to `idle.rst` and regenerate `help.html` (GH-140037)
(cherry picked from commit 4e6e208be9)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-06 08:51:28 +00:00
Miss Islington (bot)
45cc56c588
[3.14] gh-129876: Move misplaced IDLE news item (GH-141118) (#141119)
gh-129876: Move misplaced IDLE news item (GH-141118)
(cherry picked from commit 6a7c969d00)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-11-06 03:34:06 -05:00
Miss Islington (bot)
f2353d60db
[3.14] gh-140569: recommend the new REPL in the asyncio REPL docs (GH-140570) (#141115)
gh-140569: recommend the new REPL in the asyncio REPL docs (GH-140570)
(cherry picked from commit 8822166200)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-06 05:46:15 +00:00
Stan Ulbrych
12847bfff7
[3.14] Fix Queue.shutdown docs for condition to unblock a join (gh-137088) (#141073)
(cherry picked from commit ea06ae5b5e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2025-11-06 11:11:31 +05:30
Miss Islington (bot)
9878611f28
[3.14] gh-118516: clarify that subprocess are automatically killed if transport gets garbage collected (GH-140997) (#141110)
gh-118516: clarify that subprocess are automatically killed if transport gets garbage collected (GH-140997)
(cherry picked from commit 101c9c0a21)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-11-06 10:34:27 +05:30
Miss Islington (bot)
00087dc466
[3.14] GH-108009: Add clarification of parser and argument defaults in argparse docs (GH-124154) (#141084)
GH-108009: Add clarification of parser and argument defaults in argparse docs (GH-124154)
(cherry picked from commit 95f6e1275b)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2025-11-05 22:52:22 +00:00
Miss Islington (bot)
5561837085
[3.14] gh-141004: Document PyDict_GET_SIZE (GH-141078) (GH-141082)
gh-141004: Document `PyDict_GET_SIZE` (GH-141078)
(cherry picked from commit f0ab07f22c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-05 22:38:20 +00:00
Miss Islington (bot)
f35a6e14f3
[3.14] gh-76007: remove curses.__version__ doc (GH-141052) (#141076)
Co-authored-by: Zenith <me@arielle.codes>
2025-11-05 22:06:27 +00:00
Miss Islington (bot)
090c0f1403
[3.14] gh-141004: Document Py_RETURN_NAN and Py_RETURN_INF (GH-141029) (GH-141074)
gh-141004: Document `Py_RETURN_NAN` and `Py_RETURN_INF` (GH-141029)
(cherry picked from commit 5b02c6e920)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-11-05 22:05:47 +00:00
Miss Islington (bot)
11eecde7a5
[3.14] Fix typo in Apple/__main__.py (GH-141038) (#141039)
Corrected a typo in a return value docstring.
(cherry picked from commit 335d83ec04)

Co-authored-by: Lê Nam Khánh <55955273+khanhkhanhlele@users.noreply.github.com>
2025-11-06 05:53:11 +08:00
Stan Ulbrych
52f15231f0
[3.14] Docs: replace an esoteric Von Neumann mention (GH-137598) (#141071)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-11-05 23:20:17 +02:00
Victor Stinner
36e9f672f2
[3.14] Fix compiler warnings in remote debugging (#141060) (#141067)
Fix compiler warnings in remote debugging (#141060)

Example of fixed warnings on 32-bit Windows:

    Python\remote_debugging.c(24,53): warning C4244: 'function':
    conversion from 'uint64_t' to 'uintptr_t', possible loss of data

    Modules\_remote_debugging_module.c(789,44): warning C4244:
    'function': conversion from 'uint64_t' to 'size_t', possible loss
    of data

(cherry picked from commit f458ac01ba)
2025-11-05 19:49:39 +00:00
Miss Islington (bot)
8675f55f6a
[3.14] Fix a compiler warning in _randommodule.c (GH-141058) (#141063)
Fix a compiler warning in _randommodule.c (GH-141058)

The test just before the cast ensures that the cast cannot overflow.

Fix the warning on 32-bit Windows:

    Modules\_randommodule.c(525,28): warning C4244: '=': conversion
    from 'uint64_t' to 'Py_ssize_t', possible loss of data
(cherry picked from commit 4ac16dd109)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-05 19:10:32 +00:00
Miss Islington (bot)
fa8f46412f
[3.14] gh-139313: Improve docs on XML security (GH-139460) (GH-141065)
Clarify that:
- it takes parsing for an attack
- that some doors are closed by default
- only Expat version 2.7.2 has all the fixes
- use of the bundle depends on configuration
(cherry picked from commit baa9f33897)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2025-11-05 19:07:03 +00:00
Miss Islington (bot)
19ba59369e
[3.14] Docs: Fix cached calls count in factorial example (gh-140882) (gh-141031)
Co-authored-by: Clifford Gama <cliffygamy@gmail.com>
2025-11-05 12:14:12 -06:00
Miss Islington (bot)
378912975b
[3.14] gh-141004: Document PyMemoryView_Type (GH-141034) (GH-141054)
gh-141004: Document `PyMemoryView_Type` (GH-141034)
(cherry picked from commit 3f6aca1be4)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-05 16:51:34 +00:00
Miss Islington (bot)
39ca786918
[3.14] gh-141004: Document missing iterator types in the C API (GH-141010) (GH-141046)
gh-141004: Document missing iterator types in the C API (GH-141010)

Add documentation for each of the following:

- PyByteArrayIter_Type
- PyBytesIter_Type
- PyListIter_Type
- PyListRevIter_Type
- PySetIter_Type
- PyTupleIter_Type
- PyRangeIter_Type
- PyLongRangeIter_Type
- PyDictIterKey_Type
- PyDictRevIterKey_Type
- PyDictIterValue_Type
- PyDictRevIterValue_Type
- PyDictIterItem_Type
- PyDictRevIterItem_Type

---------
(cherry picked from commit 35528fccdc)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-05 14:20:04 +00:00
Hugo van Kemenade
43eaf9984a
[3.14] Omit Python/perf_jit_trampoline.c from the **/*jit* CODEOWNERS rule (GH-136519) (#140987)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2025-11-05 14:24:10 +02:00
Miss Islington (bot)
2511fce2ef
[3.14] gh-141007: update string module source code link (GH-141008) (#141030)
gh-141007: update string module source code link (GH-141008)

In 3.14, the former string.py became `__init__.py` within a new `string` directory that also contains a new submodule file, `templatelib.py`.
(cherry picked from commit fa02422918)

Co-authored-by: alex <30386655+alexomics@users.noreply.github.com>
2025-11-05 00:11:42 +00:00
Miss Islington (bot)
7ab08d2c51
[3.14] gh-141004: Document Py_UNICODE_{HIGH, LOW}_SURROGATE functions (GH-141019) (GH-141027)
gh-141004: Document `Py_UNICODE_{HIGH, LOW}_SURROGATE` functions (GH-141019)
(cherry picked from commit bfe54810c4)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-04 21:33:52 +00:00
Filip Łajszczak
dc76de26e5
[3.14] gh-139434: Update selected RFC 2822 references to RFC 5322 (GH-139435) (#141025)
Update selected RFC 2822 references to RFC 5322

RFC 2822 was obsoleted by RFC 5322 in 2008. This updates references
to use the current standard in documentation, docstrings, and comments.

It preserves RFC 2822 references in legacy API components to maintain their
historical context.

RFC 822 → RFC 2822 → RFC 5322 progression is explained where relevant.

In some places specific sections of RFC are referenced where it seems helpful.

Scout rule was applied in some places and RFC mentions format was
normalized in doc strings and comments.
(cherry picked from commit ce1bb85d28)
2025-11-04 16:23:16 -05:00
Chris Eibl
f0eb7d4c9a
[3.14] gh-140513: Fail to compile if _Py_TAIL_CALL_INTERP is set but preserve_none and musttail do not exist (GH-140548) (#140923)
gh-140513: Fail to compile if `_Py_TAIL_CALL_INTERP` is set but `preserve_none` and `musttail` do not exist. (GH-140548)


(cherry picked from commit 2f60b8f02f)

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-11-04 20:43:18 +00:00
Miss Islington (bot)
d82d340096
[3.14] Docs: Fix typo in email.headerregistry.rst (GH-140965) (#141020)
Docs: Fix typo in `email.headerregistry.rst` (GH-140965)

Fix missing 'Header' suffix on header class name in `email.headerregistry.rst`
(cherry picked from commit 97d8dda980)

Co-authored-by: Guo Ci <zguoci@gmail.com>
2025-11-04 19:35:20 +00:00
Miss Islington (bot)
4358b8417f
[3.14] gh-134817: Restore accidentally deleted line in documentation. (GH-141013) (GH-141016)
(cherry picked from commit 66c86c6563)
2025-11-04 18:40:12 +00:00
Miss Islington (bot)
52f18790eb
[3.14] Document that returning sys.monitoring.DISABLE in response to a global event raises ValueError (GH-140726) (GH-141014)
Document that returning `sys.monitoring.DISABLE` in response to a global event raises `ValueError` (GH-140726)
(cherry picked from commit 8a7dbb7a68)

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-04 18:34:04 +00:00
Miss Islington (bot)
267af29832
[3.14] gh-140979: Fix off-by-one error in the RE code validator (GH-140984) (GH-141001)
It was too lenient and allowed MARK opcodes with too large value.
(cherry picked from commit 1326d2a808)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-11-04 18:16:51 +02:00
AN Long
c3f9702f04
[3.14] gh-140826 Remove the wrong documents about comparison behavior on winreg.HKEYType (GH-140999) 2025-11-04 16:14:44 +00:00
Miss Islington (bot)
5b88a6533c
[3.14] Fix minor typo: 'web site' -> 'website' (GH-140561) (GH-140976)
(cherry picked from commit 08115d241a)

Co-authored-by: commitWithTisha <tishaa1010@gmail.com>
2025-11-04 14:11:08 +01:00
Miss Islington (bot)
e5266fcac8
[3.14] gh-140797: Forbid capturing groups in re.Scanner lexicon patterns (GH-140944) (GH-140982)
(cherry picked from commit fa9c3eefd4)

Co-authored-by: Abhishek Tiwari <Abhi210@users.noreply.github.com>
2025-11-04 11:21:33 +00:00
Miss Islington (bot)
331b4b868c
[3.14] gh-140815: Fix faulthandler for invalid/freed frame (GH-140921) (#140981)
gh-140815: Fix faulthandler for invalid/freed frame (GH-140921)

faulthandler now detects if a frame or a code object is invalid or
freed.

Add helper functions:

* _PyCode_SafeAddr2Line()
* _PyFrame_SafeGetCode()
* _PyFrame_SafeGetLasti()

_PyMem_IsPtrFreed() now detects pointers in [-0xff, 0xff] range
as freed.
(cherry picked from commit a84181c31b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-04 11:18:23 +00:00
Miss Islington (bot)
a9c964f368
[3.14] Docs: Fix a typo in idle.rst (Chitespace -> Whitespace) (GH-140946) (#140953)
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-11-04 10:02:10 +02:00
Hugo van Kemenade
25a2a60371
[3.14] Fix minor typos and wording in C API docs (GH-140955) (#140966)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-04 09:46:08 +02:00
Ken Jin
09c890ec8c
[3.14] gh-140889: Test tailcall and JIT in CI (GH-140891) (GH-140962) 2025-11-03 19:53:10 +00:00
Miss Islington (bot)
894b5287ea
[3.14] gh-133600: Run Tools/wasm/wasi on CI instead of deprecated Tools/wasm/wasi.py (GH-140907) (#140964)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-03 19:51:32 +00:00
Miss Islington (bot)
08012a93a8
[3.14] gh-138151: Fix annotationlib handling of multiple nonlocals (GH-138164) (#140949)
gh-138151: Fix annotationlib handling of multiple nonlocals (GH-138164)
(cherry picked from commit b1027d4762)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-11-03 15:52:01 +00:00
Miss Islington (bot)
788104633c
[3.14] gh-140348: Fix using | on unusual objects plus Unions (GH-140383) (#140948)
gh-140348: Fix using | on unusual objects plus Unions (GH-140383)
(cherry picked from commit 7a9437d986)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-11-03 15:16:03 +00:00
Jelle Zijlstra
1b376b82ac
[3.14] Revert "gh-137969: Fix evaluation of ref.evaluate(format=Format.FORWARDREF) objects (GH-138075) (#140929)" (GH-140931)
Revert "[3.14] gh-137969: Fix evaluation of `ref.evaluate(format=Format.FORWARDREF)` objects (GH-138075) (#140929)"

This reverts commit cdb6fe89ae.
2025-11-03 15:07:22 +01:00
Miss Islington (bot)
fa9bb9a092
[3.14] gh-140693: Improve argparse documentation about controlling color (GH-140737) (#140932)
gh-140693: Improve `argparse` documentation about controlling color (GH-140737)
(cherry picked from commit 31de83d5e2)

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-11-02 21:08:47 -08:00
Miss Islington (bot)
cdb6fe89ae
[3.14] gh-137969: Fix evaluation of ref.evaluate(format=Format.FORWARDREF) objects (GH-138075) (#140929)
gh-137969: Fix evaluation of `ref.evaluate(format=Format.FORWARDREF)` objects (GH-138075)
(cherry picked from commit 63e01d6bae)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-11-03 01:45:44 +00:00
Miss Islington (bot)
23e3771045
[3.14] gh-138425: Correctly partially evaluate global generics with undefined params in ref.evaluate(format=Format.FORWARDREF) (GH-138430) (#140927)
gh-138425: Correctly partially evaluate global generics with undefined params in `ref.evaluate(format=Format.FORWARDREF)` (GH-138430)
(cherry picked from commit e66f87ca73)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-11-02 23:41:49 +00:00
Miss Islington (bot)
7e1bac6a1a
[3.14] gh-135307: Fix email error when policy max_line_length is set to 0 or None (GH-135367) (#140915)
gh-135307: Fix email error when policy max_line_length is set to 0 or None (GH-135367)
(cherry picked from commit 6d45cd8dbb)


RDM: Like the change made in a earlier PR to the folder, we can/must use 'maxlen' as a stand in for 'unlimited' when computing line lengths when max_line_length is 0 or None; otherwise the computation results in a traceback.

Co-authored-by: Jiucheng(Oliver) <git.jiucheng@gmail.com>
2025-11-02 10:03:12 -05:00
Miss Islington (bot)
6ab4dfb560
[3.14] Docs: avoid informal formulation in Doc/c-api/conversion.rst (GH-140898) (#140912)
Docs: avoid informal formulation in `Doc/c-api/conversion.rst` (GH-140898)
(cherry picked from commit 173cc53d9f)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-11-02 13:57:26 +00:00
Bénédikt Tran
bf2865f80f
[3.14] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234) (#139359)
* [3.14] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234)

Expose the XML Expat 2.7.2 mitigation APIs to disallow use of
disproportional amounts of dynamic memory from within an Expat
parser (see CVE-2025-59375 for instance).

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetAllocTrackerActivationThreshold(threshold)`, and
- `parser.SetAllocTrackerMaximumAmplification(max_factor)`.

(cherry picked from commit f04bea44c3)
(cherry picked from commit 68a1778b77)
2025-11-02 09:33:36 +00:00
Miss Islington (bot)
4d7fab9b15
[3.14] Docs: fix some grammatical errors in Doc/c-api/dict.rst (GH-140899) (#140901)
Docs: fix some grammatical errors in `Doc/c-api/dict.rst` (GH-140899)
(cherry picked from commit d12cbf2865)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-11-02 08:38:56 +00:00
Ken Jin
4d68b758fa
[3.14] gh-140104: Revert "Set next_instr properly in the JIT during exceptions (GH-140233) (GH-140687)" (#140890)
Revert "[3.14] gh-140104: Set next_instr properly in the JIT during exceptions (GH-140233) (GH-140687)"

This reverts commit 2e21672803.
2025-11-01 18:41:01 +00:00
Miss Islington (bot)
ab1fdf3d7c
[3.14] gh-140312: Set lltrace on JIT debug builds (GH-140313) (#140887)
gh-140312: Set lltrace on JIT debug builds (GH-140313)
(cherry picked from commit f701f98052)

Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Mark Shannon <mark@hotpy.org>
2025-11-01 16:49:35 +00:00
Miss Islington (bot)
c7ede76d8e
[3.14] gh-140874: Upgrade bundled pip to 25.3 (GH-140876) (gh-140881)
gh-140874: Upgrade bundled pip to 25.3 (GH-140876)

Upgrade bundled pip to 25.3
(cherry picked from commit d440a0f96c)

Co-authored-by: Damian Shaw <damian.peter.shaw@gmail.com>
2025-11-01 11:21:51 +00:00
Łukasz Langa
631ba3407e
[3.14] gh-136065: Fix quadratic complexity in os.path.expandvars() (GH-134952) (GH-140844)
(cherry picked from commit f029e8db62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-31 17:43:23 +01:00
Miss Islington (bot)
89818a5939
[3.14] gh-137836: Support more RAWTEXT and PLAINTEXT elements in HTMLParser (GH-137837) (GH-140841)
* the "plaintext" element
* the RAWTEXT elements "xmp", "iframe", "noembed" and "noframes"
* optionally RAWTEXT (if scripting=True) element "noscript"
(cherry picked from commit a17c57eee5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-31 16:13:13 +00:00
Brian Schubert
d0c78a458b
[3.14] gh-138944: Fix SyntaxError message for invalid syntax following valid import-as statement (GH-138945) (#140646)
(cherry picked from commit 3dab11f888)
2025-10-31 11:26:40 +01:00
Miss Islington (bot)
6c025a040d
[3.14] Make printing log lines to the terminal a little cleaner when building WASI (GH-140772) (GH-140804)
Make printing log lines to the terminal a little cleaner when building WASI (GH-140772)
(cherry picked from commit abd19eddee)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-30 18:02:10 +00:00
Mikhail Efimov
5954b5ba92
[3.14] gh-140551: Fix dict crash if clear is called at lookup stage (GH-140558) (#140743)
gh-140551: Fix `dict` crash if `clear` is called at `lookup` stage (#140558)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2025-10-30 22:33:35 +05:30
Miss Islington (bot)
e595d995c4
[3.14] GH-140768: Warn when the WASI SDK version doesn't match the supported version (GH-140769) (GH-140801)
GH-140768: Warn when the WASI SDK version doesn't match the supported version (GH-140769)
(cherry picked from commit 95a3564869)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-30 17:01:22 +00:00
Donghee Na
064e989de5
[3.14] gh-137821: Fix wrongly tested json.decoder.scanstring (gh-140782) 2025-10-30 22:51:25 +09:00
Miss Islington (bot)
a7cfe862ba
[3.14] gh-131927: Do not emit PEP 765 warnings in ast.parse() (GH-139642) (GH-140786)
ast.parse() no longer emits syntax warnings for
return/break/continue in finally (see PEP-765) -- they are only
emitted during compilation.
(cherry picked from commit ad0a3f733b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-30 11:25:34 +00:00
Miss Islington (bot)
6bb49ae650
[3.14] gh-138162: Fix logging.LoggerAdapter with merge_extra=True and without the extra argument (GH-140511) (GH-140784)
(cherry picked from commit 327dbbedff)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-30 11:19:27 +00:00
Miss Islington (bot)
6e70c75d1b
[3.14] gh-120057: add os.reload_environ to __all__ (GH-140763) (#140773)
Co-authored-by: Guo Ci <zguoci@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-10-29 22:22:20 +00:00
Miss Islington (bot)
0779ef9a63
[3.14] gh-140082: Forward colorizing from libregrtest to unittest (GH-140083) (#140756)
gh-140082: Forward colorizing from libregrtest to unittest (GH-140083)

libregrtest redirects test output to a file as part of its operation.
When `unittest` checks to see if it should colorize with
`isatty(sys.stdout)` that fails resulting in no colorizing of the
unittest output.

Update `libregrtest` to set `FORCE_COLOR=1` when redirecting test output
so that unittest will do color printing.
(cherry picked from commit 6ff62ac4fb)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-29 18:11:24 +00:00
Miss Islington (bot)
6d0e1c8478
[3.14] gh-140228: Avoid making unnecessary syscalls in linecache for frozen modules (GH-140377) (#140738)
gh-140228: Avoid making unnecessary syscalls in linecache for frozen modules (GH-140377)
(cherry picked from commit c41f84ff61)

Co-authored-by: tconley1428 <tconley1428@gmail.com>
2025-10-29 09:26:38 -07:00
Miss Islington (bot)
c45ab05a3a
[3.14] gh-140576: Fixed crash produced by lexer in case of dedented zero byte (GH-140583) (#140757)
gh-140576: Fixed crash produced by lexer in case of dedented zero byte (GH-140583)
(cherry picked from commit 8706167474)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-29 13:54:37 +00:00
Miss Islington (bot)
e0f54a0bda
[3.14] gh-140702: Log color and GHA env vars in test.pythoninfo (GH-140747) (#140753)
gh-140702: Log color and GHA env vars in test.pythoninfo (GH-140747)
(cherry picked from commit 376559bf54)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-29 12:54:04 +00:00
Cody Maloney
9a7dccd7a1
[3.14] gh-140607: Validate returned byte count in RawIOBase.read (GH-140611) (#140728)
* [3.14] gh-140607: Validate returned byte count in RawIOBase.read (GH-140611)

While `RawIOBase.readinto` should return a count of bytes between 0 and
the length of the given buffer, it is not required to. Add validation
inside RawIOBase.read() that the returned byte count is valid.
(cherry picked from commit 0f0a362768)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Victor Stinner <vstinner@python.org>

* fixup: Use older attribute name

---------

Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-29 13:31:48 +01:00
Miss Islington (bot)
7c4a8e5818
[3.14] gh-140702: Add test skip for Unix Datagram tests on iOS when on Github Actions (GH-140740) (#140742)
Exposes the GITHUB_ACTIONS environment variable to iOS simulator test runs, and
uses this variable to skip a Unix Datagram socketserver test that is unreliable
in the iOS GitHub Actions environment.
(cherry picked from commit 9f8d005d29)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-29 09:01:39 +00:00
Mikhail Efimov
8f322ad7b9
[3.14] gh-139951: Tests on tuple GC tracking (GH-140575) (#140701) 2025-10-29 07:17:49 +00:00
Miss Islington (bot)
52338ec6cc
[3.14] gh-139588: Increase maximum LaTeX list depth (GH-140709) (#140724)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-28 20:05:28 +00:00
Miss Islington (bot)
6822b135f2
[3.14] gh-140657: Don't rerun test_import single phase init test (GH-140712) (#140713)
gh-140657: Don't rerun test_import single phase init test (GH-140712)

test_basic_multiple_interpreters_main_no_reset() leaks memory:
import_in_subinterp() is called with postcleanup=False.
(cherry picked from commit c6d4c79c9a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-28 17:33:34 +00:00
Miss Islington (bot)
02604314ba
[3.14] GH-140590: Fix setstate for functools.partial C-module (GH-140671) (#140698)
GH-140590: Fix setstate for functools.partial C-module (GH-140671)

(cherry picked from commit d26686a7f8)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-28 18:15:27 +05:30
Miss Islington (bot)
84e01df175
[3.14] gh-134160: Add more comments for the xxlimited module (GH-140214) (GH-140664)
(cherry picked from commit 18e4a89e42)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-28 10:24:11 +01:00
Miss Islington (bot)
3fa7bf4b26
[3.14] gh-140189: Add CI job to test iOS builds. (GH-140190) (#140696)
Adds a CI configuration to test iOS builds on every build.
(cherry picked from commit f4e6370582)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-28 06:13:30 +00:00
Mikhail Efimov
2e21672803
[3.14] gh-140104: Set next_instr properly in the JIT during exceptions (GH-140233) (GH-140687)
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-10-27 23:49:10 +00:00
Miss Islington (bot)
3bb0eb4ca9
[3.14] gh-140634: Fix a reference counting bug in os.sched_param.__reduce__() (GH-140667) (GH-140685)
(cherry picked from commit 364ae607d8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-27 20:08:57 +00:00
Miss Islington (bot)
c1bfd4cb9c
[3.14] gh-140358: Bring back elapsed time and unreachable count to gc debug output (GH-140359) (#140405)
Co-authored-by: Pål Grønås Drange <paal.drange+pgdr@gmail.com>
2025-10-27 15:29:43 +02:00
Miss Islington (bot)
ce1deb947e
[3.14] gh-140487: Fix Py_RETURN_NOTIMPLEMENTED in limited C API 3.11 (GH-140636) (#140668)
gh-140487: Fix Py_RETURN_NOTIMPLEMENTED in limited C API 3.11 (GH-140636)

Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE have already been
fixed by commit 9258f3da91 (issue gh-134989).
(cherry picked from commit c636477523)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-27 14:15:49 +01:00
Miss Islington (bot)
87afee2312
[3.14] gh-140633: AppleFrameworkLoader: Ignore AttributeError when setting __file__ (GH-140635) (GH-140660)
(cherry picked from commit 3416e7c8dc)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-27 14:08:00 +01:00
Miss Islington (bot)
5ae4612e72
[3.14] Docs: Replace "encoder" with "decoder" in Doc/c-api/codec.rst (GH-140613) (#140661)
Docs: Replace "encoder" with "decoder" in `Doc/c-api/codec.rst` (GH-140613)
(cherry picked from commit d12086e822)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-27 09:51:14 +00:00
Miss Islington (bot)
97c59f9d61
[3.14] Remove dead stores to 'size' in UTF-8 decoder (unicodeobject.c) (GH-140637) (#140658)
Remove dead stores to 'size' in UTF-8 decoder (unicodeobject.c) (GH-140637)
(cherry picked from commit 7d70a147f5)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-10-27 09:21:43 +00:00
Sebastian Pipping
842c49b354
[3.14] gh-140593: Fix a memory leak in function my_ElementDeclHandler of pyexpat (GH-140602) (#140629)
[3.14] gh-140593: Fix a memory leak in function `my_ElementDeclHandler` of `pyexpat` (GH-140602)

Ensure that the memory allocated for the content model
passed to `my_ElementDeclHandler` is freed in all error
paths.

(cherry picked from commit e34a5e3304)
2025-10-26 15:19:18 +00:00
Miss Islington (bot)
30ee67b2e4
[3.14] gh-137568: Ignore startup file in test_dumb_terminal_exits_cleanly (GH-140295) (GH-140628)
gh-137568: Ignore startup file in `test_dumb_terminal_exits_cleanly` (GH-140295)
(cherry picked from commit 06c779474c)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-10-26 15:15:49 +00:00
Miss Islington (bot)
46a3fd2da5
[3.14] gh-133346: add tests for _colorize.Theme (GH-139687) (#140622)
* gh-133346: add tests for `_colorize.Theme` (GH-139687)
(cherry picked from commit 37827c1752)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-26 13:49:20 +01:00
Miss Islington (bot)
d664102a45
[3.14] gh-133346: make _colorize.Argparse kw-only constructible (GH-140620) (#140621)
gh-133346: make `_colorize.Argparse` kw-only constructible (GH-140620)

Other themes are kw-only constructible.
(cherry picked from commit 387ac2d2f3)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-26 12:00:10 +00:00
Miss Islington (bot)
57ba6aedf6
[3.14] Docs: Fix a grammatical error in Doc/c-api/codec.rst (GH-140612) (#140616)
Docs: Fix a grammatical error in `Doc/c-api/codec.rst` (GH-140612)
(cherry picked from commit 33b2ca80bb)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-26 09:45:34 +00:00
Miss Islington (bot)
596111546d
[3.14] gh-124694: Add versionadded note to InterpreterPoolExecutor (GH-140605)
(cherry picked from commit 421a475c87)

Co-authored-by: Zachary Ware <zach@python.org>
2025-10-25 23:37:24 +00:00
Miss Islington (bot)
62c9d48378
[3.14] Fix typo in Doc/c-api/code.rst (GH-140586) (#140591)
Fix typo in `Doc/c-api/code.rst` (GH-140586)
(cherry picked from commit d74a96366d)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-25 15:41:04 +00:00
Miss Islington (bot)
96029bc472
[3.14] Remove unreachable break statements in _ctypes_test.c (GH-140585) (#140587)
Remove unreachable break statements in _ctypes_test.c (GH-140585)
(cherry picked from commit 2a1c9bd616)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-10-25 18:39:42 +03:00
Miss Islington (bot)
568cf8b4af
[3.14] Docs: Fix a grammatical error in Doc/c-api/capsule.rst (GH-140577) (GH-140580)
Docs: Fix a grammatical error in `Doc/c-api/capsule.rst` (GH-140577)

"who" -> "which"
(cherry picked from commit 4ad599501f)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-25 14:02:20 +00:00
Miss Islington (bot)
4fcc102524
[3.14] gh-140463: Fix typo in xmlrpc.client documentation (GH-140552) (#140568)
gh-140463: Fix typo in xmlrpc.client documentation (GH-140552)

Fix typo in xmlrpc.client documentation
(cherry picked from commit 44b6eead21)

Co-authored-by: Miša Jakovljević <misajakovljevic3@gmail.com>
2025-10-24 20:53:24 +00:00
Miss Islington (bot)
bff0455319
[3.14] Add missing NEWS entry for gh-140517 (GH-140560) (GH-140565)
(cherry picked from commit d78d7a50b0)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-24 20:00:21 +00:00
Miss Islington (bot)
7545ea6b3a
[3.14] gh-140482: Preserve and restore stty echo as a test environment (GH-140519) (#140562)
gh-140482: Preserve and restore `stty echo` as a test environment (GH-140519)
(cherry picked from commit b3c713a0af)


gh-140482: Restore `stty echo` as a test environment

Co-authored-by: Barry Warsaw <barry@python.org>
2025-10-24 19:24:17 +00:00
Miss Islington (bot)
11b5e0b9c2
[3.14] gh-140517: fix leak in map_next in strict mode (GH-140543) (#140554)
gh-140517: fix leak in `map_next` in strict mode (GH-140543)
(cherry picked from commit be5af997f3)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-24 22:00:36 +05:30
Miss Islington (bot)
a975bea9b5
[3.14] Document that PyModule_GetDef can return NULL with or without setting an exception (GH-140529) (GH-140545)
(cherry picked from commit 289360ae63)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-24 13:36:35 +00:00
Miss Islington (bot)
4bb2f1f322
[3.14] Docs: Fix a grammatical error in Doc/c-api/arg.rst (GH-140525) (GH-140538)
Docs: Fix a grammatical error in `Doc/c-api/arg.rst` (GH-140525)

"have" -> "has"
(cherry picked from commit fc2e23c2ed)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-24 12:24:26 +00:00
Miss Islington (bot)
08f6b3f422
[3.14] gh-136535: Tests: Correct Py_TPFLAGS_MANAGED_DICT in test_class.py (gh-136538) (gh-140532) 2025-10-24 11:45:44 +00:00
Kumar Aditya
6efd78d7ab
[3.14] gh-137093: Fix race condition in test_embed.test_bpo20891 (GH-137094) (#140524)
Use a `PyEvent` instead of a lock to fix a race on the free-threaded build.
(cherry picked from commit 9b451fb457)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-24 13:21:44 +05:30
Miss Islington (bot)
8285bc7ea2
[3.14] gh-140471: Fix buffer overflow in AST node initialization with malformed _fields (GH-140506) (#140509)
gh-140471: Fix buffer overflow in AST node initialization with malformed `_fields` (GH-140506)
(cherry picked from commit 95953b692d)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-23 10:20:21 -07:00
Miss Islington (bot)
29c42cc621
[3.14] gh-140438: properly run the asyncio REPL tests (GH-140298) (#140507)
gh-140438: properly run the asyncio REPL tests (GH-140298)
(cherry picked from commit 1a3da2c070)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-10-23 15:48:26 +00:00
Miss Islington (bot)
3944e9b3b2
[3.14] gh-140431: Fix GC crash due to partially initialized coroutines (gh-140470) (gh-140504)
The `make_gen()` function creates and tracks generator/coro objects, but
doesn't fully initialize all the fields. At a minimum, we need to
initialize all the fields that may be accessed by gen_traverse because
the call to `compute_cr_origin()` can trigger a GC.
(cherry picked from commit 574405c19e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-23 14:44:21 +00:00
Miss Islington (bot)
564bb00b27
[3.14] gh-138774: use value to ast.unparse code when str is None in ast.Interpolation (GH-139415) (#140503)
gh-138774: use `value` to `ast.unparse` code when `str` is `None` in `ast.Interpolation` (GH-139415)
(cherry picked from commit 4d0849426f)

Co-authored-by: George Ogden <38294960+George-Ogden@users.noreply.github.com>
2025-10-23 14:39:02 +00:00
Mark Shannon
d1a434f7b2
[3.14] GH-139951: Fix major GC performance regression. Backport of GH-140262 (GH-140447)
* Count number of actually tracked objects, instead of trackable objects. This ensures that untracking tuples has the desired effect of reducing GC overhead
* Do not track most untrackable tuples during creation. This prevents large numbers of small tuples causing execessive GCs.
2025-10-23 15:26:58 +01:00
Miss Islington (bot)
0fdae5f590
[3.14] gh-140474: Fix memory leak in array.array (GH-140478) (GH-140498)
gh-140474: Fix memory leak in `array.array` (GH-140478)
(cherry picked from commit aa9d0a61d5)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-23 10:20:16 +00:00
Miss Islington (bot)
853e5d94eb
[3.14] gh-130317: Fix SNaN broken tests on HP PA RISC (GH-140452) (#140467)
gh-130317: Fix SNaN broken tests on HP PA RISC (GH-140452)

While looking at GH-140028, I found some unrelated test regressions in the
3.14 cycle. These seem to all come from GH-130317. From what I can tell,
that made Python more correct than it was before. According to [0], HP PA
RISC uses 1 for SNaN and thus a 0 for QNaN.

[0]: https://grouper.ieee.org/groups/1788/email/msg03272.html
(cherry picked from commit 76fea5596c)

Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2025-10-22 17:04:47 +00:00
Miss Islington (bot)
01b52ea5c0
[3.14] gh-116738: Add critical section to dbm/gdbm context manager (gh-140391) (gh-140459)
(cherry picked from commit d51be28876)

Co-authored-by: Alper <alperyoney@fb.com>
2025-10-22 15:44:09 +00:00
Miss Islington (bot)
9d547dab0b
[3.14] gh-132835: Add defensive NULL checks to MRO resolution (GH-134763) (GH-140436)
Currently, there are a few places where tp_mro could theoretically
become NULL, but do not in practice. This commit adds defensive checks for
NULL values to ensure that any changes do not introduce a crash and that
state invariants are upheld.

The assertions added in this commit are all instances where a NULL value would get passed to something not expecting a NULL, so it is better to catch an assertion failure than crash later on.

There are a few cases where it is OK for the return of lookup_tp_mro to be NULL, such as when passed to is_subtype_with_mro, which handles this explicitly.
(cherry picked from commit a8edca62fc)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-10-21 20:45:06 -07:00
Emma Smith
a490d671fa
[3.14] zlib.rst: Link to constants and deduplicate text (GH-140115) (GH-140349)
* Link to compression setting constants from compression functions
* De-duplicate descriptions of the constants
(cherry picked from commit 091e8513bb)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-21 14:44:47 -07:00
Miss Islington (bot)
c7fda9b3d1
[3.14] gh-138764: annotationlib: Make call_annotate_function fallback to using VALUE annotations if both the requested format and VALUE_WITH_FAKE_GLOBALS are not implemented (GH-138803) (#140426)
gh-138764: annotationlib: Make `call_annotate_function` fallback to using `VALUE` annotations if both the requested format and `VALUE_WITH_FAKE_GLOBALS` are not implemented (GH-138803)
(cherry picked from commit 95c257e2e6)

Co-authored-by: David Ellis <ducksual@gmail.com>
2025-10-21 16:22:29 +00:00
Miss Islington (bot)
d9e3d0eec7
[3.14] Use `sphinxext-opengraph` v0.13.0 (GH-140425) (#140427)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-21 16:08:56 +00:00
Miss Islington (bot)
3d4cf3bda3
[3.14] gh-139951: Test on GC collection disabled if threshold is zero (GH-140304) (#140362)
gh-139951: Test on GC collection disabled if threshold is zero (GH-140304)
(cherry picked from commit 5d0abb6971)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-21 08:44:33 -07:00
Miss Islington (bot)
d7dc6bfe2f
[3.14] GH-139436: Remove references to downloadable PDF documentation (GH-140416) (#140419)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-21 16:06:48 +03:00
Miss Islington (bot)
c0f0eca4da
[3.14] gh-140406: Fix memory leak upon __hash__ returning a non-integer (GH-140411) (GH-140417)
gh-140406: Fix memory leak upon `__hash__` returning a non-integer (GH-140411)
(cherry picked from commit 71db05a12d)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-21 12:35:31 +00:00
Miss Islington (bot)
98d4c21c09
[3.14] gh-140398: fix memory leaks in readline module when PySys_Audit fails (GH-140400) (#140403)
gh-140398: fix memory leaks in `readline` module when `PySys_Audit` fails (GH-140400)
(cherry picked from commit e8e0f411ba)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-10-21 08:20:14 +00:00
Miss Islington (bot)
4215f7f519
[3.14] gh-66646: Explain __base__ attribute in the docs (GH-102554) (GH-140365)
(cherry picked from commit faa169afa0)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Éric <merwok@netwok.org>
2025-10-21 09:06:49 +02:00
Miss Islington (bot)
ba6d956eb9
[3.14] [Docs] Add missing note about Required/NotRequired/ReadOnly in get_type_hints() (GH-139565) (#140386)
[Docs] Add missing note about Required/NotRequired/ReadOnly in get_type_hints() (GH-139565)
(cherry picked from commit a752f58d6b)

Co-authored-by: Sam Bull <git@sambull.org>
2025-10-20 13:23:19 -07:00
Miss Islington (bot)
62f44dda1c
[3.14] gh-138891: fix star-unpack in get_annotations (GH-138951) (#140384)
gh-138891: fix star-unpack in get_annotations (GH-138951)
(cherry picked from commit c6be6e4537)

Co-authored-by: Christoph Walcher <christoph-wa@gmx.de>
2025-10-20 20:20:47 +00:00
Miss Islington (bot)
8e93f6e203
[3.14] gh-63161: Fix tokenize.detect_encoding() (GH-139446) (GH-140378)
* Support non-UTF-8 shebang and comments if non-UTF-8 encoding is specified.
* Detect decoding error for non-UTF-8 encoding.
* Detect null bytes in source code.
(cherry picked from commit 38d4b436ca)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-20 17:34:56 +00:00
Serhiy Storchaka
abb3b3142b
[3.14] gh-63161: Fix test_source_encoding when stderr is StringIO (GH-140361) 2025-10-20 20:05:42 +03:00
Miss Islington (bot)
6493a6aaf3
[3.14] gh-140263: Fix data race in test_lock_two_threads (gh-140264) (gh-140369)
Clang-20 detects a data race between the unlock and the non-atomic
read of the lock state. Use a relaxed load for the assertion to avoid
the race.
(cherry picked from commit f11ec6e643)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-20 14:25:42 +00:00
Miss Islington (bot)
d7fe4e99a2
[3.14] gh-140301: Fix memory leak in subinterpreter PyConfig cleanup (GH-140303) (#140360)
gh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (GH-140303)
(cherry picked from commit a615fb49c9)

Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-20 09:54:41 +00:00
Miss Islington (bot)
357284edb5
[3.14] gh-101100: Fix sphinx warnings in library/resource.rst (GH-140023) (#140352)
Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-10-20 07:21:31 +00:00
Miss Islington (bot)
2699643d71
[3.14] docs: be clearer that glob results are unordered (GH-140184) (#140339)
(cherry picked from commit ed672f7a8a)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-10-20 07:31:05 +03:00
Miss Islington (bot)
13e1642845
[3.14] Standardize translation of Doc/bugs.rst (GH-137449) (#140275)
Standardize translation of `Doc/bugs.rst` (GH-137449)
(cherry picked from commit 869bb6948e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-19 23:13:48 +02:00
Miss Islington (bot)
6cee144d3a
[3.14] gh-140306: Fix memory leaks in cross-interpreter data handling (GH-140307) (GH-140338)
(cherry picked from commit f9323213c9)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-10-19 19:53:36 +00:00
Miss Islington (bot)
9ff705c6c5
[3.14] gh-63161: Fix PEP 263 support (GH-139481) (GH-139898)
* Support non-UTF-8 shebang and comments if non-UTF-8 encoding is specified.
* Detect decoding error in comments for UTF-8 encoding.
* Include the decoding error position for default encoding in SyntaxError.
(cherry picked from commit 5c942f11cd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-19 19:16:33 +00:00
Miss Islington (bot)
69d263cfe1
[3.14] Lib/idlelib/idle_test/__init__.py: remove commented out duplicate code (GH-140259) (#140322)
`Lib/idlelib/idle_test/__init__.py`: remove commented out duplicate code (GH-140259)
(cherry picked from commit 790cdae5a0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-19 04:49:48 -04:00
Miss Islington (bot)
a4b977cfe2
[3.14] gh-138997: Remove false justify fill option from Tkinter docs (GH-139023) (#140319)
gh-138997: Remove false justify `fill` option from Tkinter docs (GH-139023)
(cherry picked from commit 115a04b802)

Co-authored-by: Marat Khagazheev <marathagazeev@gmail.com>
Co-authored-by: marat <khagazheev@artlebedev.ru>
2025-10-19 03:52:59 +00:00
Miss Islington (bot)
7be317fea6
[3.14] gh-128571: Document UTF-16/32 native byte order (GH-139974) (#140309)
Closes GH-128571
(cherry picked from commit 920de7ccdc)

Co-authored-by: Parham MohammadAlizadeh <prhmma@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-18 18:59:37 +00:00
Kumar Aditya
1d11627ba5
[3.14] gh-140067: Fix memory leak in sub-interpreter creation (GH-140111) (#140118)
* [3.14] gh-140067: Fix memory leak in sub-interpreter creation  (GH-140111)

Fix memory leak in sub-interpreter creation caused by overwriting of the previously used `_malloced` field. Now the pointer is stored in the first word of the memory block to avoid it being overwritten accidentally.
(cherry picked from commit 59547a251f)

Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-18 19:40:43 +05:30
Miss Islington (bot)
3ca7ea1f8f
[3.14] gh-140257: fix data race on eval_breaker during finalization (GH-140265) (#140294)
gh-140257: fix data race on eval_breaker during finalization (GH-140265)
(cherry picked from commit c8729c9909)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-10-18 11:28:53 +00:00
Miss Islington (bot)
c70f409da0
[3.14] gh-140241: Fix documentation for the registry parameter of warnings.warn_explicit() (GH-140242) (GH-140292)
(cherry picked from commit 78e1d65a4d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-18 11:02:09 +00:00
Miss Islington (bot)
b2d3957511
[3.14] Move the NEWS entry for gh-140272 to the correct place (GH-140290) (GH-140291)
(cherry picked from commit 936de256a9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-18 11:00:28 +00:00
Miss Islington (bot)
128f48fd2d
[3.14] gh-140272: Fix memory leak in _gdbm.gdbm.clear() (GH-140274) (GH-140285)
(cherry picked from commit f937468e7c)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-10-18 13:17:42 +03:00
Miss Islington (bot)
f59236b746
[3.14] GH-133789: Fix unpickling of pathlib objects pickled in Python 3.13 (GH-133831) (#140276)
GH-133789: Fix unpickling of pathlib objects pickled in Python 3.13 (GH-133831)

In Python 3.13 (but not 3.12 or 3.14), pathlib classes are defined in
`pathlib._local` rather than `pathlib`. In hindsight this was a mistake,
but it was difficult to predict how the abstract/local split would pan out.

In this patch we re-introduce `pathlib._local` as a stub module that
re-exports the classes from `pathlib`. This allows path objects pickled in
3.13 to be unpicked in 3.14+
(cherry picked from commit f4e51f253a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2025-10-17 22:23:01 +00:00
Miss Islington (bot)
e07b78c01a
[3.14] gh-116738: test uuid module thread safety in free-threading (GH-140068) (#140229)
gh-116738: test `uuid` module thread safety in free-threading (GH-140068)
(cherry picked from commit 9a87ce8b57)

Co-authored-by: Alper <alperyoney@fb.com>
2025-10-17 20:59:15 +05:30
Miss Islington (bot)
889e9184bf
[3.14] gh-135801: Add tests for filtering warnings by module (GH-140240) (GH-140246)
(cherry picked from commit fbf0843e39)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-17 11:48:03 +00:00
Miss Islington (bot)
5513f6a99d
[3.14] gh-131788: make resource_tracker re-entrant safe (GH-131787) (#137737)
gh-131788: make resource_tracker re-entrant safe (GH-131787)

* make resource_tracker re-entrant safe
* Update Lib/multiprocessing/resource_tracker.py
* trim trailing whitespace
* use f-string and args = [x, *y, z]
* raise self._reentrant_call_error

---------
(cherry picked from commit f24a012350)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-10-16 21:25:14 -07:00
Miss Islington (bot)
32e60fa220
[3.14] gh-140120: Refresh HACL* to fix an hmac memory leak (GH-140188) (#140192)
gh-140120: Refresh HACL* to fix an hmac memory leak (GH-140188)

This pulls an updated version of HACL* that fixes the memory leak reported in GH-140120, via an upstream fix.
(cherry picked from commit 3a81313019)

Co-authored-by: Jonathan Protzenko <jonathan.protzenko+github@gmail.com>
2025-10-16 20:53:12 -07:00
Miss Islington (bot)
54261b6782
[3.14] gh-138859: Account for ParamSpec defaults that are not lists … (GH-138868) (#140207)
gh-138859: Account for `ParamSpec` defaults that are not lists … (GH-138868)
(cherry picked from commit 379fd020a0)

Co-authored-by: bzoracler <50305397+bzoracler@users.noreply.github.com>
2025-10-16 13:26:29 -07:00
Tan Long
12903c098b
[3.14] Remove duplicate words in the documentation (GH-140221) (GH-140225)
(cherry picked from commit 2ebd0cdb16)
2025-10-16 20:10:15 +02:00
Miss Islington (bot)
48b60495b7
[3.14] gh-140078: fix typo in tkinter docs (GH-140081) (#140217)
gh-140078: fix typo in tkinter docs (GH-140081)

Remove extraneous word.
(cherry picked from commit 5f357f3b0d)

Co-authored-by: wangxiaolei <fatelei@gmail.com>
2025-10-16 15:22:57 +00:00
Miss Islington (bot)
e69fb2008e
[3.14] gh-140170: Fix test_site with -s flag (GH-140179) (#140198)
gh-140170: Fix test_site with -s flag (GH-140179)

Commit
(cherry picked from commit 7ac94fcb1d)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-16 12:31:59 +02:00
Miss Islington (bot)
231552c6f7
[3.14] gh-140065: Lexical analysis: Correct note about leading zeros in floating point numbers (GH-140066) (GH-140167)
(cherry picked from commit 1624c646b0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-16 09:50:01 +02:00
Miss Islington (bot)
504bf76dd2
[3.14] gh-140041: Fix import of ctypes on Android and Cygwin when ABI flags are present (GH-140178) (#140180)
Use sysconfig to determine the full name of libpython, rather than hardcoding
a library name that doesn't have ABI flags.
(cherry picked from commit 7f371ed84b)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-10-15 22:08:35 +00:00
yihong
5caf64335c
[3.14] gh-140080: Add test for executing atexit callbacks under no memory (GH-140161) 2025-10-15 11:25:06 -04:00
Miss Islington (bot)
95c03d018d
[3.14] gh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (GH-140158) (#140164)
gh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (GH-140158)
(cherry picked from commit 728d239e57)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-15 15:02:03 +00:00
Miss Islington (bot)
045e34964a
[3.14] gh-140061: Use _PyObject_IsUniquelyReferenced() to check if objects are uniquely referenced (gh-140062) (gh-140157)
The previous `Py_REFCNT(x) == 1` checks can have data races in the free
threaded build. `_PyObject_IsUniquelyReferenced(x)` is a more conservative
check that is safe in the free threaded build and is identical to
`Py_REFCNT(x) == 1` in the default GIL-enabled build.
(cherry picked from commit 32c264982e)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-10-15 14:49:17 +00:00
Miss Islington (bot)
6b94c7ceeb
[3.14] gh-129559: Remove extra dot in bytearray.resize AC (GH-140134) (#140143)
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-10-15 14:06:18 +03:00
Miss Islington (bot)
9e235ffb21
[3.14] gh-138993: Dedent credits text (GH-138994) (#140088)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-15 14:05:47 +03:00
Miss Islington (bot)
af28efd8b4
[3.14] gh-139640: Fix swallowing syntax warnings in different modules (GH-139755) (GH-140117)
Revert GH-131993.

Fix swallowing some syntax warnings in different modules if they accidentally
have the same message and are emitted from the same line.

Fix duplicated warnings in the "finally" block.

(cherry picked from commit 279db6bede)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

* Update 2025-10-06-10-03-37.gh-issue-139640.gY5oTb.rst

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-14 15:56:01 +00:00
Miss Islington (bot)
99e42ab49c
[3.14] gh-101828: Fix jisx0213 codecs removing null characters (gh-139340) (gh-140110)
gh-101828: Fix `jisx0213` codecs removing null characters (gh-139340)
(cherry picked from commit 87eadce3e0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-14 14:36:05 +00:00
Miss Islington (bot)
6a467d3eda
[3.14] gh-106318: Add examples for str.istitle() (GH-140046) (#140113)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2025-10-14 14:27:37 +00:00
Miss Islington (bot)
525f7c23b9
[3.14] gh-114827: clarify threading.Event.wait timeout behavior (GH-114834) (#140100)
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-14 14:13:33 +00:00
Sergey B Kirpichev
1c55b9163b
[3.14] gh-102431: Clarify constraints on operands of Decimal logical operations (GH-102836) (#140105)
* [3.14] gh-102431: Clarify constraints on operands of Decimal logical operations (GH-102836)

Sync C/Python implementation of the decimal: logical_ops for contexts.
(cherry picked from commit 6ecf77dbde)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-10-14 15:44:30 +02:00
Miss Islington (bot)
2142f4efcf
[3.14] GH-140058: Clear key and value if PyTuple_New fails in dictiter_iternextitem (GH-140059) (#140107)
GH-140058: Clear key and value if `PyTuple_New` fails in `dictiter_iternextitem` (GH-140059)
(cherry picked from commit ded59f7e8e)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-10-14 19:10:30 +05:30
Miss Islington (bot)
45577c93de
[3.14] gh-70765: Remove unnecessary extra backtick from Changelog entry (GH-140071) (#140102)
gh-70765: Remove unnecessary extra backtick from Changelog entry (GH-140071)
(cherry picked from commit f70082b477)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-10-14 11:15:36 +00:00
Miss Islington (bot)
af9b8970ef
[3.14] gh-82575: Adjust time.get_clock_info *adjustable* attribute doc (GH-135920) (#140097)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-14 08:36:39 +00:00
Miss Islington (bot)
2695844d26
[3.14] gh-137871: Clarify cmath.nan documentation by linking to math module (GH-137876) (#140095)
Co-authored-by: Aziz <azizbenothman76@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-10-14 08:32:27 +00:00
Miss Islington (bot)
b24b656a4e
[3.14] gh-97914: Reword misleading sentence on conditional expressions (GH-139064) (#140093)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Gilles Peiffer <gilles.peiffer.yt@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-14 08:28:12 +00:00
Miss Islington (bot)
b0c92e4b33
[3.14] gh-138072: Fix typos and grammatical errors and improve clarity in asyncio howto document (GH-138895) (#140091)
Co-authored-by: Morteza24 <mortezia4444.mz@gmail.com>
2025-10-14 08:27:21 +00:00
Miss Islington (bot)
e1caa1e6fa
[3.14] gh-102247: Improve documentation of http.HTTPStatus members update (GH-133190) (#140089)
Co-authored-by: Loïc Simon <loic.simon@napta.io>
2025-10-14 08:26:00 +00:00
Miss Islington (bot)
4c0dab9807
[3.14] gh-101100: Fix sphinx warnings in library/smtplib.rst (GH-139991) (#140084)
Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-14 08:19:29 +00:00
Miss Islington (bot)
5848d80536
[3.14] gh-139590: Stricter ruff rules for Tools/wasm (GH-139752) (#139811)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-14 10:29:32 +03:00
Miss Islington (bot)
7a13953bc3
[3.14] gh-140000: Traverse name attribute for TypeVar, TypeVarTuple, TypeAliasType, ParamSpec (GH-140016) (#140063)
gh-140000: Traverse `name` attribute for `TypeVar`, `TypeVarTuple`, `TypeAliasType`, `ParamSpec` (GH-140016)
(cherry picked from commit be60e4b4f3)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-13 20:36:24 +00:00
Miss Islington (bot)
c5edf7d6f4
gh-139810: Always generate -dev tags for PyManager packages (GH-139814)
(cherry picked from commit c46265d94a)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-10-13 20:08:42 +00:00
Kumar Aditya
511078099a
[3.14] gh-125996: fix thread safety of collections.OrderedDict (GH-133734) (#140053)
(cherry picked from commit 6481539a6d)
2025-10-13 23:25:24 +05:30
Miss Islington (bot)
17d9f7169a
[3.14] gh-138772: Fix and improve documentation for turtle color functions (GH-139325) (GH-140047)
Use multiple signatures for clarity.
Explain different forms of bgcolor() in details.
Fix outdated docstrings.
(cherry picked from commit 525dcfe523)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-13 15:56:26 +00:00
Miss Islington (bot)
a5bf8a9a29
[3.14] Using Python on Windows: Free-threaded is supported from 3.14 (GH-139992) (#140045)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-13 14:25:49 +00:00
Miss Islington (bot)
3cef7801dd
[3.14] gh-107073: fix relevant typo in PyObject_ClearManagedDict (GH-140032) (#140033)
gh-107073: fix relevant typo in `PyObject_ClearManagedDict` (GH-140032)
(cherry picked from commit 52996aaa78)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-13 11:30:27 +00:00
Miss Islington (bot)
0b84334e52
[3.14] gh-131189: Remove curses mention from PYTHON_BASIC_REPL docs (GH-140022) (#140027)
gh-131189: Remove `curses` mention from `PYTHON_BASIC_REPL` docs (GH-140022)

The `curses` dependency for the default REPL has been removed
in 031645a884 (backport of
09dfb50f1b).

(cherry picked from commit 0344db8d60)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-10-13 08:48:28 +00:00
Miss Islington (bot)
11ac373d7c
[3.14] GH-139979: Add @force_not_colorized_test_class to TestOptionalHelpVersionActions (GH-139980) (#140005)
GH-139979: Add @force_not_colorized_test_class to TestOptionalHelpVersionActions (GH-139980)
(cherry picked from commit 0fc5c56815)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2025-10-12 17:16:21 +00:00
Miss Islington (bot)
7e8f107106
[3.14] gh-139155: Remove "dictionaries are sorted by key" note in pprint docs (GH-139159) (GH-140003)
gh-139155: Remove "dictionaries are sorted by key" note in `pprint` docs (GH-139159)
(cherry picked from commit 68622be935)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-10-12 16:55:49 +00:00
Miss Islington (bot)
6d6d02a982
[3.14] gh-116738: test dbm.gnu module on FT Python build (GH-138467) (#139987)
gh-116738: test `dbm.gnu` module on FT Python build (GH-138467)
(cherry picked from commit a18843dbfb)

Co-authored-by: Alper <alperyoney@fb.com>
2025-10-12 12:51:42 +00:00
Miss Islington (bot)
07eb67b859
[3.14] gh-127081: add critical sections to dbm objects (gh-132749) (#139996)
gh-127081: add critical sections to `dbm` objects (gh-132749)
(cherry picked from commit ffaeb3dddf)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-10-12 17:56:29 +05:30
Miss Islington (bot)
3b9694a8e6
[3.14] gh-139988: fix a leak when failing to create a Union type (GH-139990) (#139993)
gh-139988: fix a leak when failing to create a Union type (GH-139990)
(cherry picked from commit 6710156bd2)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-12 11:16:43 +00:00
Miss Islington (bot)
ae91b4bcd0
[3.14] gh-101100: Fix Sphinx warnings in Doc/library/signal.rst (GH-139930) (GH-139966)
gh-101100: Fix Sphinx warnings in `Doc/library/signal.rst` (GH-139930)
(cherry picked from commit 447c7a89fb)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-10-11 18:34:30 +00:00
Miss Islington (bot)
187588e675
[3.14] gh-139929: fix incorrect OpenSSL version-based guard in _ssl.c (GH-139945) (#139964)
gh-139929: fix incorrect OpenSSL version-based guard in `_ssl.c` (GH-139945)

fix OpenSSL version-based guards
(cherry picked from commit cdd3eee7fc)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-11 17:59:55 +00:00
Miss Islington (bot)
46148d18a2
[3.14] gh-139905: Provide suggestion in error message if Generic.__init_subclass__ was not called (GH-139943) (#139955)
gh-139905: Provide suggestion in error message if `Generic.__init_subclass__` was not called (GH-139943)
(cherry picked from commit 5776d0d2e0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-11 15:40:23 +00:00
Miss Islington (bot)
1a355d7366
[3.14] gh-96491: Deduplicate version in IDLE shell title (GH-139841) (#139931)
gh-96491: Deduplicate version in IDLE shell title (GH-139841)

Saving to a file added both the filename and repeated the version.
---------
(cherry picked from commit d4e5802588)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-10-11 02:02:34 +00:00
Miss Islington (bot)
2660e98b30
[3.14] gh-139001: Fix thread-safety issue in pathlib.Path (gh-139066) (gh-139926)
Don't cache the joined path in `_raw_path` because the caching isn't thread safe.
(cherry picked from commit d9b4eef71e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-10 21:47:47 +00:00
Miss Islington (bot)
7ea79f6342
[3.14] gh-138843: Removing "Unpacking" section from Download page (GH-139921)
(cherry picked from commit aa840f500c)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-10 14:31:38 -05:00
Kumar Aditya
72f25a8d9a
[3.14] gh-139894: fix incorrect sharing of current task while forking in asyncio (GH-139897) (#139913)
* [3.14] gh-139894: fix incorrect sharing of current task while forking in `asyncio`  (GH-139897)

Fix incorrect sharing of current task with the forked child process by clearing thread state's current task and current loop in `PyOS_AfterFork_Child`.
(cherry picked from commit b881df47ff)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>

* Update Lib/test/test_asyncio/test_unix_events.py
2025-10-10 22:36:02 +05:30
Miss Islington (bot)
60d15e1717
[3.14] gh-101100: Document zlib public constants to fix reference warnings (GH-139835) (#139910)
gh-101100: Document `zlib` public constants to fix reference warnings (GH-139835)
(cherry picked from commit c7f1da97eb)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-10 17:38:35 +02:00
Miss Islington (bot)
f8eb754dab
[3.14] gh-139843: Document signals (SIGSTOP, SIGVTALRM, SIGPROF) to fix sphinx references (GH-139896) (GH-139908)
gh-139843: Document signals (SIGSTOP, SIGVTALRM, SIGPROF) to fix sphinx references (GH-139896)
(cherry picked from commit 302f19d1f1)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-10-10 15:36:01 +00:00
Miss Islington (bot)
51b1043029
[3.14] gh-138860: Lazy import rlcompleter in pdb to avoid deadlock in subprocess (GH-139185) (GH-139305) (GH-139280)
* gh-138860: Lazy import rlcompleter in pdb to avoid deadlock in subprocess (GH-139185)
(cherry picked from commit c8624cd367)

* gh-139289: Lazy import rlcompleter to fix the refleak (GH-139305)
(cherry picked from commit 8288f3693f)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-10-10 16:23:52 +02:00
Miss Islington (bot)
ade6dea24b
[3.14] gh-139065: Fix trailing space before long word in textwrap (GH-139070) (GH-139902)
Fix trailing space before a wrapped long word if the line length with
a space is exactly "width".
(cherry picked from commit 1c598e0436)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-10 13:54:46 +00:00
Miss Islington (bot)
08738ce521
[3.14] gh-139783: Fix inspect.getsourcelines() for the case when a decorator is followed by a comment or an empty line (GH-139836) (GH-139889)
(cherry picked from commit f4104f5d74)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-10 08:18:32 +00:00
Miss Islington (bot)
5d34830f4d
[3.14] gh-139823: Extend list of optional dependencies in configure.rst (GH-139826) (#139887)
gh-139823: Extend list of optional dependencies in `configure.rst` (GH-139826)
(cherry picked from commit 8f14bddeae)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-10 06:56:05 +00:00
Miss Islington (bot)
321dfb2ff5
[3.14] gh-139843: Document signal.SIGQUIT to fix Sphinx references (GH-139844) (#139885)
gh-139843: Document `signal.SIGQUIT` to fix Sphinx references (GH-139844)
(cherry picked from commit 1f87d528a1)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-10-10 06:30:53 +00:00
Miss Islington (bot)
60732d7397
[3.14] gh-139842: Clarify __module__ description in typing.rst (GH-139863) (#139869)
Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2025-10-09 18:01:53 +00:00
Miss Islington (bot)
af1cb1cdb8
[3.14] GH-139809: Fix argparse subcommand prog not respecting color environment variables (GH-139818) (#139866)
GH-139809: Fix argparse subcommand prog not respecting color environment variables (GH-139818)
(cherry picked from commit 9fc4366f09)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2025-10-09 17:19:54 +00:00
Miss Islington (bot)
2cc13ff304
[3.14] gh-139672: Remove references to passlib (GH-139673) (#139867)
gh-139672: Remove references to `passlib` (GH-139673)
(cherry picked from commit 04461510fb)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2025-10-09 17:19:35 +00:00
Miss Islington (bot)
925625447f
[3.14] gh-139845: do not print twice in default asyncio REPL (GH-139846) (#139859)
gh-139845: do not print twice in default asyncio REPL (GH-139846)
(cherry picked from commit a310b3a99d)

Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-09 16:13:11 +00:00
Miss Islington (bot)
8761d6e644
[3.14] gh-139391: properly handle signal.signal() in UnixConsole when called from a non-main thread (GH-139392) (#139858)
gh-139391: properly handle `signal.signal()` in `UnixConsole` when called from a non-main thread (GH-139392)
(cherry picked from commit b8c8b8f1d3)

Co-authored-by: yihong <zouzou0208@gmail.com>
2025-10-09 16:10:51 +00:00
Łukasz Langa
de87549eb8
[3.14] gh-133400: Fixed Ctrl+D (^D) behavior in :mod:_pyrepl module (GH-133883) (GH-139850)
(cherry picked from commit 81959a0364)

Co-authored-by: DeepWzh <wzh2012@outlook.com>
Co-authored-by: adam j hartz <adam@smatz.net>
2025-10-09 17:38:25 +02:00
Kumar Aditya
926d734840
[3.14] gh-116738: make mmap module thread-safe (GH-139237) (#139825)
* [3.14] gh-116738: make `mmap` module thread-safe (GH-139237)
(cherry picked from commit 7f155f9c46)

Co-authored-by: Alper <alperyoney@fb.com>
2025-10-09 20:19:03 +05:30
Miss Islington (bot)
7c03e9078d
[3.14] GH-129805: Clean up some changes from GH-129806 (GH-133540) (#138972)
Co-authored-by: Brandt Bucher <brandt@python.org>
2025-10-09 14:12:25 +03:00
Miss Islington (bot)
342b644bd2
[3.14] gh-139742: Add support for Python 3.14 t-string prefixes in IDLE colorizer and tests (GH-139756) (#139831)
gh-139742: Add support for Python 3.14 t-string prefixes in IDLE colorizer and tests (GH-139756)

Add 't' prefix to colorizer.py stringprefix regex to support Python 3.14 template strings.
Add t prefixes to test_colorizer.py source test text and adjust line numbers on test methods.
---------
(cherry picked from commit 6fd1418341)

Co-authored-by: Anuradha Agrawal <paysur2111@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-09 09:51:58 +00:00
Miss Islington (bot)
08faef865c
[3.14] gh-101100: Fix reference warnings in c-api/init.rst documenting PyGILState_STATE (GH-139572) (#139832)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-09 09:41:57 +00:00
Miss Islington (bot)
17873b9b9c
[3.14] gh-139743: Avoid import-time print in test_sqlite3 (GH-139746) (GH-139828)
(cherry picked from commit 65089406a5)

Co-authored-by: Peter <peter86225@gmail.com>
2025-10-09 08:25:38 +00:00
Miss Islington (bot)
56072f9c05
[3.14] gh-139805: Bump test_repl_eio timeout for slow builtbots (GH-139807) (#139812)
gh-139805: Bump `test_repl_eio` timeout for slow builtbots (GH-139807)
(cherry picked from commit e7e3d1d4a8)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-08 23:00:20 +00:00
Miss Islington (bot)
824c1bce48
[3.14] Remove Cirrus macOS runners from CI (GH-139799) (#139802)
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-08 19:38:38 +00:00
Kumar Aditya
90cd009209
[3.14] gh-139748: fix leaks in AC error paths when using unicode FS-b… (#139789)
* [3.14] gh-139748: fix leaks in AC error paths when using unicode FS-based converters (GH-139765)
(cherry picked from commit b04a57deef)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-08 22:16:21 +05:30
Miss Islington (bot)
077652b44f
[3.14] gh-138843: Clean up downloads page (GH-138844) (#139796)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-08 16:21:50 +00:00
Dino Viehland
81dc8b12f0
[3.14] gh-139525: Don't specialize functions which have a modified vectorcall (GH-139524) (#139709)
Don't specialize functions which have a modified vectorcall
2025-10-08 09:13:34 -07:00
Miss Islington (bot)
1c1a0bdfdc
[3.14] gh-135676: Add a summary of source characters (GH-138194) (GH-139781)
(cherry picked from commit 59a6f9d8c5)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Micha Albert <info@micha.zone>
Co-authored-by: KeithTheEE <kmurrayis@gmail.com>
2025-10-08 18:07:05 +02:00
Miss Islington (bot)
14c923cc85
[3.14] gh-139736: Fix argparse indentation overshoot (GH-139738) (#139793)
gh-139736: Fix argparse indentation overshoot (GH-139738)
(cherry picked from commit 72e370c910)

Co-authored-by: ed <s@ocv.me>
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2025-10-08 16:02:08 +00:00
Miss Islington (bot)
4e3fc92c40
[3.14] gh-101100: Fix all Sphinx warnings in Doc/library/subprocess.rst (GH-139576) (#139787)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-08 18:45:37 +03:00
Miss Islington (bot)
ea1ed82fed
[3.14] gh-139774: use relaxed atomics for datetime hashes (GH-139775) (#139780)
gh-139774: use relaxed atomics for datetime hashes (GH-139775)
(cherry picked from commit 49fb46f555)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-08 21:09:09 +05:30
Miss Islington (bot)
f10dc2666c
gh-139769: Update PCBuild/find_python.bat to allow discovery of Python 3.14 (GH-139770)
Enable 3.14 py.exe can be use on PCBuild
(cherry picked from commit 570d17259f)

Co-authored-by: Wulian233 <1055917385@qq.com>
2025-10-08 15:26:22 +00:00
Miss Islington (bot)
d8898e1fbe
Adds support for building with VisualStudioVersion = 18.0 (GH-138980)
(cherry picked from commit 6920fa4bcd)

Co-authored-by: Steve Dower <steve.dower@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-08 16:13:13 +01:00
Miss Islington (bot)
c5ab1b7661
[3.14] GH-139590: Run ruff format on pre-commit for Tools/wasm (GH-139591) (#139744)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-08 08:11:09 -07:00
Miss Islington (bot)
a96cde9f80
[3.14] gh-133210: Fix test_pydoc without docstrings (GH-139654) (#139777)
gh-133210: Fix `test_pydoc` without docstrings (GH-139654)
(cherry picked from commit 708de26e31)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-08 14:15:52 +00:00
Miss Islington (bot)
d8bdc1e6f7
[3.14] gh-133210: Fix test_inspect without docstrings (GH-139651) (#139776)
gh-133210: Fix `test_inspect` without docstrings (GH-139651)
(cherry picked from commit 7c70cc5c23)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-10-08 14:14:19 +00:00
Miss Islington (bot)
b5230d73a9
[3.14] gh-83424: Allow empty name if handle is non-null when create ctypes.CDLL on Windows (GH-136878) (#138546)
gh-83424: Allow empty name if handle is non-null when create ctypes.CDLL on Windows (GH-136878)
(cherry picked from commit ed522ed211)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-08 15:56:13 +02:00
Miss Islington (bot)
d729fcf6e3
[3.14] gh-137589: Zipfile tests: close file objects (GH-138080) (#139766)
gh-137589: Zipfile tests: close file objects (GH-138080)

Zipfile tests: close file objects
(cherry picked from commit 5cea843594)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
2025-10-08 15:52:08 +02:00
Miss Islington (bot)
7e23d36770
[3.14] gh-137317: Fix inspect.signature() for class with wrapped __init__ or __new__ (GH-137862) (#138224)
gh-137317: Fix inspect.signature() for class with wrapped __init__ or __new__ (GH-137862)

Fixed several cases where __init__, __new__ or metaclass` __call__ is a descriptor
that returns a wrapped function.
(cherry picked from commit 025a2135ef)

Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2025-10-08 15:48:06 +02:00
Miss Islington (bot)
c05053589f
[3.14] gh-101100: Fix some Sphinx reference warnings in `whatsnew/2.6.rst` (GH-139236) (GH-139568)
(cherry picked from commit 04a2f80a60)

Co-authored-by: rowanbudge <rowanbudge@gmail.com>
Co-authored-by: rowanvil <rowan@anvil.works>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-10-08 14:46:41 +02:00
Miss Islington (bot)
fb223e691e
[3.14] GH-137573: Add test to check that the margin used for overflow protection is larger than the stack space used by the interpreter (GH-137724) (GH-139295)
(cherry picked from commit 16eae6d90d)

Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-08 14:44:16 +02:00
Miss Islington (bot)
5579708b1c
[3.14] gh-60462: Fix locale.strxfrm() on Solaris (GH-138242) (GH-138448)
It should interpret the result of wcsxfrm() as a sequence of abstract
integers, not a sequence of Unicode code points or using other encoding
scheme that does not preserve ordering.
(cherry picked from commit 482fd0c811)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:34:51 +02:00
Miss Islington (bot)
4e8f5e65eb
[3.14] gh-137490: Fix signal.sigwaitinfo() on NetBSD (GH-137523) (GH-138935)
Handle ECANCELED in the same way as EINTR to work around the Posix
violation in the NetBSD's implementation.
(cherry picked from commit 07d0b95b05)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:33:30 +02:00
Miss Islington (bot)
cbd532f2e8
[3.14] gh-137056: Fix DTrace build support on NetBSD (GH-137057) (GH-137444)
(cherry picked from commit 54a5fdffc8)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-10-08 14:31:26 +02:00
Miss Islington (bot)
7ed5419604
[3.14] gh-137463: Update validate_abstract_methods in test_collections.py (GH-137464) (GH-137503)
Update `validate_abstract_methods` in `test_collections.py`

The test for missing abstract methods in `validate_abstract_methods` incorrectly attempted to instantiate the generated class `C` with an argument (`C(name)`), which always raises a `TypeError: C() takes no arguments`. Although the test originally passes, it passes for the wrong reason.

This change makes the test correctly validate the enforcement of abstract methods in ABCs.
(cherry picked from commit 5be872350d)

Co-authored-by: Guilherme Leobas <guilhermeleobas@gmail.com>
2025-10-08 14:30:54 +02:00
Miss Islington (bot)
333cab0da7
[3.14] gh-137754: Fix import of zoneinfo if _datetime is not available (GH-137845) (GH-138084)
Both modules should use the Python implementation in that case.
(cherry picked from commit 6620ef0ff6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:28:41 +02:00
Miss Islington (bot)
0188e0fd38
[3.14] gh-137986: Fix and improve the csv functions docstrings (GH-137987) (GH-138107)
The csv.register_dialect() docstring no longer imply that it returns a dialect.
All functions have now signatures.
(cherry picked from commit aa1dbd4dde)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: maurycy <5383+maurycy@users.noreply.github.com>
2025-10-08 14:27:57 +02:00
Miss Islington (bot)
ebbce6b0f9
[3.14] gh-71679: Improve tests for repr() of bytes and bytearray (GH-138180) (GH-138182)
* Merge existing tests test_repr_str and test_to_str.
* Add more tests for non-printable and non-ASCII bytes.
* Add tests for special escape sequences ('\t\n\r').
* Add tests for slashes.
* Add more tests for quotes.
* Add tests for subclasses.
* Add test for non-ASCII class name.
* Only apply @check_bytes_warnings for str() tests.
(cherry picked from commit 0dbbf61cc2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:27:28 +02:00
Miss Islington (bot)
d424344ce9
[3.14] bpo-41839: Fix error checking in sched_get_priority_ functions (GH-22374) (GH-138201)
(cherry picked from commit bbcb75c986)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2025-10-08 14:26:59 +02:00
Miss Islington (bot)
669253fde5
[3.14] gh-138204: Forbid expansion of a shared anonymous mmap on Linux (GH-138220) (GH-138386)
This is a Linux kernel bug which caused a bus error.
https://bugzilla.kernel.org/show_bug.cgi?id=8691
(cherry picked from commit 33fcb0c4a0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:26:09 +02:00
Miss Islington (bot)
8da7c7e1f3
[3.14] gh-88375, gh-111788: Fix parsing errors and normalization in robotparser (GH-138502) (GH-138548)
* Don't fail trying to parse weird patterns.
* Don't fail trying to decode non-UTF-8 "robots.txt" files.
* No longer ignore trailing "?" in patterns and URLs.
* Distinguish raw special characters "?", "=" and "&" from the
  percent-encoded ones.
* Remove tests that do nothing.
(cherry picked from commit cb7ef18d70)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:22:44 +02:00
Miss Islington (bot)
3013683e99
[3.14] gh-118981: multiprocessing.popen_spawn_posix, fix potential hang (gh-118982) (GH-138605)
fix potential hang.

It can happen that the child crashes right in the beginning for whatever reason. In this case, the parent will hang when writing into the pipe, because the child fd is not closed yet.

The normal pattern is to close the child fds right after the child proc is forked/executed/spawned, so when the child dies, then also the pipes will be closed, and there will be no hang (the parent gets SIGPIPE instead).
(cherry picked from commit 8ed5a2b56c)

Co-authored-by: Albert Zeyer <albzey@gmail.com>
2025-10-08 14:22:05 +02:00
Miss Islington (bot)
32233d68d8
[3.14] gh-70765: avoid waiting for HTTP headers when parsing HTTP/0.9 requests (GH-139514) (#139600)
(cherry picked from commit 13dc2fde8c)
(cherry picked from commit 1fe89d324e)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-08 10:39:59 +00:00
Miss Islington (bot)
297157d968
[3.14] gh-92266: Update pre-commit (GH-139411) (#139466)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-08 13:25:17 +03:00
Bénédikt Tran
8ad6eda483
[3.14] gh-136912: fix handling of OverflowError in hmac.digest (GH-136917) (#137116)
The OpenSSL and HACL* implementations of HMAC single-shot
digest computation reject keys whose length exceeds `INT_MAX`
and `UINT32_MAX` respectively. The OpenSSL implementation
also rejects messages whose length exceed `INT_MAX`.

Using such keys in `hmac.digest` previously raised an `OverflowError`
which was propagated to the caller. This commit mitigates this case by
making `hmac.digest` fall back to HMAC's pure Python implementation
which accepts arbitrary large keys or messages.

This change only affects the top-level entrypoint `hmac.digest`, leaving
`_hashopenssl.hmac_digest` and `_hmac.compute_digest` untouched.

(cherry picked from commit d658b9053b)
2025-10-08 12:09:45 +02:00
Miss Islington (bot)
c625839237
[3.14] gh-91214: Skip tests failing on Solaris (GH-31978) (GH-138450)
(cherry picked from commit 34ed03875a)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2025-10-08 11:42:42 +03:00
Miss Islington (bot)
8ab7081015
[3.14] gh-135386: Fix "unable to open database file" errors on readonly DB (GH-135566) (GH-138056)
Add immutable=1 flag for read-only SQLite access to avoid WAL/SHM errors on readonly DB.
(cherry picked from commit c0ae92b7c0)

Co-authored-by: General_K1ng <generak1ng0@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-08 11:41:09 +03:00
Miss Islington (bot)
51dfc67092
[3.14] gh-138010: Fix __init_subclass__ forwarding by warnings.deprecated (GH-138210) (#138561)
gh-138010: Fix `__init_subclass__` forwarding by `warnings.deprecated` (GH-138210)
(cherry picked from commit e2c038f5be)

Co-authored-by: Brian Schubert <brianm.schubert@g
2025-10-07 21:29:28 -07:00
Miss Islington (bot)
e104aadcaf
[3.14] gh-127647: Fix and enable I/O protocol tests (GH-138369) (#138376)
gh-127647: Fix and enable I/O protocol tests (GH-138369)
(cherry picked from commit 3f23888fd7)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2025-10-07 21:29:02 -07:00
Miss Islington (bot)
dd5d86c7d5
[3.14] gh-137706: make typing._is_unpacked_typevartuple check for True instead of truthy (GH-137712) (#138574)
gh-137706: make typing._is_unpacked_typevartuple check for `True` instead of truthy (GH-137712)
(cherry picked from commit 7e652f402f)

Co-authored-by: David Ellis <ducksual@gmail.com>
2025-10-07 21:23:47 -07:00
Miss Islington (bot)
ed0e63fd0a
[3.14] gh-138558: Improve handling of Template annotations in annotationlib (GH-139072) (#139272)
gh-138558: Improve handling of Template annotations in annotationlib (GH-139072)
(cherry picked from commit 6ec058a1f7)

Co-authored-by: Dave Peck <davepeck@gmail.com>
2025-10-07 21:23:22 -07:00
Miss Islington (bot)
9e0b7d0866
[3.14] GH-137484: Have Tools/wasm/wasi use the build triple instead of "build" (GH-137485) (#137487)
GH-137484: Have `Tools/wasm/wasi` use the build triple instead of "build" (GH-37485)

This should help prevent issuse where something like a container is used to do one build and then someone tries to build again locally.
(cherry picked from commit 0953200b13)

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-08 02:11:31 +00:00
Miss Islington (bot)
6b26e62f37
[3.14] gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814) (#139084)
gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814)

* gh-138813: Default `BaseProcess` `kwargs` to `None` (GH-138814)

Set `BaseProcess.__init__(..., kwargs=None)` and initialize `kwargs` with
`dict(kwargs) if kwargs else {}`. This avoids a shared mutable default and
matches threading.Thread behavior.



* DummyProcess kwargs=None (which threading.Thread accepts properly)
(cherry picked from commit 5a15e73789)

Co-authored-by: Denis Sergeev <newjimbatler00@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-10-08 00:37:30 +00:00
Miss Islington (bot)
64f0e2d6fa
[3.14] gh-126631: gh-137996: fix pre-loading of __main__ (GH-135295) (#138607)
gh-126631: gh-137996: fix pre-loading of `__main__` (GH-135295)

gh-126631: gh-137996: fix pre-loading of `__main__`

The `main_path` parameter was renamed `init_main_from_name`, update the
forkserver code accordingly.  This was leading to slower startup times when people
were trying to preload the main module.

---------
(cherry picked from commit 0912b3a6db)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-10-08 00:37:04 +00:00
Miss Islington (bot)
6b090c9272
[3.14] GH-137248: Add a --logdir option to Tools/wasm/wasi (GH-137249) (GH-137252)
GH-137248: Add a `--logdir` option to `Tools/wasm/wasi` (GH-137249)
(cherry picked from commit 94498a53f3)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-07 23:51:19 +00:00
Miss Islington (bot)
9f97fa30f8
[3.14] GH-137243: Have Tools/wasm/wasi detect WASI SDK installs in /opt when the release tarball is extracted (GH-137244) (GH-137250)
GH-137243: Have `Tools/wasm/wasi` detect WASI SDK installs in `/opt` when the release tarball is extracted (GH-137244)
(cherry picked from commit 2f1a9f2ed4)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-07 23:13:35 +00:00
Miss Islington (bot)
357618266b
[3.14] Drop explicit tool installation in the dev container (GH-138211) (GH-138212)
Drop explicit tool installation in the dev container (GH-138211)

This is now handled upstream in the dev container image itself.
(cherry picked from commit d910b93f78)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-07 21:38:31 +00:00
Miss Islington (bot)
d11e69d620
[3.14] gh-139700: Check consistency of the zip64 end of central directory record (GH-139702) (GH-139706)
Support records with "zip64 extensible data" if there are no bytes
prepended to the ZIP file.
(cherry picked from commit 162997bb70)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 23:16:26 +02:00
Miss Islington (bot)
09fdd219a5
[3.14] gh-105487: Fix __dir__ entries of GenericAlias (GH-138578) (GH-138629)
(cherry picked from commit b0420b505e)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-10-07 23:12:13 +02:00
Miss Islington (bot)
63bd8cfcdb
[3.14] gh-138729: Cover inspect.formatannotationrelativeto with tests (GH-138730) (GH-138747)
(cherry picked from commit f5fa336579)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-10-07 23:10:49 +02:00
Miss Islington (bot)
dfdda53e67
[3.14] gh-138432: Improved invalid path checking in zoneinfo.reset_tzpath() (GH-138433) (GH-138777)
* Improve error messages for path-like relative paths and path-like bytes paths.
* TZPATH is now always a tuple of strings.
(cherry picked from commit 859aecc33b)

Co-authored-by: Stephen Morton <git@tungol.org>
2025-10-07 23:06:37 +02:00
Miss Islington (bot)
61d49a5d37
[3.14] gh-138239: Fix incorrect highlighting of "type" in type statements in the REPL (GH-138241) (GH-138937)
(cherry picked from commit 26cfb17942)

Co-authored-by: 00ll00 <40747228+00ll00@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-07 23:02:32 +02:00
Miss Islington (bot)
e953cead61
[3.14] Touch up Setup.local handling in Tools/wasm/wasi (GH-137051) (GH-137053)
Touch up `Setup.local` handling in `Tools/wasm/wasi` (GH-137051)

The comment in the generated file is now more self-explanatory. The checks for unexpected file contents are also strengthened.
(cherry picked from commit ec7fad79d2)

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Zachary Ware <zach@python.org>
2025-10-07 20:58:53 +00:00
Miss Islington (bot)
a869796927
[3.14] gh-63161: Add more tests for source encoding (GH-139440) (GH-139442)
(cherry picked from commit b2f5ad0c6d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 22:51:14 +02:00
Miss Islington (bot)
2fc69e88e6
[3.14] gh-123441: Correct the supported languages of the iso-8859-4 codec (GH-137034) (GH-137419)
(cherry picked from commit 525784aa65)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-07 22:38:47 +02:00
Miss Islington (bot)
827c90b8b2
[3.14] Add test for opening an SQLite with bytes path (GH-136331) (GH-137632)
(cherry picked from commit 1bde13b0e9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 22:35:06 +02:00
Miss Islington (bot)
181cecc5c0
[3.14] gh-126008: Improve docstrings for Tkinter cget and configure methods (GH-133303) (GH-137660)
* Explain the behavior of Widget.configure() depending on arguments.
* Unify descriptions.
* Replace "resource" with "option".
(cherry picked from commit 027cacb67c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 22:34:36 +02:00
Serhiy Storchaka
9ec4e3838a
[3.14] gh-138264: Fix gcc 14 compiler warnings (GH-138265) (GH-138426)
(cherry picked from commit 4a33077fdb)
2025-10-07 22:26:05 +02:00
Stan Ulbrych
537b558ce9
[3.14] gh-137920: Fix semantically relevant typo in curses.window.attron (#137940) (GH-138506)
Originally authored by: vict-Yang

(cherry picked from commit ce70a57bc0)
2025-10-07 22:21:41 +02:00
Miss Islington (bot)
9853bbb1dc
[3.14] gh-134466: Don't run when termios is inaccessible (GH-138911) (GH-139029)
Without the ability to set required capabilities, the REPL cannot
function properly (syntax highlighting and multiline editing can't
work).
We refuse to work in this degraded state.

(cherry picked from commit 2fc7004d54)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-10-07 22:15:56 +02:00
Miss Islington (bot)
89a7b05f23
[3.14] gh-78319: Fix implementation of IMAP APPEND UTF8 (GH-9436) (GH-139406)
Make UTF8 support for the IMAP APPEND command RFC 6855 compliant.
(cherry picked from commit 408154d64a)

Co-authored-by: Gordon Messmer <gordon.messmer@gmail.com>
2025-10-07 22:12:30 +02:00
Miss Islington (bot)
f0f0566292
[3.14] gh-130567: Enable previously skipped locale tests on FreeBSD and macOS (GH-138652) (GH-139421)
(cherry picked from commit 1b8dcdacc7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 22:11:34 +02:00
Miss Islington (bot)
103766528f
[3.14] gh-139076: Fix regression in pydoc not showing extension functions (GH-139077) (GH-139160)
Fix a bug in the pydoc module that was hiding functions in a Python
module if they were implemented in an extension module and the module did
not have __all__.
(cherry picked from commit 7257b24140)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 21:57:28 +02:00
Miss Islington (bot)
b53f46a7b7
[3.14] Doc: Improve clarity for subinterpreters in What's New in 3.14 (GH-139221) (GH-139722)
(cherry picked from commit 25edfa7cf1)

Co-authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-07 21:55:52 +02:00
Miss Islington (bot)
fff26500e5
[3.14] gh-130567: Fix possible crash in locale.strxfrm() (GH-138940) (GH-139265)
On some macOS versions there was an off-by-one error in wcsxfrm() which
caused writing past the end of the array if its size was not calculated
by running wcsxfrm() first.

(cherry picked from commit 5854cf38a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 21:54:04 +02:00
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
Miss Islington (bot)
04d75658ac
[3.14] gh-139436: Remove `dist-pdf` from the docs archives rebuild target (GH-139437) (#139692)
gh-139436: Remove ``dist-pdf`` from the docs archives rebuild target (GH-139437)
(cherry picked from commit 0e2cdd313b)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-07 19:12:05 +01:00
Miss Islington (bot)
75de39ba1b
[3.14] gh-137185: Fix _Py_DumpStack() async signal safety (gh-137187) (gh-137206)
Call backtrace() once when installing the signal handler to ensure that
libgcc is dynamically loaded outside the signal handler.

This fixes a "signal-unsafe call inside of a signal" TSan error from
test_faulthandler.test_enable_fd.
(cherry picked from commit 11a8652e25)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-07 18:11:46 +00:00
Miss Islington (bot)
93ac6f3472
[3.14] gh-135444: fix asyncio.DatagramTransport.sendto to account for datagram header size when data cannot be sent (GH-135445) (#137245)
gh-135444: fix `asyncio.DatagramTransport.sendto` to account for datagram header size when data cannot be sent (GH-135445)
(cherry picked from commit e3ea861351)

Co-authored-by: Justin Bronder <jsbronder@cold-front.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-07 23:40:03 +05:30
Miss Islington (bot)
bfcd5f25a5
[3.14] gh-138661: fix data race in PyCode_Addr2Line (GH-138664) (#138834)
gh-138661: fix data race in `PyCode_Addr2Line` (GH-138664)
(cherry picked from commit ea26f6da39)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-07 18:06:45 +00:00
Miss Islington (bot)
98d33bf19c
[3.14] gh-139624: Skip problematic locales on AIX in test_date_locale2 (GH-139625) (GH-139644)
(cherry picked from commit 6f3dae0dc5)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 20:02:42 +02:00
Miss Islington (bot)
7a1a79d731
[3.14] gh-138163: skip failures if tests are run with SCHED_BATCH on glibc (GH-138576) (GH-138820)
(cherry picked from commit 492941459a)

Co-authored-by: jxes993409 <68891412+jxes993409@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 20:01:51 +02:00
Miss Islington (bot)
d7500f6078
[3.14] gh-138008: Fix segfaults in _ctypes due to invalid argtypes (GH-138285) (GH-138742)
(cherry picked from commit 1ce05537a3)

Signed-off-by: Nguyen Viet Dung <29406816+magnified103@users.noreply.github.com>
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 20:00:28 +02:00
Miss Islington (bot)
7aab50cd7a
[3.14] gh-136507: Fix mimetypes CLI to handle multiple file parameters (GH-136508) (GH-138140)
(cherry picked from commit 81268a3e2a)

Co-authored-by: Wulian233 <1055917385@qq.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 19:59:52 +02:00
Miss Islington (bot)
93f5e26d97
[3.14] gh-137376: Add note on top-level global declarations (GH-137707) (GH-138023)
(cherry picked from commit 9f05f98730)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-10-07 19:59:29 +02:00
Miss Islington (bot)
7d9b2671c6
[3.14] gh-123681: Check NORMALIZE_CENTURY behavior at runtime; require C99 (GH-136022) (GH-137947)
A runtime check is needed to support cross-compiling.

Remove the _Py_NORMALIZE_CENTURY macro.
Remove _pydatetime.py's _can_support_c99.
(cherry picked from commit 719e5c3f71)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 19:59:06 +02:00
Miss Islington (bot)
fad7bfc282
[3.14] gh-138902: Fix generator send arg name (GH-138905) (#138914)
gh-138902: Fix generator send arg name (GH-138905)
(cherry picked from commit cb07bd24ee)

Co-authored-by: Marat Khagazheev <marathagazeev@gmail.com>
Co-authored-by: marat <khagazheev@artlebedev.ru>
2025-10-07 23:27:05 +05:30
Miss Islington (bot)
e3d102ecdc
[3.14] gh-136823: Update documentation on excluded headers in Python.h (GH-136824) (#137437)
gh-136823: Update documentation on excluded headers in Python.h (GH-136824)
(cherry picked from commit c2428ca9ea)

Co-authored-by: Sina Zel taat <111974143+SZeltaat@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-10-07 23:23:33 +05:30
Miss Islington (bot)
a03dd74c94
[3.14] gh-137239: Add *_max functions to heapq.__all__ (gh-137241) (#137256)
gh-137239: Add *_max functions to heapq.__all__ (gh-137241)
(cherry picked from commit 5f35f9b8fa)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-07 23:22:07 +05:30
Miss Islington (bot)
7b203aa2ff
[3.14] gh-136516: Mention installation artifacts as de-facto resources (GH-136419) (#137038)
gh-136516: Mention installation artifacts as de-facto resources (GH-136419)

Files like NUL on windows are, from `importlib.resources` point of
view, an artifact caused by installing to a filesystem directory.
Mention these.
(cherry picked from commit fac4964fdb)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 23:20:13 +05:30
Miss Islington (bot)
33340233d0
[3.14] gh-139698: Fix typo in What's New 3.14 (GH-139699) (#139711)
gh-139698: Fix typo in What's New 3.14 (GH-139699)
(cherry picked from commit d396a32b3d)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-07 17:46:00 +00:00
Sam Gross
fb699effbf
[3.14] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518) (gh-137730)
There were a few thread-safety issues when profiling or tracing all
threads via PyEval_SetProfileAllThreads or PyEval_SetTraceAllThreads:

* The loop over thread states could crash if a thread exits concurrently
  (in both the free threading and default build)
* The modification of `c_profilefunc` and `c_tracefunc` wasn't
  thread-safe on the free threading build.
(cherry picked from commit a10152f8fd)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 13:45:23 -04:00
Miss Islington (bot)
c1cb785ebd
[3.14] gh-126662: naming consistency for signal.ItimerError (GH-126712) (#137122)
gh-126662: naming consistency for `signal.ItimerError` (GH-126712)
(cherry picked from commit d5fa437dfb)

Co-authored-by: Stephen Morton <git@tungol.org>
2025-10-07 19:42:46 +02:00
Miss Islington (bot)
98ca0b3e2b
[3.14] Fix docs for Queue.shutdown (gh-137028) (#137080)
Fix docs for Queue.shutdown (gh-137028)
(cherry picked from commit 245671555b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 19:41:03 +02:00
Miss Islington (bot)
08d8dadfc2
[3.14] gh-136278: Document codecs.escape_encode() and codecs.escape_decode() (GH-136314) (#137149)
gh-136278: Document codecs.escape_encode() and codecs.escape_decode() (GH-136314)

Closes GH-136278
(cherry picked from commit 6784ef7da7)

Co-authored-by: Toshaksha <147024929+Toshaksha@users.noreply.github.com>
2025-10-07 19:40:30 +02:00
Miss Islington (bot)
57c8e3eb8e
[3.14] gh-58124: Avoid CP_UTF8 in UnicodeDecodeError (GH-137415) (#137460)
gh-58124: Avoid CP_UTF8 in UnicodeDecodeError (GH-137415)

Fix name of the Python encoding in Unicode errors of the code page
codec: use "cp65000" and "cp65001" instead of "CP_UTF7" and "CP_UTF8"
which are not valid Python code names.
(cherry picked from commit ce1b747ff6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-07 19:39:31 +02:00
Miss Islington (bot)
e4e8c5a3b0
[3.14] gh-139208: Fix regrtest --fast-ci --verbose (GH-139240) (#139260)
gh-139208: Fix regrtest --fast-ci --verbose (GH-139240)

Don't ignore the --verbose option anymore.
(cherry picked from commit dd683f8f34)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-07 19:39:06 +02:00
Miss Islington (bot)
b343009377
[3.14] gh-71810: Fix _PyLong_AsByteArray() undefined behavior (GH-138873) (#138883)
gh-71810: Fix _PyLong_AsByteArray() undefined behavior (GH-138873)

Don't read p[-1] when p is an empty string: when n==0.
(cherry picked from commit 8b5ce31c2b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-07 19:38:40 +02:00
Miss Islington (bot)
52e88585b0
[3.14] gh-137179: Fix flaky test_history_survive_crash test (gh-137180) (gh-137216)
Kill the REPL subprocess once it prints the output from the command
immediately before the `time.sleep()`.
(cherry picked from commit 98d462cf4d)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-07 17:38:30 +00:00
Miss Islington (bot)
6e9845455e
[3.14] gh-135329: Use longer timeout in pyrepl test_repl_eio() (GH-139503) (#139506)
gh-135329: Use longer timeout in pyrepl test_repl_eio() (GH-139503)

Replace hardcoded 5 seconds with support.SHORT_TIMEOUT.

Fix the following error on slow CI such as GitHub Action UBSan:

test test_pyrepl failed -- Traceback (most recent call last):
  File "Lib/test/test_pyrepl/test_unix_console.py", line 362, in test_repl_eio
    _, err = proc.communicate(timeout=5)  # sleep for pty to settle
             ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "Lib/subprocess.py", line 1219, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 2126, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 1266, in _check_timeout
    raise TimeoutExpired(
    ...<2 lines>...
            stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[...]' timed out after 5 seconds
(cherry picked from commit c985822d86)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-07 19:38:12 +02:00
Miss Islington (bot)
9e13cc2896
[3.14] gh-137017: Ensure Thread.is_alive() only returns False after the underlying OS thread exits (gh-137315) (gh-138916)
(cherry picked from commit aa9ceb1721)

Co-authored-by: Abdul <abdulrasheedibrahim47@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-07 17:37:31 +00:00
Sam Gross
85dabb9c15
[3.14] gh-137238: Fix data race in _Py_slot_tp_getattr_hook (gh-137240) (#137416)
Replacing the slot isn't thread-safe if the GIL is disabled. Don't
require that the slot has been replaced when specializing.
(cherry picked from commit 485b16b4f7)
2025-10-07 17:36:56 +00:00
Kumar Aditya
5cd6cfe4cf
[3.14] gh-136234: Fix SelectorSocketTransport.writelines to be robust to connection loss (GH-136743) (#138702) 2025-10-07 23:06:04 +05:30
Miss Islington (bot)
de84d09050
[3.14] gh-139516: Fix lambda colon start format spec in f-string in tokenizer (GH-139657) (#139701)
gh-139516: Fix lambda colon start format spec in f-string in tokenizer (GH-139657)
(cherry picked from commit 539461d9ec)

Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
2025-10-07 18:35:17 +01:00
Miss Islington (bot)
cec4ddf23e
[3.14] gh-128639: Don't assume one thread in subinterpreter finalization with fixed daemon thread support (GH-134606) (GH-139050)
gh-128639: Don't assume one thread in subinterpreter finalization with fixed daemon thread support (GH-134606)

This reapplies GH-128640.
(cherry picked from commit a64881363b)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-07 13:30:38 -04:00
Miss Islington (bot)
08bea299bf
[3.14] gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164) (GH-139168)
gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164)
(cherry picked from commit d06113c7a7)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-07 13:30:23 -04:00
Miss Islington (bot)
a69bdab541
[3.14] gh-123828: Fix data race in _interpchannels._waiting_release (GH-124107) (GH-139517)
gh-123828: Fix data race in `_interpchannels._waiting_release` (GH-124107)
(cherry picked from commit f39dea3bae)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
2025-10-07 13:29:37 -04:00
Miss Islington (bot)
9e091dbf02
[3.14] gh-138756: Fix leak of inittab memory in PyInitConfig_Free() (GH-138792) (#139703)
gh-138756: Fix leak of inittab memory in PyInitConfig_Free() (GH-138792)
(cherry picked from commit 3d521a62e7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-07 17:11:20 +00:00
Miss Islington (bot)
ddd1264469
[3.14] gh-82916: Don't fail when importing from / with sys.pycache_prefix set (GH-30456) (GH-137906)
(cherry picked from commit d8a9466e29)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 18:55:33 +02:00
Miss Islington (bot)
0accda7468
[3.14] gh-138756: Fix memory leak in PyInitConfig_Free() (GH-138759) (#138785)
gh-138756: Fix memory leak in PyInitConfig_Free() (GH-138759)

Clear also memory of PyConfig members.
(cherry picked from commit 96dee64c73)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-07 18:42:50 +02:00
Victor Stinner
6ed9be1a55
[3.14] gh-137058: Sync _Py_NULL macro with the main branch (#137409)
gh-137058: Sync _Py_NULL macro with the main branch

* use __STDC_VERSION__ >= 202311L instead of
  __STDC_VERSION__ > 201710L.
* Check for _MSC_VER.
2025-10-07 18:41:45 +02:00
Hugo van Kemenade
4319884256 Post 3.14.0 2025-10-07 17:15:20 +03:00
Hugo van Kemenade
ebf955df7a Python 3.14.0 2025-10-07 12:34:52 +03:00
Miss Islington (bot)
33f1330bd5
[3.14] GH-123299: Announce final release in What's New in Python 3.14 (GH-139631) (#139685)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-07 08:56:02 +00:00
Miss Islington (bot)
433b638af6
[3.14] gh-124111: Update macOS installer to use Tcl/Tk 8.6.17. (GH-139682) (#139683)
gh-124111: Update macOS installer to use Tcl/Tk 8.6.17. (GH-139682)
(cherry picked from commit 6d804e4efb)

Co-authored-by: Ned Deily <nad@python.org>
2025-10-07 05:19:28 +00:00
Miss Islington (bot)
0944953cee
[3.14] gh-139573: Update macOS installer to use OpenSSL 3.0.18 (GH-139575) (#139680)
gh-139573: Update macOS installer to use OpenSSL 3.0.18 (GH-139575)
(cherry picked from commit 23410f0a9e)

Co-authored-by: Zachary Ware <zach@python.org>
2025-10-07 08:01:57 +03:00
Miss Islington (bot)
847474ce5d
[3.14] Add warnings filter suggestions to PEP 765 entry in What's New (GH-139658) (#139676)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-07 00:30:00 +03:00
Miss Islington (bot)
57c37a4623
[3.14] gh-116488: Mention dict.get in the data structures tutorial (GH-139643) (#139655)
Co-authored-by: Cycloctane <Cycloctane@outlook.com>
2025-10-06 19:04:44 +03:00
Sebastian Pipping
ab89ca06fa
[3.14] gh-139400: Move NEWS item from section "Core and Builtins" to section "Security" (GH-139606) (#139663) 2025-10-06 18:12:43 +03:00
Miss Islington (bot)
f776254080
[3.14] gh-137242: Allow Android testbed to take all Python command-line options (GH-138805) (#139637)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-10-06 15:15:06 +03:00
Miss Islington (bot)
bb212a1a8b
[3.14] GH-123299: Copyedit 3.14 What's New: Trivia (GH-139618) (#139626)
GH-123299: Copyedit 3.14 What's New: Trivia (GH-139618)
(cherry picked from commit 46de475af7)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-05 23:34:05 +03:00
Miss Islington (bot)
3aeee0863a
[3.14] GH-123299: Copyedit 3.14 What's New: New Features (GH-139543) (#139615)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-05 21:38:28 +03:00
Miss Islington (bot)
66ca0d9ae6
[3.14] gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (GH-139403) (#139606)
Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2025-10-05 16:02:11 +00:00
Miss Islington (bot)
08d289208b
[3.14] gh-138130: Fix return value of libc_ver() on Emscripten (GH-138132) (#138312)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-10-05 16:03:49 +03:00
Miss Islington (bot)
07e0eb2093
[3.14] gh-118767: Remove `bool(NotImplemented)` from pending-removal document (GH-139526) (#139599)
Co-authored-by: Jost Migenda <jost.migenda@kcl.ac.uk>
2025-10-05 16:01:35 +03:00
Miss Islington (bot)
1ffd62baca
[3.14] gh-139310: skip test_aead_aes_gcm for Linux kernel between 6.16.0 and 6.17.x (GH-139552) (#139594)
gh-139310: skip `test_aead_aes_gcm` for Linux kernel between 6.16.0 and 6.17.x (GH-139552)

Currently, Fedora 42 uses a custom Linux Kernel 6.16.9 that backported an upstream change
from 6.17-rc7 [1,3] but not its subsequent fix [2]. Until the issue is resolved upstream,
we skip the failing test `test_socket.test_aead_aes_gcm` for kernel versions between 6.16
and 6.17.x.

[1] 1b34cbbf4f
[2] d0ca0df179.
[3] 45bcf60fe4
(cherry picked from commit 41712c4e09)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-05 08:53:23 +00:00
Miss Islington (bot)
51f8f44bd0
[3.14] gh-139573: Update OpenSSL version used in iOS builds (GH-139582) (#139589)
gh-139573: Update OpenSSL version used in iOS builds (GH-139582)

Update OpenSSL version used in iOS builds.
(cherry picked from commit 20758f9bb1)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-10-05 09:09:09 +03:00
Miss Islington (bot)
a450151642
[3.14] gh-139573: Update Windows builds to use OpenSSL 3.0.18 (GH-139574) (#139586)
gh-139573: Update Windows builds to use OpenSSL 3.0.18 (GH-139574)
(cherry picked from commit 063cef9999)

Co-authored-by: Zachary Ware <zach@python.org>
2025-10-05 08:00:29 +03:00
Miss Islington (bot)
8cb73119c6
[3.14] gh-139573: Update OpenSSL in CI (GH-139577) (#139583)
gh-139573: Update OpenSSL in CI (GH-139577)
(cherry picked from commit 98e748b3a0)

Co-authored-by: Zachary Ware <zach@python.org>
2025-10-05 07:50:26 +03:00
Miss Islington (bot)
bc85a34f8a
[3.14] gh-139573: Update Android to OpenSSL 3.0.18 (GH-139562) (#139581)
gh-139573: Update Android to OpenSSL 3.0.18 (GH-139562)

Update Android to OpenSSL 3.0.18.
(cherry picked from commit 0f0fc5a163)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-10-05 07:49:36 +03:00
Miss Islington (bot)
2f96a40ec0
[3.14] gh-138558: Improve description of `Interpolation.expression` (GH-139187) (#139579)
gh-138558: Improve description of ``Interpolation.expression`` (GH-139187)
(cherry picked from commit 880c9526f9)

Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-05 07:41:43 +03:00
Miss Islington (bot)
8566ee2507
[3.14] gh-138703: clarify data buffer requirement of asyncio.StreamWriter.write (GH-139564) (#139570)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-04 16:40:21 +00:00
Miss Islington (bot)
6f2635787b
[3.14] Synced docs and docstring for sysconfig.get_platform (GH-135530) (#138976)
Synced docs and docstring  for `sysconfig.get_platform` (GH-135530)
(cherry picked from commit 01cc53295c)

Co-authored-by: ivan <ivandietert@gmail.com>
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
Co-authored-by: Ned Deily <nad@python.org>
Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
2025-10-04 17:55:25 +03:00
Miss Islington (bot)
ec97866567
[3.14] GH-123299: Copyedit 3.14 What's New: New and Improved Modules (GH-139530) (#139555)
GH-123299: Copyedit 3.14 What's New: New and Improved Modules (GH-139530)
(cherry picked from commit c33dc154b4)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-04 16:45:35 +03:00
Miss Islington (bot)
e7ee62b5c8
[3.14] GH-123299: Copyedit 3.14 What's New: Other Language Changes (GH-139425) (#139508)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-03 23:46:29 +03:00
Miss Islington (bot)
a73fc979cd
[3.14] gh-105987: unskip test_issue105987 from test_asyncio.test_eager_task_factory (GH-139538) (#139539)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-03 23:21:28 +03:00
Miss Islington (bot)
292b6cf3e6
[3.14] Document Py_AddPendingCall() change with subinterpreters in 3.12 (GH-139117) (#139118)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-03 23:20:35 +03:00
Miss Islington (bot)
a81eeaf582
[3.14] gh-137638: Use macos-15-intel in GitHub Actions (GH-139154) (#139545)
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-03 23:16:01 +03:00
Miss Islington (bot)
22c63945c1
[3.14] gh-139495: Fix hashlib.file_digest() versionchanged description of BlockingIOError (GH-139496) (#139522)
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
2025-10-03 00:11:58 +03:00
Miss Islington (bot)
a312dd0f1e
[3.14] gh-139487: add missing imports for standalone doctest Enum examples (GH-139488) (#139493)
gh-139487: add missing imports for standalone doctest `Enum` examples (GH-139488)
(cherry picked from commit f3d7faeafa)

Co-authored-by: Peter <35064951+ttw225@users.noreply.github.com>
2025-10-02 17:37:19 +03:00
Miss Islington (bot)
86bc87b30d
[3.14] gh-132006: Add support for handling XCPrivacy manifests (GH-139163) (#139410)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-10-01 16:50:33 +03:00
Miss Islington (bot)
20f472b629
[3.14] GH-123299: Copyedit 3.14 What's New: Deprecated (GH-139433) (#139457)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-01 12:29:07 +03:00
Miss Islington (bot)
1ae1db8056
[3.14] Document that PyInterpreterState_GetDict returns a borrowed reference (GH-139451) (#139463)
Document that `PyInterpreterState_GetDict` returns a borrowed reference (GH-139451)
(cherry picked from commit 80cdf3ef74)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-01 08:39:54 +03:00
Miss Islington (bot)
622f37f9dd
[3.14] Remove link to the PDF downloads (GH-139142) (#139426)
Remove link to the PDF downloads (GH-139142)
(cherry picked from commit 6b5f15698a)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-30 00:12:28 +03:00
Miss Islington (bot)
4372a05ab0
[3.14] gh-134953: Make the True/False/None check more efficient (GH-138931) (#138939) 2025-09-29 21:11:41 +01:00
Miss Islington (bot)
af694375ea
[3.14] GH-123299: Copyedit 3.14 What's New: CPython bytecode changes (GH-139402) (#139420)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-29 18:55:26 +03:00
Miss Islington (bot)
146a37b458
[3.14] gh-139146: Check calloc() results in _testembed.c::test_pre_initialization_sys_options (GH-139147) (#139413)
Co-authored-by: Denis Sergeev <zeff@altlinux.org>
2025-09-29 15:04:47 +03:00
Miss Islington (bot)
7a65a47795
[3.14] Make Android streams respect the unbuffered (-u) option (GH-138806) (#139108)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-09-29 11:16:25 +03:00
Miss Islington (bot)
997e4711e9
[3.14] gh-136744: Remove unnecessary chmod from pydoc.apropos() test. (GH-136746) (#139242)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2025-09-29 11:12:31 +03:00
Russell Keith-Magee
91d86452c3
[3.14] gh-138171: Migrate iOS testbed location and add Apple build script (#138176) (#139204)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-29 11:11:59 +03:00
Miss Islington (bot)
c82079e0b4
[3.14] gh-135447: Document the `NOT_TAKEN & POP_ITER` bytecode instructions (GH-135803) (#139399)
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2025-09-28 22:02:33 +03:00
Shantanu
73a575ffea
[3.14] Link to 3.14 GC design docs (#139387) 2025-09-28 14:47:05 +01:00
Bénédikt Tran
4608a300d5
[3.14] gh-138633: synchronize documented signatures of SSL objects with runtime ones (GH-138639, GH-138648) (#138646)
(cherry picked from commit 3255c0c870)
(cherry picked from commit 4ef51fa75c)
2025-09-27 08:12:11 +02:00
Miss Islington (bot)
57617732af
[3.14] gh-139312: Update bundled libexpat to 2.7.3 (GH-139319) (#139376)
gh-139312: Update bundled libexpat to 2.7.3 (GH-139319)

(cherry picked from commit 48d0d0dd97)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-27 08:10:07 +02:00
Miss Islington (bot)
f2b82b3b3b
[3.14] gh-127502: Fix typo in XML security notes (GH-139335) (#139346)
gh-127502: Fix typo in XML security notes (GH-139335)
(cherry picked from commit 6fa1e552e0)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2025-09-26 13:43:00 +01:00
Miss Islington (bot)
7519ac294f
[3.14] gh-139330: Check expat version/checksum in SBOM with refresh.sh
gh-139330: Check expat version/checksum in SBOM with refresh.sh

Check expat version/checksum in SBOM with refresh.sh
(cherry picked from commit 89b5571025)

Co-authored-by: Seth Michael Larson <seth@python.org>
2025-09-25 18:30:14 +00:00
Karolina Surma
c76fd771b5
[3.14] Fix the reference to unicode specification (#139138) (#139286)
Fix the reference to unicode specification (#139138)

(cherry picked from commit b36dee855d)
2025-09-24 18:11:20 +01:00
Miss Islington (bot)
460ad1aa1b
[3.14] Make sure the `:keyword: role works for case` (GH-138878) (#139200)
Make sure the ``:keyword:`` role works for ``case`` (GH-138878)
(cherry picked from commit 848d926786)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-09-22 07:13:05 +01:00
Miss Islington (bot)
cf4573b51e
[3.14] gh-138092: Correct the documented signature of `mmap.flush` (GH-138671) (#139202)
gh-138092: Correct the documented signature of ``mmap.flush`` (GH-138671)
(cherry picked from commit e101f907dc)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-09-21 21:24:10 +01:00
Miss Islington (bot)
ccdc0c9992
[3.14] Doc/library/os.rst: Remove spurious parenthesis (GH-139205) (#139217)
`Doc/library/os.rst`: Remove spurious parenthesis (GH-139205)
(cherry picked from commit 9c3d09b984)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-21 20:56:06 +01:00
Miss Islington (bot)
665a3495bf
[3.14] gh-118803: Improve documentation around ByteString deprecation (GH-139115) (#139136)
gh-118803: Improve documentation around `ByteString` deprecation (GH-139115)
(cherry picked from commit 4305cc3ef3)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-09-18 17:54:43 +00:00
Miss Islington (bot)
e560865120
[3.14] gh-137242: Mention Android binary releases in documentation (GH-138305) (#139124)
gh-137242: Mention Android binary releases in documentation (GH-138305)

Adds a mention of binary releases to the Android documentation.

---------


(cherry picked from commit 594bdde9df)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-09-18 15:47:36 +01:00
Hugo van Kemenade
869f1d8f6a Post 3.14.0rc3 2025-09-18 12:49:45 +01:00
Hugo van Kemenade
1c5b28405a Python 3.14.0rc3 2025-09-18 09:45:38 +01:00
Miss Islington (bot)
a20395b899
[3.14] GH-139067: Add example for argparse's append action (GH-131389) (#139068)
GH-139067: Add example for `argparse`'s `append` action (GH-131389)
(cherry picked from commit 101fd33065)

Co-authored-by: Moshe Kaplan <mosheekaplan@gmail.com>
2025-09-17 23:27:53 +01:00
Miss Islington (bot)
0e4e608f03
[3.14] gh-128627: Use __builtin_wasm_test_function_pointer_signature for Emscripten trampoline (GH-137470) (#139039)
gh-128627: Use __builtin_wasm_test_function_pointer_signature for Emscripten trampoline (GH-137470)

With https://github.com/llvm/llvm-project/pull/150201 being merged, there is
now a better way to generate the Emscripten trampoline, instead of including
hand-generated binary WASM content. Requires Emscripten 4.0.12.
(cherry picked from commit 2629ee4eb0)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-09-17 17:21:01 +01:00
Miss Islington (bot)
7a2854eb12
[3.14] gh-132558: Improve argparse docs on combining type and choices (GH-133827) (#139057)
gh-132558: Improve `argparse` docs on combining `type` and `choices` (GH-133827)
(cherry picked from commit dd0840bf67)

Co-authored-by: Hans Then <hans.then@gmail.com>
Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
2025-09-17 17:19:33 +01:00
Miss Islington (bot)
9d0ca237af
[3.14] gh-137988: Fix const description in argparse.add_argument() docs (GH-138315) (#139051)
Co-authored-by: PrinceNaroliya <naroliyaprince@gmail.com>
Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
2025-09-17 18:51:30 +03:00
Miss Islington (bot)
9741cfc73a
[3.14] gh-99948: Support ctypes.util.find_library in emscripten environment (GH-138519) (#139022)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-09-17 17:24:46 +03:00
Miss Islington (bot)
c1154943b1
[3.14] gh-138896: Fix error installing C runtime on non-updated Windows machines (GH-138932) (#139034)
Co-authored-by: adang1345 <adang1345@gmail.com>
2025-09-17 17:22:41 +03:00
Miss Islington (bot)
f8ee2d404d
[3.14] GH-123299: Copyedit 3.14 What's New: C API (GH-138987) (#139021)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-17 17:21:06 +03:00
Miss Islington (bot)
37f8a63e39
[3.14] gh-138514: getpass: restrict echo_char to a single ASCII character (GH-138591) (#138988)
Co-authored-by: Benjamin Johnson <benjohnson2040@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-09-17 17:20:45 +03:00
Miss Islington (bot)
ce48f4c845
[3.14] gh-139006: Doc: Clarify html.escape function description (GH-139016) (#139036)
gh-139006: Doc: Clarify html.escape function description (GH-139016)
(cherry picked from commit 81c975bcfc)


Doc: Clarify html.escape function description (GH-139006)

Co-authored-by: PrinceNaroliya <naroliyaprince@gmail.com>
2025-09-17 21:58:17 +08:00
Miss Islington (bot)
97f4ac28cb
[3.14] gh-138998: Upgrade vendored expat to 2.7.2 (GH-138999) (#139024)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-17 15:41:02 +03:00
Jelle Zijlstra
6038447d99
[3.14] gh-137226: Fix get_type_hints() on generic TypedDict with stringified annotations (GH-138953) (#138989) 2025-09-17 12:22:16 +03:00
Miss Islington (bot)
82fce8271c
[3.14] gh-138966: Add description for gi_suspended attribute (GH-139008) (#139020)
Co-authored-by: Donghoon Nam <54799053+codenamenam@users.noreply.github.com>
2025-09-17 12:09:15 +03:00
Miss Islington (bot)
7bba99c611
[3.14] Revert "gh-118803: Remove ByteString from typing and collections.abc (GH-118804)" (GH-138990) (#138995)
Revert "gh-118803: Remove `ByteString` from `typing` and `collections.abc` (GH-118804)" (GH-138990)
(cherry picked from commit 530ddd3e06)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-09-17 09:08:15 +01:00
Miss Islington (bot)
284ab76d4e
[3.14] gh-110936: Reorder string literal definition in Lexical Analysis (GH-138063) (#138373)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-16 16:56:17 +03:00
Miss Islington (bot)
62294eb4fc
[3.14] gh-54874: Expand unicodedata module documentation (GH-138301) (#138346)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
2025-09-16 16:55:59 +03:00
Miss Islington (bot)
35ce9a2867
[3.14] gh-137985: Correct description of Formatter's datefmt param in logging documentation (GH-138530) (#138565)
Co-authored-by: W. H. Wang <mattwang44@gmail.com>
2025-09-16 16:55:29 +03:00
Miss Islington (bot)
5ddd72afd8
[3.14] gh-138871: Clarify NameError exception in 'del' (GH-138881) (#138903)
Co-authored-by: Kian Eliasi <kian.elbo@gmail.com>
2025-09-16 16:54:37 +03:00
Miss Islington (bot)
c0d490d9c4
[3.14] gh-135755: Make Py_MAX_SCRIPT_PATH_SIZE private (GH-138350) (#138356)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-09-16 15:49:35 +03:00
Miss Islington (bot)
7f293a615d
[3.14] gh-135329: prevent infinite traceback loop on Ctrl-C for strace (GH-138133) (#138973)
gh-135329: prevent infinite traceback loop on Ctrl-C  for strace (GH-138133)
(cherry picked from commit b9dbf6acb3)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: dura0ok <slpmcf@gmail.com>
Co-authored-by: graymon <greyschwinger@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-09-16 11:04:49 +00:00
Miss Islington (bot)
1c901860e6
[3.14] gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value for macOS (GH-138089) (#138938)
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-09-16 12:10:53 +03:00
Miss Islington (bot)
dc4d016e7e
[3.14] gh-134953: Expand theming for True/False/None (GH-135000) (#138928)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-09-15 19:02:40 +03:00
Miss Islington (bot)
19a8670d7a
[3.14] gh-138801: re-enable pyrepl tests on Windows (GH-138802) (GH-138815)
gh-138801: re-enable `pyrepl` tests on Windows (GH-138802)
(cherry picked from commit 4f3cab96c1)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-09-15 16:42:36 +02:00
Miss Islington (bot)
80e59a8d7e
[3.14] gh-138669: Increase test coverage for difflib (GH-138670) (#138817)
Co-authored-by: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com>
2025-09-15 00:20:32 +03:00
Miss Islington (bot)
18dfc1d6c4
[3.14] gh-138804: Check type in shlex.quote (GH-138809) (#138846)
Co-authored-by: Christoph Walcher <christoph-wa@gmx.de>
2025-09-13 21:29:50 +03:00
Miss Islington (bot)
fbfbfdf33c
[3.14] gh-138479: Ensure that __typing_subst__ returns a tuple (GH-138482) (#138784)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-12 16:23:03 +03:00
Miss Islington (bot)
440b83f838
[3.14] gh-71810: Fix corner case (length==0) for int.to_bytes() (GH-138739) (#138782)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-12 16:22:43 +03:00
Bénédikt Tran
c8cc39d938
[3.14] gh-116946: fully implement GC protocol for zlib objects (GH-138290) (#138327) 2025-09-12 16:22:33 +03:00
Miss Islington (bot)
664d17f97a
[3.14] Improve permission error messages in pdb and asyncio.tools (GH-134290) (#138826)
Improve permission error messages in pdb and asyncio.tools (GH-134290)
(cherry picked from commit 419441a6e1)

Co-authored-by: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com>
2025-09-12 12:20:20 +00:00
Miss Islington (bot)
5210e307ae
[3.14] gh-138005: Document that CSV skipinitialspace=True and delimiter=' ' require quotation for empty fields (GH-138006) (#138798)
Co-authored-by: Maurycy Pawłowski-Wieroński <5383+maurycy@users.noreply.github.com>
2025-09-11 15:18:25 +00:00
Miss Islington (bot)
8a767fbcb3
[3.14] gh-138081: fix some dead links in InternalDocs (GH-138082) (#138781)
Co-authored-by: yihong <zouzou0208@gmail.com>
2025-09-11 12:38:14 +03:00
Miss Islington (bot)
09b7e87646
[3.14] gh-138081: Fix/remove incorrect links in idlelib/HISTORY.txt (GH-138091) (#138124)
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-09-11 12:27:23 +03:00
Miss Islington (bot)
a36981598c
[3.14] GH-138562: Remove `sort()` from the common sequence methods in the data model (GH-138563) (#138760)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-11 12:23:53 +03:00
Miss Islington (bot)
5eb7cd3e38
[3.14] Add impl-detail block for PyLong_FromLong docs (GH-126422) (#138694)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-09-11 12:23:36 +03:00
Miss Islington (bot)
47441f0874
[3.14] gh-138644: Update c-api docs of PyInterpreterState about PEP-684 (GH-138651) (#138657)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-09-11 12:23:24 +03:00
Miss Islington (bot)
15ca9c6816
[3.14] gh-135676: Reword the Operators & Delimiters section(s) (GH-137713) (#138457)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-11 12:22:56 +03:00
Miss Islington (bot)
dd930baf45
[3.14] gh-138307: Update the Ellipsis documentation (GH-138306) (#138440)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-09-11 12:22:37 +03:00
Miss Islington (bot)
4ce4b82d35
[3.14] Docs: Fix typo in shutil.make_archive example (GH-138188) (#138195)
Co-authored-by: Andreas Pelme <andreas@pelme.se>
2025-09-11 12:20:28 +03:00
Miss Islington (bot)
7e0232895a
[3.14] gh-133125: Clarify ZipInfo.date_time attribute documentation (GH-136082) (#138077)
Co-authored-by: Kentaro Jay Takahashi <64148935+KentaroJay@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-09-11 12:19:35 +03:00
Miss Islington (bot)
34afba4747
[3.14] Fix typo in logging docs (GH-137981) (#137983)
Co-authored-by: Maximilian Linhoff <maximilian.linhoff@cta-observatory.org>
2025-09-11 12:19:05 +03:00
Miss Islington (bot)
30588d5f91
[3.14] [docs] minor, fix grammar in ssl.SSLContect.sslsocket_class docstring (GH-137935) (#137950)
Co-authored-by: PrinceNaroliya <naroliyaprince@gmail.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-09-11 12:18:43 +03:00
Miss Islington (bot)
39e024df8e
[3.14] gh-131885: Use positional-only markers for the `decimal` module (GH-131990) (#137902)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-09-11 12:18:17 +03:00
Miss Islington (bot)
928d8027b2
[3.14] gh-131591: fix formatting of remote debugger docs (GH-137225) (#137874)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-09-11 12:17:46 +03:00
Miss Islington (bot)
dcadc539fd
[3.14] Mention the "context manager" keyword in concurrent.futures documentation (GH-130976) (#137810)
Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2025-09-11 12:17:25 +03:00
Miss Islington (bot)
374b242efa
[3.14] gh-87281: Improve documentation for locale.setlocale() and locale.getlocale() (GH-137313) (#137722)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-11 12:16:18 +03:00
Miss Islington (bot)
4b093e1796
[3.14] gh-136672: Docs: Move Enum functions and add examples (GH-136791) (#137688)
Co-authored-by: RafaelWO <38643099+RafaelWO@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2025-09-11 12:15:55 +03:00
Miss Islington (bot)
735ac97e16
[3.14] gh-125897: Mark range function parameters as positional only (GH-125945) (#137652)
Co-authored-by: Konstantin Baikov <konstantin.baikov@gmail.com>
2025-09-11 12:15:24 +03:00
Miss Islington (bot)
4bba1a294b
[3.14] Fix documentation of hash in PyHash_FuncDef (GH-137595) (#137642)
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2025-09-11 12:15:06 +03:00
Miss Islington (bot)
7b4e0dc36a
[3.14] Replace "ordered arguments" with "positional arguments" in unittest.mock documentation (GH-137552) (#137553)
Co-authored-by: Tom Forbes <tom@tomforb.es>
2025-09-11 12:14:45 +03:00
Miss Islington (bot)
500abc41e8
[3.14] Docs: Small clarity change for `except*` (GH-121073) (#137494)
Co-authored-by: Greg Stein <gstein@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-11 12:14:33 +03:00
Miss Islington (bot)
2bea4f0995
[3.14] Docs: Use the correct example module in warnings.rst (GH-137402) (#137492)
Co-authored-by: Mendel Feygelson <mfeygelson@gmail.com>
2025-09-11 12:14:21 +03:00
Miss Islington (bot)
7f5319dd54
[3.14] gh-137368: document __index__() support for PyLong_AsInt32/64() (GH-137369) (#137380)
gh-137368: document __index__() support for PyLong_AsInt32/64() (GH-137369)
(cherry picked from commit 4dd85b347f)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-09-11 12:14:03 +03:00
Brian Schubert
dc20c1a47e
[3.14] Fix typo in Doc/extending/extending.rst (GH-136890) (#137355)
Co-authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
2025-09-11 11:51:42 +03:00
Miss Islington (bot)
badab2c1a9
[3.14] Docs: Fix typo in os.fwalk() example (GH-138486) (#138500)
Co-authored-by: William Andrea <22385371+wjandrea@users.noreply.github.com>
2025-09-11 11:50:32 +03:00
Miss Islington (bot)
7fba07a7a9
[3.14] Fix Windows path in venv docs (GH-138476) (#138477)
Co-authored-by: Zachary Ware <zach@python.org>
2025-09-11 11:50:01 +03:00
Victor Stinner
3643a26a01
[3.14] gh-138349: Fix crash when combining module-level annotation and listcomp (#138363) (#138749)
* gh-138349: Fix crash when combining module-level annotation and listcomp (#138363)

(cherry picked from commit 7a6fd4a45d)

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-09-11 08:43:57 +03:00
Miss Islington (bot)
38cd031111
[3.14] gh-136599: Add tests for long_hash (GH-138335) (#138390)
gh-136599: Add tests for long_hash (GH-138335)
(cherry picked from commit 2d3711dc06)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-09-10 23:54:07 +03:00
Miss Islington (bot)
a963843f43
[3.14] gh-138744: GitHub Actions: pin to windows-2022 (GH-138743) (#138752)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-10 14:58:31 +00:00
Miss Islington (bot)
389450399a
[3.14] gh-136264: Fix `--relative-paths` for PEP 739's build-details.json (GH-138510) (#138638)
* gh-136264: Fix ``--relative-paths`` for PEP 739's build-details.json (GH-138510)

* KeyError is not raised for defaultdict
* Fix relative paths on different drives on Windows
* Add a round-trip test
(cherry picked from commit 057ee17410)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Itamar Oren <itamarost@gmail.com>

* Update test_build_details.py

* Update Lib/test/test_build_details.py

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Itamar Oren <itamarost@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-09 19:15:40 +03:00
Miss Islington (bot)
829c81ae21
[3.14] GH-101100: Remove some entries from `nitpick_ignore` (GH-138464) (#138683)
* GH-101100: Remove some entries from ``nitpick_ignore`` (GH-138464)
(cherry picked from commit 22cb9ba8f9)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Update check-warnings.py

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-09 19:12:40 +03:00
Miss Islington (bot)
dee3428120
[3.14] gh-101100: Resolve reference warnings in reference/ (GH-138418) (#138680)
gh-101100: Resolve reference warnings in reference/ (GH-138418)
(cherry picked from commit 6831634eb7)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-09 19:11:09 +03:00
Miss Islington (bot)
2162fcc51a
[3.14] gh-138577: Mention Unix-specific limitations of getpass.getpass(echo_char=...) (GH-138677) (#138696)
Co-authored-by: yagggi <fakepoet0101@gmail.com>
2025-09-09 13:00:36 +03:00
Miss Islington (bot)
6f665902d1
[3.14] gh-137242: Add a --no-randomize option, and use it in Android CI (GH-138649) (#138684)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-09-09 11:51:48 +03:00
Miss Islington (bot)
161543f4f1
[3.14] annotationlib: add note on security to docs (GH-138508) (#138550)
annotationlib: add note on security to docs (GH-138508)
(cherry picked from commit 9158bcf86b)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-09-08 23:15:57 +03:00
Miss Islington (bot)
68e0abe8c1
[3.14] gh-138665: Move platform.invalidate_caches docs (GH-138667) (#138668)
Co-authored-by: Shamil <ashm.tech@proton.me>
2025-09-08 19:06:27 +03:00
Miss Islington (bot)
0f94b186a5
[3.14] gh-138253: Fix compatibility of sub-interpreters queues with queue.Queue (GH-138256) (#138367)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-08 18:37:39 +03:00
Miss Islington (bot)
61f7156965
[3.14] gh-135661: Fix CDATA section parsing in HTMLParser (GH-135665) (#137772)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-08 18:31:41 +03:00
Miss Islington (bot)
75c2d9f7c4
[3.14] gh-138297 Point link in docs for finally to try/else, instead of if/else (GH-138298) (#138381)
Co-authored-by: James Parrott <80779630+JamesParrott@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-09-08 18:09:31 +03:00
Miss Islington (bot)
769f7a51fe
[3.14] gh-89905: Correct -R option doc (GH-137608) (#138353)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-08 18:08:12 +03:00
Miss Islington (bot)
925c75211d
[3.14] gh-129033: Remove dead code in test.support.has_no_debug_ranges() (GH-137379) (#137382)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-09-08 18:03:23 +03:00
Miss Islington (bot)
d29c38eeb9
[3.14] gh-138295: Fix a grammar issue in the descriptor HOWTO (GH-138296) (#138299)
Co-authored-by: Fangyi Zhou <me@fangyi.io>
2025-09-08 18:00:06 +03:00
Miss Islington (bot)
efac05a135
[3.14] gh-91116: Add hyperlink from sys.settrace to frame objects (GH-138062) (#138068)
Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-09-08 17:59:24 +03:00
Miss Islington (bot)
0cf8ac2973
[3.14] gh-137668: Document that ord() supports also bytes and bytearray (GH-137669) (#137703)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-08 17:59:10 +03:00
Miss Islington (bot)
226915dd2c
[3.14] gh-137397: Skip test_os_open on NetBSD due to indefinite hang (GH-137398) (#137406)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-09-08 17:58:44 +03:00
Miss Islington (bot)
1cb1c2c03b
[3.14] gh-138659: Typo in the gc module docstring (GH-138660) (#138662)
gh-138659: Typo in the gc module docstring (GH-138660)

docs(gc): fix typo in get_threshold() docstring

Removes a duplicate "the" from the docstring for the `gc.get_threshold()` function.
(cherry picked from commit c006a623e7)

Co-authored-by: Aalaap Dey <65075436+axdeyy@users.noreply.github.com>
2025-09-08 14:41:34 +00:00
Miss Islington (bot)
655ad1c63e
[3.14] gh-138318, PyREPL: builtins should not be highlighted when used as attribute names (GH-138319) (#138654)
gh-138318, PyREPL: builtins should not be highlighted when used as attribute names (GH-138319)
(cherry picked from commit 7a3bca50e0)

Co-authored-by: yihong <zouzou0208@gmail.com>
2025-09-08 13:29:53 +00:00
Miss Islington (bot)
5074241f3d
[3.14] Use test.support.is_wasm32 flag for is_emscripten or is_wasi for generic checks (GH-136815) (#138643)
Co-authored-by: Ani <5357586+anistark@users.noreply.github.com>
Co-authored-by: Brett Cannon <brett@python.org>
2025-09-08 16:20:00 +03:00
Miss Islington (bot)
f23e7605b8
[3.14] Docs: Fix typo in test.support.linked_to_musl function name (GH-138406) (#138445)
Docs: Fix typo in test.support.linked_to_musl function name (GH-138406)
(cherry picked from commit 8ce4f28363)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2025-09-08 14:52:38 +03:00
Miss Islington (bot)
9b398cb3ac
[3.14] GH-123299: Copyedit 3.14 What's New: Build Changes (GH-138488) (#138632)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-08 07:17:14 +00:00
Miss Islington (bot)
78ee486861
[3.14] gh-138584: Increase test coverage for collections.UserList (GH-138590) (#138612)
Co-authored-by: dbXD320 <devanshbaghla320@gmail.com>
Co-authored-by: Devansh Baghla <devanshbaghla34@gmail.com>
2025-09-07 10:42:19 +00:00
Miss Islington (bot)
d36c9a8b50
[3.14] gh-90548: Fix musl version detection with --strip-all (GH-137864) (#138348)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-07 10:51:07 +03:00
Miss Islington (bot)
096fa045fd
[3.14] gh-90548: Allow Alpine/MUSL to pass test_c_locale_coercion. (GH-134454) (#138600)
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2025-09-07 10:46:37 +03:00
Miss Islington (bot)
95ec2c1ead
[3.14] gh-90548: Skip ctypes test_null_dlsym when linked to musl (GH-138592) (#138601)
Co-authored-by: Zachary Ware <zach@python.org>
2025-09-07 10:46:20 +03:00
Miss Islington (bot)
194fe15c5f
[3.14] gh-90548: Skip NODEV portion of test_makedev when linked to musl (GH-138593) (#138602)
Co-authored-by: Zachary Ware <zach@python.org>
2025-09-07 10:46:11 +03:00
Bénédikt Tran
9cc2b25101
[3.14] gh-116946: fully implement GC protocol for _curses_panel.panel (GH-138333) (#138427) 2025-09-06 21:20:35 +03:00
Miss Islington (bot)
1e1bfe7bbe
[3.14] gh-138191: Document `frame.f_generator` in the data model (GH-138540) (#138553)
Co-authored-by: dbXD320 <devanshbaghla320@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-06 19:59:36 +03:00
Miss Islington (bot)
f153e32cba
[3.14] GH-138465: Improve documentation for common sequence methods (GH-138474) (#138560)
GH-138465: Improve documentation for common sequence methods (GH-138474)
(cherry picked from commit 8ed1d53e62)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-06 08:51:48 +03:00
Miss Islington (bot)
cddb7e6a7a
[3.14] gh-138192: Fix Context initialization so that all subinterpreters are assigned the MISSING value. (gh-138503) (#138505)
Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-09-05 15:30:04 +03:00
Miss Islington (bot)
b6fa945ff9
[3.14] gh-138286: Run `ruff on Tools/i18n` (GH-138287) (#138513)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-09-05 11:28:56 +00:00
Miss Islington (bot)
09f1eff0df
[3.14] gh-138515: Include email module in Emscripten build (gh-138520) (#138533)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2025-09-05 13:53:39 +03:00
Miss Islington (bot)
a264142ebf
[3.14] docs: add module-level versionadded for annotationlib (GH-138511) (#138512)
docs: add module-level `versionadded` for `annotationlib` (GH-138511)
(cherry picked from commit fc0305a2d8)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-09-05 11:03:04 +03:00
Miss Islington (bot)
5086a1e8a0
[3.14] gh-138516: fix typo in OrderedDict exception msg (GH-138517) (#138523)
gh-138516: fix typo in OrderedDict exception msg (GH-138517)
(cherry picked from commit e9c2a357fb)

Co-authored-by: asas1asas200 <asas1asas200@gmail.com>
2025-09-05 11:02:21 +03:00
Miss Islington (bot)
66f256d874
[3.14] gh-107194: Improved language of list.index in tutorial (gh-138518) (#138527)
gh-107194: Improved language of list.index in tutorial (gh-138518)
(cherry picked from commit f19f1d8563)

Co-authored-by: Ric <11750904+ricsatjr@users.noreply.github.com>
2025-09-05 10:51:28 +03:00
Bénédikt Tran
d574f83206
[3.14] gh-136134: imaplib: fix CRAM-MD5 on FIPS-only environments (GH-136615) (#138054) 2025-09-04 17:59:49 +03:00
Bénédikt Tran
bfce393614
[3.14] gh-136134: smtplib: fix CRAM-MD5 on FIPS-only environments (GH-136623) (#138086) 2025-09-04 16:07:59 +03:00
Miss Islington (bot)
460265fe96
[3.14] GH-101100: Resolve reference warnings in using/windows.rst (GH-138416) (#138461)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-04 15:44:14 +03:00
sobolevn
8e1c2fe3d3
[3.14] gh-138281: Run ruff on Tools/peg_generator (GH-138282) (#138469)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-04 11:13:36 +00:00
Miss Islington (bot)
2583646288
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.10.rst (GH-138408) (#138480)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-04 12:56:52 +03:00
Miss Islington (bot)
45a79b4f4b
[3.14] gh-72249: Correct wording of GH-101910 blurb (GH-138468) (#138470)
Co-authored-by: Zachary Ware <zach@python.org>
2025-09-03 21:48:24 +03:00
Miss Islington (bot)
d7c5aa992e
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.5.rst (GH-138412) (#138459)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-03 18:46:35 +03:00
Miss Islington (bot)
28fcdda083
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.6.rst (GH-138411) (#138455)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-03 15:27:52 +00:00
Miss Islington (bot)
e7593c8676
[3.14] GH-101100: Resolve reference warnings in extending/extending.rst (GH-138417) (#138446)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-03 16:15:36 +03:00
Miss Islington (bot)
44b3940143
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.4.rst (GH-138413) (#138443)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-03 15:08:38 +03:00
Miss Islington (bot)
d713788ad1
[3.14] GH-101100: Resolve reference warnings in whatsnew/2.7.rst (GH-138415) (#138441)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-03 11:39:02 +00:00
Miss Islington (bot)
1e26fd0c4b
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.8.rst (GH-138409) (#138437)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-03 11:31:06 +00:00
Miss Islington (bot)
67b8320cef
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.3.rst (GH-138414) (#138435)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-03 11:27:01 +00:00
Miss Islington (bot)
63fed7b12b
[3.14] GH-123299: Copyedit 3.14 What's New: Move and consolidate Porting (GH-138400) (#138434)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-03 11:15:47 +00:00
Miss Islington (bot)
b0069f14af
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.7.rst (GH-138410) (#138423)
GH-101100: Resolve reference warnings in whatsnew/3.7.rst (GH-138410)

Resolve reference warnings in whatsnew/3.7.rst
(cherry picked from commit dd86fb4ba5)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-03 06:26:29 +00:00
Miss Islington (bot)
da3850cfc2
[3.14] gh-101100: Resolve reference warnings in library/xml.sax.handler.rst (GH-136612) (#138421)
gh-101100: Resolve reference warnings in library/xml.sax.handler.rst (GH-136612)
(cherry picked from commit c22cc8fccd)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-09-03 09:17:45 +03:00
Miss Islington (bot)
5c47d72c9b
[3.14] Doc: Track file downloads via plausible (GH-138393) (#138396)
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-02 23:00:02 +03:00
Miss Islington (bot)
192ae9b86d
[3.14] gh-138372: Fix SyntaxWarning for erroneous t-string subscription (GH-138375) (#138392)
gh-138372: Fix SyntaxWarning for erroneous t-string subscription (GH-138375)
(cherry picked from commit 5493b46462)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-09-02 17:39:08 +00:00
Miss Islington (bot)
5ec6d56405
[3.14] gh-138257: Fix internal RuleCollectorVisitor attribute name (GH-138208) (#138259)
Co-authored-by: chemelnucfin <3982092+chemelnucfin@users.noreply.github.com>
2025-08-31 09:54:59 +03:00
Miss Islington (bot)
b79becefb6
[3.14] gh-138158: Use the "data" tarfile extraction filter in Tools/ssl/multissltests.py (GH-138147) (#138262)
Co-authored-by: Tommaso Bona <piergeolo@gmail.com>
2025-08-31 09:53:21 +03:00
Miss Islington (bot)
a37a382f78
[3.14] gh-133829: Remove some specifics from the `zipimport` example (GH-133835) (#138274)
Co-authored-by: R Chintan Meher <meherrihaan@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-08-31 09:44:56 +03:00
Miss Islington (bot)
c35222aae1
[3.14] gh-123858: Improve Doc: SyntaxWarning is emitted during bytecode generation (gh-122844) (#138244)
Co-authored-by: Hang <bebound@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2025-08-30 00:13:09 +03:00
Miss Islington (bot)
769f58a828
[3.14] gh-101359: clarify docs for asyncio.Event.clear (GH-137849) (#137850)
gh-101359: clarify docs for `asyncio.Event.clear` (GH-137849)
(cherry picked from commit 4b2dbe8e0a)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-08-29 07:37:39 +03:00
Miss Islington (bot)
d3f7bb067c
[3.14] gh-90483: fix docs of SubprocessTransport.get_pipe_transport (GH-137852) (#137853)
gh-90483: fix docs of `SubprocessTransport.get_pipe_transport ` (GH-137852)
(cherry picked from commit 038a6e3b95)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-08-29 07:25:55 +03:00
Miss Islington (bot)
0e46c04994
[3.14] gh-126524: Revert "gh-126524: Run regen-unicodedata as a part of our CI GH-126682" (GH-138197) (#138218)
gh-126524: Revert "gh-126524: Run `regen-unicodedata` as a part of our CI GH-126682" (GH-138197)
(cherry picked from commit 03f8d3b0db)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-08-28 07:58:11 +00:00
Miss Islington (bot)
e3fb55ed2d
[3.14] gh-133403: Run mypy on Tools/build/check_warnings.py (GH-137700) (#137763)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-08-27 18:37:56 +03:00
Miss Islington (bot)
6d30edbae2
[3.14] gh-137576: Fix for Basic REPL showing incorrect code in tracebacks with PYTHONSTARTUP (GH-137625) (#137771)
Co-authored-by: adam j hartz <hz@mit.edu>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2025-08-27 18:28:20 +03:00
Miss Islington (bot)
5caa6cde58
[3.14] gh-137740: Clarify __del__ invocation mechanism in reference counting (GH-137741) (#138113)
Co-authored-by: Robin Narsingh Ranabhat <robinnarsingha123@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-08-27 18:26:38 +03:00
Miss Islington (bot)
97c6d725e1
[3.14] enhance docs for critical sections (GH-137334) (#138167)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-08-27 17:40:27 +03:00
Miss Islington (bot)
7a6d8d4c95
[3.14] gh-137526: Fix broken link to drdobbs journal in difflib.rst (GH-137527) (#137531)
Co-authored-by: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
2025-08-27 17:02:26 +03:00
Miss Islington (bot)
27a2152a9b
[3.14] gh-44538: Mention nested classes/functions in doctest docs (GH-137870) (#137918)
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-08-27 17:01:55 +03:00
Miss Islington (bot)
9e5ca3a411
[3.14] gh-138011: Clarify tutorial method object example code (GH-138014) (#138025)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-08-27 16:59:47 +03:00
Miss Islington (bot)
cc38a57233
[3.14] gh-137609: Update signatures of builtins in the documentation (GH-137610) (#138137)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-27 16:59:02 +03:00
Miss Islington (bot)
65bf6f549b
[3.14] gh-138098: Clarify strong references in PyDict_Next docs on the free-threaded build (GH-138106) (#138141)
Co-authored-by: PrinceNaroliya <naroliyaprince@gmail.com>
2025-08-27 16:58:07 +03:00
Miss Islington (bot)
86f7bb7ede
[3.14] gh-138148: Fix grammatical error in the asynchronous generator iterator term (GH-138155) (#138159)
Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-08-27 16:57:36 +03:00
Miss Islington (bot)
6c2d42f3f2
[3.14] GH-132775: Fix argument parsing for `_interpqueues.put()` (GH-137686) (#138034)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-27 16:53:39 +03:00
Miss Islington (bot)
f4af7176c1
[3.14] gh-106318: Add example for str.find() (GH-134529) (#138174)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-27 06:48:49 +00:00
Miss Islington (bot)
01afaccce6
[3.14] gh-135261: bring back CI job for testing OpenSSL 1.1.1w (GH-135262) (#138109)
gh-135261: bring back CI job for testing OpenSSL 1.1.1w (GH-135262)

This partially reverts commit d83e30cadd
by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this
version being upstream EOL, the rationale for keeping it as follows:

- It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors.
- Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later
  is recommended for cryptographic modules. Since changing the build requirements
  requires a transition period, we need to keep testing the allowed versions.
- The code base still contains calls to OpenSSL functions that are deprecated since
  OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.

(cherry picked from commit 96b7a2eba4)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-08-26 08:45:08 +03:00
Peter Bierma
8b3f9ae2ca
[3.14] gh-137883: Check the recursion limit for specialized keyword argument calls (GH-137887) (#137945)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-08-25 19:19:39 +03:00
Miss Islington (bot)
9fa74c57fe
[3.14] gh-137973: Add a non-parallel test plan to the iOS testbed project (GH-138018) (#138038)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-08-25 15:00:35 +03:00
Miss Islington (bot)
271823fdaf
[3.14] gh-135862: add C contiguous one-dimensional buffer requirement to asyncio.StreamWriter docs (GH-137910) (#137912)
gh-135862: add C contiguous one-dimensional buffer requirement to `asyncio.StreamWriter` docs (GH-137910)
(cherry picked from commit 1c3950abc1)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-08-23 19:27:51 +03:00
Kumar Aditya
d619015ecd
[3.14] gh-137384: fix crash when accessing warnings state late in runtime shutdown (GH-138027) (#138065) 2025-08-22 17:27:49 +03:00
Miss Islington (bot)
c213eb90a0
[3.14] gh-138042: Fix homebrew for tail-calling macOS CI (GH-138043) (#138060)
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-22 17:07:38 +03:00
Miss Islington (bot)
57c46013e3
[3.14] gh-123299: Fix typos & grammar and copyedit What's New in 3.14 (GH-138040) (#138041)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-22 11:11:38 +03:00
Miss Islington (bot)
132b8664b1
[3.14] gh-137847: Add examples for UUIDv6-8 (GH-137848) (#137901)
Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-08-21 21:36:35 +03:00
Miss Islington (bot)
cf5c170c1b
[3.14] gh-137728 gh-137762: Fix bugs in the JIT with many local variables (GH-137764) (#137999)
Co-authored-by: Ken Jin <kenjin@python.org>
2025-08-21 17:00:05 +03:00
Miss Islington (bot)
bb3c3d4444
[3.14] gh-137964: Remove the "experimental" designation from the Windows installer (GH-137965) (#137971)
Co-authored-by: Itamar Oren <itamarost@gmail.com>
2025-08-20 20:19:45 +03:00
Miss Islington (bot)
5923849855
[3.14] gh-137900: Improve dataclasses frozen parameter documentation (GH-137937) (#137990)
gh-137900: Improve dataclasses frozen parameter documentation (GH-137937)
(cherry picked from commit 7685b8ada8)

Co-authored-by: Tangyuan <47830915@qq.com>
2025-08-20 16:49:43 +03:00
Miss Islington (bot)
3fa5a4beb4
[3.14] gh-127859: Fixed documentation for call_later and call_at for early wakeup in asyncio (GH-137859) (#137908)
Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2025-08-19 14:27:36 +03:00
Miss Islington (bot)
5034b6491a
[3.14] gh-134869: Fix Ctrl+C corrupts REPL autocomplete (GH-134929) (#137926)
gh-134869: Fix Ctrl+C corrupts REPL  autocomplete (GH-134929)
(cherry picked from commit 8750e5ecfc)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
2025-08-18 22:21:55 +01:00
Miss Islington (bot)
c9e2e15438
[3.14] Emend an error in `string.templatelib` example output (GH-137890) (#137892)
Emend an error in ``string.templatelib`` example output (GH-137890)
(cherry picked from commit 8e3244d39b)

Co-authored-by: Christoph Walcher <christoph-wa@gmx.de>
2025-08-18 14:07:47 +03:00
Miss Islington (bot)
bb4e747654
[3.14] gh-137846: Add missing 'be' to profile doc. (GH-137856) (#137857)
gh-137846: Add missing 'be' to profile doc. (GH-137856)

Insert 'be' into 'will interpreted'.
(cherry picked from commit 3663b2ad54)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-08-16 20:24:17 +03:00
Miss Islington (bot)
cfa5ee5389
[3.14] gh-137777: Disband the 'Program Frameworks' chapter (GH-137796) (#137830)
gh-137777: Disband the 'Program Frameworks' chapter (GH-137796)
(cherry picked from commit eee6589c17)

Co-authored-by: rimchoi <hyerimc858@gmail.com>
2025-08-16 11:04:59 +03:00
Miss Islington (bot)
e817d1aa2b
[3.14] gh-132661: PEP 750 documentation: second pass (GH-137020) (#137392)
gh-132661: PEP 750 documentation: second pass (GH-137020)
(cherry picked from commit 4dae9b1ff1)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-16 09:21:29 +03:00
Miss Islington (bot)
7b56d08219
[3.14] gh-137078: Fix keyword typo recognition when executed over files (GH-137079) (#137826) 2025-08-15 18:22:17 +01:00
Miss Islington (bot)
4cb99bf9e3
[3.14] GH-123299: Copyedit 3.14 What's New: Removed (GH-137794) (#137825)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-15 18:09:26 +03:00
Miss Islington (bot)
a4ef631c5e
[3.14] gh-137760: Update REPL constants documentation (gh-137798) (#137822)
Co-authored-by: Chaemin-Lim <antraxmin@naver.com>
2025-08-15 13:59:57 +00:00
Miss Islington (bot)
bbc92b9219
[3.14] GH-123299: Copyedit 3.14 What's New: Optimizations (GH-137789) (#137813)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-15 14:58:12 +03:00
Miss Islington (bot)
3de6ea5d8f
[3.14] gh-109975: Indicate the minimum version for PyREPL in the tutorial (GH-136046) (#137766)
Co-authored-by: Konstantin Morenko <konstantin-morenko@users.noreply.github.com>
2025-08-15 13:15:30 +03:00
Miss Islington (bot)
36a1e1aaf7
[3.14] gh-137026: Add an explainer guide for asyncio (GH-137215) (#137581)
Co-authored-by: Alexander Nordin <alexander.f.nordin@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-08-15 13:14:39 +03:00
Miss Islington (bot)
bab2a7e982
[3.14] gh-137183: Document that array.array typecode w is new in 3.13 (GH-137184) (#137208)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2025-08-15 13:13:27 +03:00
Miss Islington (bot)
0696a7526e
[3.14] gh-136437: Convert more `os.path` functions to positional-only in the docs (GH-136970) (#137000)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-08-15 13:10:59 +03:00
Miss Islington (bot)
976d028cbb
[3.14] gh-123299: Update What's new in Python 3.14: typos and misplaced item. (GH-136665) (#137769)
Co-authored-by: Hunter Hogan <hunterhogan@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-08-15 12:14:43 +03:00
Hugo van Kemenade
5322260352 Post 3.14.0rc2 2025-08-14 19:10:50 +03:00
Hugo van Kemenade
31967d8de3 Python 3.14.0rc2 2025-08-14 15:19:47 +03:00
Miss Islington (bot)
27e128621c
[3.14] gh-137749: Python 3.14 installer is for macOS 10.15 and later (GH-137753) (#137755)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-14 14:12:49 +03:00
Miss Islington (bot)
7c0e6378c1
[3.14] GH-137573: mark _PyOptimizer_Optimize as no inline (GH-137731) (#137751)
Co-authored-by: Sachin Shah <39803835+inventshah@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-08-14 11:51:33 +03:00
Zachary Ware
d8f4d56f83
[3.14] gh-132339: Add support for OpenSSL 3.5 (GH-137720) (#137747)
* Add OpenSSL 3.5.2 definitions to Modules/_ssl_data_35.h (moved from Modules/_ssl_data_34.h)

* Demote OpenSSL 3.1 to "old", remove it from CI

* Update all OpenSSL versions to latest patchlevel in CI config and multissltests defaults

* Add OpenSSL 3.5.2 to CI configuration and multissltests default list

* Fix a typo in the argument parser description of multissltests.py
(cherry picked from commit 7a703c8f19)
2025-08-14 08:58:18 +03:00
Miss Islington (bot)
902de283a8
[3.14] gh-137226: Fix behavior of ForwardRef.evaluate with type_params (GH-137227) (#137709)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-08-13 14:13:14 +00:00
sobolevn
ad9f20dffa
[3.14] gh-133403: Run mypy on Tools/build/mypy.ini changes (GH-137692) (#137698) 2025-08-13 11:10:58 +00:00
Miss Islington (bot)
b7df473260
[3.14] gh-133403: Check generate_stdlib_module_names and check_extension_modules with mypy (GH-137546) (#137679)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-08-13 13:42:26 +03:00
Miss Islington (bot)
c60289c7f2
[3.14] gh-137450: macOS installer shell path management improvements (GH-137451) (#137453)
Co-authored-by: Ned Deily <nad@python.org>
2025-08-13 13:39:50 +03:00
Ned Deily
2392232ec4
[3.14] GH-134291: Support older macOS deployment targets for JIT builds (GH-137211) (#137701)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2025-08-13 13:37:01 +03:00
Hugo van Kemenade
ccb6de37d3
[3.14] gh-137242: Add Android CI job (GH-137186) (#137683)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2025-08-13 12:39:14 +03:00
Miss Islington (bot)
4ebd928b00
[3.14] gh-137400: Fix a crash when disabling profiling across all threads (gh-137471) (#137648)
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-08-12 17:29:57 +03:00
Miss Islington (bot)
4dda1768be
[3.14] gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (take 2) (GH-137047) (#137666)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-12 17:17:26 +03:00
Miss Islington (bot)
daed07a1f9
[3.14] GH-137426: Remove code deprecation of importlib.abc.ResourceLoader (GH-137567) (#137654)
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-12 15:47:28 +03:00
Petr Viktorin
946b226b90
[3.14] gh-137288: Update version in magic number log (GH-137665) (#137667)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-12 12:18:20 +00:00
Irit Katriel
0ccf244a19
[3.14] gh-137288: Fix bug where boolean expressions are not associated with the correct exception handler (GH-137310). (#137427)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-08-12 12:56:37 +03:00
Miss Islington (bot)
019238ab18
[3.14] gh-137200: support frame lineno setter with BRANCH_LEFT and BRANCH_RIGHT events (GH-137229) (#137280)
Co-authored-by: Xuanteng Huang <44627253+xuantengh@users.noreply.github.com>
2025-08-11 17:07:19 +03:00
Miss Islington (bot)
1bf7462e34
[3.14] Update pre-commit hooks (GH-137591) (#137621)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-11 11:21:45 +03:00
Miss Islington (bot)
1878fe814a
[3.14] gh-131338: Disable computed stack limit checks on non-glibc linux (GH-134336) (#137175)
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-08-10 16:55:29 +03:00
Miss Islington (bot)
f180fb956b
[3.14] gh-119711: describe create_datagram_endpoint's behavior in asyncio when local_addr is None (GH-136913) (#137164)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-08-10 16:52:30 +03:00
Miss Islington (bot)
50461821fb
[3.14] gh-137499: Fixed dead link to NIST website (GH-137500) (#137502)
gh-137499: Fixed dead link to NIST website (GH-137500)
(cherry picked from commit 3c1471d971)

Co-authored-by: tobiasjcat <70606111+tobiasjcat@users.noreply.github.com>
2025-08-09 03:31:29 +00:00
Miss Islington (bot)
7dc669f935
[3.14] gh-136155: Docs: check for EPUB fatal errors in CI (GH-134074) (#137539)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-08 19:05:29 +03:00
Miss Islington (bot)
9e8a9ac11a
[3.14] gh-137282: Fix TypeError in tab completion and dir() of concurrent.futures (GH-137214) (#137284)
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2025-08-08 18:13:22 +03:00
Miss Islington (bot)
f17d77f112
[3.14] gh-137308: Replace a single docstring with pass in -OO mode (GH-137318) (#137322)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-08-08 18:04:10 +03:00
Miss Islington (bot)
f1248cfac0
[3.14] gh-137412: fix default_builtin_hashes values in test_hashlib.py (GH-137413) (#137534)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-08-08 17:36:21 +03:00
Miss Islington (bot)
3df0842de5
[3.14] [Doc] Remove unnecessary quotes from typing module (GH-137207) (#137541)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-08-08 17:31:32 +03:00
Hugo van Kemenade
ab7ffdcaaa
[3.14] gh-123299: Backport typo fixes in What's New in Python 3.14 (#137525) 2025-08-07 19:06:09 +03:00
Miss Islington (bot)
0fc49bed80
[3.14] gh-132983: Use `Py_UNREACHABLE in _zstd_load_impl()` (GH-137320) (#137360)
Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
2025-08-07 18:38:15 +03:00
Miss Islington (bot)
43d8f527c9
[3.14] Doc: remove unused images (GH-137323) (#137324)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2025-08-06 18:39:52 +03:00
Miss Islington (bot)
9b8826b2c7
[3.14] gh-137134: Update SQLite to 3.50.4 for binary releases (GH-137135) (#137436)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Ned Deily <nad@python.org>
2025-08-06 15:45:54 +03:00
Miss Islington (bot)
25ae1af55e
[3.14] Docs: add dunder and walrus to the glossary (GH-137430) (#137434)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-08-06 14:58:52 +03:00
Miss Islington (bot)
3a1e5824dd
[3.14] GH-136155: Use `sphinxext-opengraph` v0.12.0 (GH-137393) (#137431)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-05 23:38:48 +03:00
Miss Islington (bot)
7d57316484
[3.14] gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195) (#137274)
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2025-08-05 20:34:47 +03:00
Miss Islington (bot)
f4870086ba
[3.14] gh-130522: Fix unraisable TypeError in threading at interpreter shutdown (GH-131537) (#137105)
Co-authored-by: Tyler Kennedy <tk@tkte.ch>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-08-04 16:01:39 +03:00
Miss Islington (bot)
134ca903b3
[3.14] Remove Alex Waygood as a codeowner for pre-commit config (GH-137372) (#137373)
Remove Alex Waygood as a codeowner for pre-commit config (GH-137372)
(cherry picked from commit a46ed665ff)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-08-04 13:34:16 +03:00
Miss Islington (bot)
127ec30112
[3.14] gh-137257: Upgrade bundled pip to 25.2 (GH-137258) (#137361)
gh-137257: Upgrade bundled pip to 25.2 (GH-137258)
(cherry picked from commit 506542b596)

Co-authored-by: Richard Si <sichard26@gmail.com>
2025-08-04 08:29:30 +03:00
Miss Islington (bot)
833d883ad4
[3.14] gh-132983: Fix docstrings in `ZstdDict` (GH-137321) (#137343)
Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-03 22:37:49 +03:00
Miss Islington (bot)
ecdec64f73
[3.14] GH-136155: Use `sphinxext-opengraph` v0.11.0 (GH-137348) (#137349)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-03 18:39:19 +00:00
Serhiy Storchaka
69fee0c66a
[3.14] gh-137341: Remove more word duplications (GH-137342) (#137346) 2025-08-03 21:26:16 +03:00
Miss Islington (bot)
cf57f4fac3
[3.14] gh-137314: Fix incorrect treatment of format specs in raw fstrings (GH-137328) (#137344)
gh-137314: Fix incorrect treatment of format specs in raw fstrings (GH-137328)
(cherry picked from commit 0153d82a5a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-08-03 16:36:58 +00:00
Miss Islington (bot)
42b58cfa42
[3.14] gh-119180: Refer to annotationlib.get_annotations() in typing.get_type_hints() documentation (GH-137247) (#137263)
gh-119180: Refer to `annotationlib.get_annotations()` in `typing.get_type_hints()` documentation (GH-137247)
(cherry picked from commit 5e2f0b976a)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2025-07-31 07:07:44 +03:00
Miss Islington (bot)
aab9537cf0
[3.14] gh-136992: Add "None" as valid SameSite value as per RFC 6265bis (GH-137040) (#137140)
Co-authored-by: Iqra Khan <iqraakhan2519@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-30 22:43:53 +03:00
Miss Islington (bot)
f607515bc5
[3.14] GH-116738: document thread-safety of bisect (GH-136555) (#137221)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2025-07-30 22:01:10 +03:00
Miss Islington (bot)
38a42fe32c
[3.14] gh-136976: Emscripten: Add _decimal and libmpdec (GH-136997) (#137066)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Zachary Ware <zach@python.org>
2025-07-29 23:10:39 +03:00
Miss Islington (bot)
64eb54062d
[3.14] gh-124621: Emscripten: Add smoke test for using pyrepl in Chrome (GH-137004) (#137067)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Zachary Ware <zach@python.org>
2025-07-29 23:09:47 +03:00
Miss Islington (bot)
40632ad7ba
[3.14] Add a What's New entry for Emscripten (GH-137035) (#137192)
Add a What's New entry for Emscripten (GH-137035)
(cherry picked from commit d7e12a362a)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-29 09:53:34 +03:00
Miss Islington (bot)
9da008da99
[3.14] gh-132898: Add a note in multiprocessing.Process docs about creating a process in a REPL (GH-137118) (#137154)
Co-authored-by: Duprat <yduprat@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-07-28 22:48:58 +03:00
Miss Islington (bot)
aeb55ebb07
[3.14] GH-137059: url2pathname(): fix support for drive letter in netloc (GH-137060) (#137144)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2025-07-28 22:43:15 +03:00
Miss Islington (bot)
fbc2a0ca9a
[3.14] gh-130577: tarfile now validates archives to ensure member offsets are non-negative (GH-137027) (#137169)
Co-authored-by: Alexander Urieles <aeurielesn@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-07-28 22:40:56 +03:00
Miss Islington (bot)
909a534cb2
[3.14] gh-136870: fix data races in instrumentation of bytecode (GH-136994) (#137082)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Zachary Ware <zach@python.org>
2025-07-28 22:39:44 +03:00
Miss Islington (bot)
47a2109c1a
[3.14] Link to plaintext for "show source" links (GH-137131) (#137132)
Link to plaintext for "show source" links (GH-137131)
(cherry picked from commit 9cbf46d992)

Co-authored-by: ryan-duve <ryan-duve@users.noreply.github.com>
2025-07-27 09:54:41 +03:00
Miss Islington (bot)
fc911a93cb
[3.14] gh-131038: Use text=True in subprocesses in test_perf_profiler (GH-137117) (#137124) 2025-07-26 17:28:40 +00:00
Miss Islington (bot)
5746e067fd
[3.14] gh-137090: Remove redundant statement in `Doc/library/concurrent.interpreters.rst` (GH-137091) (#137108)
gh-137090: Remove redundant statement in ``Doc/library/concurrent.interpreters.rst`` (GH-137091)
(cherry picked from commit 1e69cd1634)

Co-authored-by: soolabettu <17737361+soolabettu@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-25 19:08:28 +03:00
Miss Islington (bot)
87422988f9
[3.14] gh-132983: Add missing references to Zstandard in shutil docstrings (GH-136617) (#137052)
Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
2025-07-25 12:30:11 +03:00
Miss Islington (bot)
d996cb6700
[3.14] Exclude _testclinic_depr.c.h from c-analyzer (GH-137086) (#137089)
Exclude _testclinic_depr.c.h from c-analyzer (GH-137086)

_testclinic.c mocks out PY_VERSION_HEX to 3.8 before including
_testclinic_depr.c.h to avoid the errors the preprocessor would
otherwise throw due to the deprecation feature it is testing.

(cherry picked from commit d5e75c0768)

Co-authored-by: Zachary Ware <zach@python.org>
2025-07-25 00:36:11 +03:00
Miss Islington (bot)
b7168d216b
[3.14] GH-136975: Emend a spelling error (algorthm -> algorithm) (GH-136999) (#137003)
GH-136975: Emend a spelling error (algorthm -> algorithm) (GH-136999)
(cherry picked from commit b6d3242244)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-23 23:48:11 +03:00
Miss Islington (bot)
f2981acd6b
[3.14] gh-137043: mention PyList_GET_ITEM as unsafe borrowed API in free-threading docs (GH-137042) (#137045)
Co-authored-by: Guido Imperiale <crusaderky@gmail.com>
2025-07-23 20:45:55 +03:00
Miss Islington (bot)
4832ceaa78
[3.14] gh-135676: Lexical analysis: Reword String literals and related sections (GH-135942) (#137048)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-23 19:23:25 +03:00
Hugo van Kemenade
9f25781bf9 Post 3.14.0rc1 2025-07-22 21:54:14 +03:00
Hugo van Kemenade
48f8831004 Python 3.14.0rc1 2025-07-22 19:42:44 +03:00
Jelle Zijlstra
70990ed5ca
[3.14] Revert "[3.14] gh-135228: When @dataclass(slots=True) replaces… (#137013) 2025-07-22 16:23:53 +00:00
Miss Islington (bot)
715c658bf8
[3.14] Fix tables in 'Using on Windows' for the text writer (GH-137012) (#137015)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-22 16:21:19 +00:00
Serhiy Storchaka
805daa2edb
[3.14] Revert "gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303)" (GH-136991) (#137006) 2025-07-22 19:16:31 +03:00
Miss Islington (bot)
c328d140eb
[3.14] Fix code example in annotationlib documentation (GH-136972) (#137002)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2025-07-22 19:15:27 +03:00
Łukasz Langa
591019e1f2
[3.14] gh-124621: Emscripten: Support pyrepl in browser (GH-136931) (GH-136988)
Basic support for pyrepl in Emscripten. Limitations:
* requires JSPI
* no signal handling implemented

As followup work, it would be nice to implement a webworker variant
for when JSPI is not available and proper signal handling.

Because it requires JSPI, it doesn't work in Safari. Firefox requires
setting an experimental flag. All the Chromiums have full support since
May. Until we make it work without JSPI, let's keep the original web_example
around.
(cherry picked from commit c933a6bb32)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Éric <merwok@netwok.org>
2025-07-22 15:04:11 +02:00
Miss Islington (bot)
8e3c3b5bbc
[3.14] gh-133742: Fix test_sysconfig and test_build_details for relocated directories (GH-136987) (#136990)
gh-133742: Fix test_sysconfig and test_build_details for relocated directories (GH-136987)
(cherry picked from commit aafbdb5df5)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-07-22 12:18:23 +00:00
Miss Islington (bot)
daa2fd7ed2
[3.14] gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (GH-135310) (GH-136984)
(cherry picked from commit 4d02f31cdd)

Co-authored-by: Timon Viola <44016238+timonviola@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-07-22 13:52:34 +02:00
Miss Islington (bot)
4f1f648c3b
[3.14] gh-136251: Improvements to WASM demo REPL (GH-136252) (GH-136977)
(cherry picked from commit d1d526afe7)

Co-authored-by: adam j hartz <adam@smatz.net>
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-22 13:25:35 +02:00
Miss Islington (bot)
c59a60bdb4
[3.14] gh-132661: Document t-strings and templatelib (GH-135229) (#136974)
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Co-authored-by: pauleveritt <pauleveritt@me.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2025-07-22 13:32:00 +03:00
Miss Islington (bot)
d118bc061b
[3.14] gh-124621: Emscripten: Add support for async input devices (GH-136822) (GH-136935)
This is useful for implementing proper `input()`. It requires the
JavaScript engine to support the wasm JSPI spec which is now stage 4.
It is supported on Chrome since version 137 and on Firefox and node
behind a flag.

We override the `__wasi_fd_read()` syscall with our own variant that
checks for a readAsync operation. If it has it, we use our own async
variant of `fd_read()`, otherwise we use the original `fd_read()`.
We also add a variant of `FS.createDevice()` called
`FS.createAsyncInputDevice()`.

Finally, if JSPI is available, we wrap the `main()` symbol with
`WebAssembly.promising()` so that we can stack switch from `fd_read()`.
If JSPI is not available, attempting to read from an AsyncInputDevice
will raise an `OSError`.
(cherry picked from commit 7ae4749d06)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-22 11:51:02 +02:00
Hugo van Kemenade
8e43b130f7
[3.14] gh-134009: Expose PyMutex_IsLocked in the public C API (gh-134365) (#136971)
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-07-22 12:48:08 +03:00
Miss Islington (bot)
11f510167c
[3.14] gh-133296: Publicly expose critical section API that accepts PyMutex (gh-135899) (#136969)
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-22 12:44:59 +03:00
Miss Islington (bot)
ddd3413687
[3.14] gh-136859: Improve StrEnum docs (GH-136864) (#136936)
Co-authored-by: Nacho Caballero <nachocab@gmail.com>
Co-authored-by: Nacho Caballero <nacho.caballero@astrazeneca.com>
Co-authored-by: Antonio Spadaro <ilovelinux@users.noreply.github.com>
2025-07-22 11:32:09 +03:00
Miss Islington (bot)
d5d3adafa7
[3.14] gh-135468: Improve `BaseHandler.http_error_default()` parameter descriptions (GH-136797) (#136825)
Co-authored-by: Valerio Gianella <49408327+valeriogianella@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-07-22 11:29:40 +03:00
Hugo van Kemenade
72b679423d
[3.14] Fix 3 typos in "Next" News items (GH-136892) (#136967)
Co-authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
2025-07-22 08:29:17 +00:00
Miss Islington (bot)
efa984b7ce
[3.14] gh-131531: Android test fixes (GH-136845) (#136962)
Modifies the test runner script to no longer export the the HOST environment
variable, and to allow for tests that produce no Python output (output from the
Android console is still expected and required). These changes stem from
knowledge gained during developing a PR for Android support in cibuildwheel.
(cherry picked from commit 149bddcc21)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-07-22 16:15:50 +08:00
Miss Islington (bot)
6e1b31b87e
[3.14] gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (GH-136893) (#136960)
gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (GH-136893)

An interesting hack, but more localized in scope than GH-135230.

This may be a breaking change if people intentionally keep the original class around
when using `@dataclass(slots=True)`, and then use `__dict__` or `__weakref__` on the
original class.
(cherry picked from commit 46cbdf967a)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2025-07-22 05:08:15 +00:00
Miss Islington (bot)
caef946a25
[3.14] gh-136170: Revert adding ZipFile.data_offset (GH-136950) (#136955)
gh-136170: Revert adding `ZipFile.data_offset` (GH-136950)

* Revert "gh-84481: Make ZipFile.data_offset more robust (GH-132178)"

This reverts commit 6cd1d6c6b1.

* Revert "gh-84481: Add ZipFile.data_offset attribute (GH-132165)"

This reverts commit 0788948dcb.

---------
(cherry picked from commit 6bf1c0ab34)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-07-21 20:35:41 -07:00
Miss Islington (bot)
4af1b72b31
[3.14] gh-133600: Move config.site-wasm32-emscripten into the emscripten folder (GH-136934) (#136956)
Reorganises the large Emscripten-specific file into the Emscripten folder.
(cherry picked from commit bbe589f93c)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-22 00:22:57 +00:00
Miss Islington (bot)
ecd97caaf5
[3.14] gh-136421: Load _datetime static types during interpreter initialization (GH-136583) (GH-136943)
gh-136421: Load `_datetime` static types during interpreter initialization (GH-136583)

`_datetime` is a special module, because it's the only non-builtin C extension that contains static types. As such, it would initialize static types in the module's execution function, which can run concurrently. Since static type initialization is not thread-safe, this caused crashes. This fixes it by moving the initialization of `_datetime`'s static types to interpreter startup (where all other static types are initialized), which is already properly protected through other locks.
(cherry picked from commit a10960699a)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-07-21 19:23:05 -04:00
Miss Islington (bot)
718fc5b139
[3.14] gh-136870: fix data race in PyThreadState_Clear on sys_tracing_threads (GH-136951) (#136953)
gh-136870: fix data race in `PyThreadState_Clear` on `sys_tracing_threads` (GH-136951)

In free-threading, multiple threads can be cleared concurrently as such the modifications on `sys_tracing_threads` should be done while holding the profile lock, otherwise it can race with other threads setting up profiling.
(cherry picked from commit f183996eb7)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-21 21:01:14 +00:00
Serhiy Storchaka
893707c538
[3.14] gh-135661: Fix parsing attributes with whitespaces around the "=" separator in HTMLParser (GH-136908) (#136927) 2025-07-21 20:34:24 +02:00
Miss Islington (bot)
fa9a369044
[3.14] gh-136437: Document os.path.dirname as accepting only pos-only (GH-136946) (#136947)
gh-136437: Document `os.path.dirname` as accepting only pos-only (GH-136946)
(cherry picked from commit 3224429450)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-21 18:29:22 +00:00
Miss Islington (bot)
81edfb7140
[3.14] GH-136874: url2pathname(): discard query and fragment components (GH-136875) (#136942)
GH-136874: `url2pathname()`: discard query and fragment components (GH-136875)

In `urllib.request.url2pathname()`, ignore any query or fragment components
in the given URL.
(cherry picked from commit 80b2d60a51)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2025-07-21 19:08:07 +01:00
Miss Islington (bot)
aa17c39339
[3.14] gh-136437: Document some os.path functions as requiring pos-only (GH-136812) (#136944)
gh-136437: Document some `os.path` functions as requiring pos-only (GH-136812)
(cherry picked from commit b5428bb0e7)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-21 18:07:56 +00:00
Miss Islington (bot)
f86a59549b
[3.14] Pedantic rewording of why relative importing doesn't work in main modules (GH-136846) (#136940)
Pedantic rewording of why relative importing doesn't work in main modules (GH-136846)

Pedantically reword the section about relative imports and main modules.
(cherry picked from commit 4b68289ca6)

Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
2025-07-21 09:58:27 -07:00
Miss Islington (bot)
11378e1c85
[3.14] gh-135621: Simplify TermInfo (GH-136916) (#136925) 2025-07-21 18:04:13 +02:00
Lysandros Nikolaou
af8d1f56f5
[3.14] gh-132661: Disallow Template/str concatenation after PEP 750 spec update (#135996) (#136901)
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-21 17:34:54 +02:00
Miss Islington (bot)
0d87bb66d3
[3.14] gh-121028: Soft-deprecate sys.api_version (GH-136463) (GH-136928)
(cherry picked from commit 658599c15d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-21 12:29:51 +00:00
Miss Islington (bot)
031645a884
[3.14] gh-135621: Remove dependency on curses from PyREPL (GH-136758) (GH-136915)
(cherry picked from commit 09dfb50f1b)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-07-21 13:02:41 +02:00
Miss Islington (bot)
4f6f3ee8d3
[3.14] gh-136852: Emscripten: Add PYTHON_NODE_VERSION environment variable (GH-136853) (GH-136907)
To choose the node version we use. Together with:
https://github.com/python/buildmaster-config/pull/614
closes GH-136852.
(cherry picked from commit aec7f5f8b2)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-21 11:58:57 +02:00
Miss Islington (bot)
a69472e242
[3.14] gh-134411: assert PyLong_FromLong(x) != NULL when x is known to be small (GH-134415) (#136910)
gh-134411: assert `PyLong_FromLong(x) != NULL` when `x` is known to be small (GH-134415)

Since `PyLong_From Long(PY_MONITORING_DEBUGGER_ID)` falls to `small_int` case and can't return `NULL`. Added `assert`s for extra confidence.
https://github.com/python/cpython/issues/134411#issuecomment-2897653868
(cherry picked from commit cf19b6435d)

Co-authored-by: Sergey Muraviov <smurav@mail.ru>
2025-07-21 09:23:33 +00:00
Miss Islington (bot)
163f532530
[3.14] gh-136882: Update stale link in the basic logging tutorial. (GH-136885) (#136905)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-21 12:04:39 +03:00
Miss Islington (bot)
d0623cbbf5
[3.14] gh-136428: amend UUIDv8 performance improvements (GH-136903) (#136904)
gh-136428: amend UUIDv8 performance improvements (GH-136903)

UUIDv8 has been added in Python 3.14.0a2 and its construction time
has been improved in Python 3.14.0a4, but since those changes will
not be visible when comparing the latest Python 3.13 and 3.14 together,
we do not document them on the What's New page to avoid confusion.
(cherry picked from commit 5798348a07)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-21 08:29:52 +00:00
Miss Islington (bot)
9663f93a50
[3.14] gh-136470: Correct InterpreterPoolExecutor's default thread name (GH-136472) (GH-136889)
gh-136470: Correct InterpreterPoolExecutor's default thread name (GH-136472)

The OS thread name is now correctly prefixed with `InterpreterPoolExecutor` instead of `ThreadPoolExecutor`.
(cherry picked from commit 246be21de1)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-07-21 00:00:19 +00:00
Miss Islington (bot)
17c5959aa3
[3.14] GH-130645: Default to color help in argparse (GH-136809) (#136886)
GH-130645: Default to color help in argparse (GH-136809)
(cherry picked from commit acbe896cb1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-07-20 15:22:53 -07:00
Miss Islington (bot)
2f7684ceee
[3.14] GH-111758: Merge TSan and UBSan reusable GHA workflows (GH-136820) (#136883)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-20 20:28:28 +00:00
Miss Islington (bot)
2caae152b9
[3.14] gh-86608: Improve and restructure tarfile examples (GH-121771) (#136866)
gh-86608: Improve and restructure tarfile examples (GH-121771)

Add an example on how to write a tarfile to stdout; general improvements.
(cherry picked from commit cc81b4e501)

Co-authored-by: Dominic H <dom@dominic.sk>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-20 14:16:19 +01:00
Miss Islington (bot)
c537b98e48
[3.14] gh-130655: gettext: Add fallback testcase (GH-136857) (#136862)
gh-130655: gettext: Add fallback testcase (GH-136857)
(cherry picked from commit c6e6fe92cd)

Co-authored-by: Dominic H <dom@dominic.sk>
2025-07-20 12:32:58 +00:00
Miss Islington (bot)
ee37365e0d
[3.14] gh-136854: Exit on error in make venv (GH-136856) (#136860)
Co-authored-by: Nacho Caballero <nachocab@gmail.com>
Co-authored-by: Nacho Caballero <nacho.caballero@astrazeneca.com>
2025-07-20 12:13:48 +00:00
Olga Pustovalova
0e909267f6
[3.14] gh-136438: Make sure test_remote_pdb pass with all optimization levels (GH-136788) (GH-136855)
(cherry picked from commit 588d9fb84a)
2025-07-20 13:51:59 +02:00
Miss Islington (bot)
2cb3b534e7
[3.14] gh-108362: Retarget incremental GC changes to 3.14 (GH-125453) (#136851)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-20 14:28:17 +03:00
Miss Islington (bot)
cce38eefd4
[3.14] Doc/c-api/memory.rst: extend --without-pymalloc doc with ASan information (GH-136790) (GH-136798)
Extend the documentation for disabling pymalloc with the `--without-pymalloc` flag regarding why it is worth to use it when enabling AddressSanitizer for Python build (which is done, e.g., in CPython's CI builds).

I have tested the CPython latest main build with both ASan and pymalloc enabled and it seems to work just fine. I did run the `python -m test` suite which didn't uncover any ASan crashes (though, it detected some memory leaks, which I believe are irrelevant here).

I have discussed ASan and this flag with @encukou on the CPython Core sprint on EuroPython 2025. We initially thought that the `--without-pymalloc` flag is needed for ASan builds due to the fact pymalloc must hit the begining of page when determining if the memory to be freed comes from pymalloc or was allocated by the system malloc. In other words, we thought, that ASan would crash CPython during free of big objects (allocated by system malloc). It may be that this was the case in the past, but it is not the case anymore as the `address_in_range` function used by pymalloc is annotated to be skipped from the ASan instrumentation.


(cherry picked from commit d19bb44713)

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-20 10:55:06 +02:00
Miss Islington (bot)
197f3eca2a
[3.14] gh-136764: improve comment in enum.verify.__call__ (GH-136774) (GH-136841)
gh-136764: improve comment in enum.verify.__call__ (GH-136774)
(cherry picked from commit 6a1c93af80)

Co-authored-by: Saurav Singh <sauravsinghshakya@yahoo.com>
2025-07-19 11:00:15 -07:00
Miss Islington (bot)
4606b4089d
[3.14] gh-136839: Refactor simple dict.update calls (GH-136811) (#136840)
gh-136839: Refactor simple dict.update calls (GH-136811)

Refactor simple dict.update calls

This commit refactors simple `dict.update({key: value})` calls which can
be done via `dict[key] = value` instead.

I found those cases with the [semgrep](https://semgrep.dev/) tool:

```
$ semgrep --lang python --pattern '$DICT.update({$A: ...})'

┌─────────────────┐
│ 5 Code Findings │
└─────────────────┘

    Lib/dataclasses.py
         1268┆ slots.update({slot: doc})

    Lib/multiprocessing/resource_tracker.py
           50┆ _CLEANUP_FUNCS.update({
           51┆     'semaphore': _multiprocessing.sem_unlink,
           52┆ })
            ⋮┆----------------------------------------
           53┆ _CLEANUP_FUNCS.update({
           54┆     'shared_memory': _posixshmem.shm_unlink,
           55┆ })

    Lib/tkinter/scrolledtext.py
           26┆ kw.update({'yscrollcommand': self.vbar.set})

    Lib/xmlrpc/server.py
          242┆ self.funcs.update({'system.multicall' : self.system_multicall})
```
(cherry picked from commit 69ea1b3a8f)

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2025-07-19 17:36:31 +00:00
Miss Islington (bot)
f8af7cb723
[3.14] gh-136752: Clarify documentation for `IPv{N}Address.is_reserved` (GH-136794) (#136827)
gh-136752: Clarify documentation for ``IPv{N}Address.is_reserved`` (GH-136794)
(cherry picked from commit 6293d8a1a6)

Co-authored-by: Matthieu Lienart <50069805+mlnrt@users.noreply.github.com>
Co-authored-by: Matthieu Lienart <matthieu.lienart@axians.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-19 14:50:30 +00:00
Miss Islington (bot)
8d063f3d92
[3.14] gh-54732: Make argparse error caused by empty rows in option files explicit (GH-136795) (#136818)
gh-54732: Make argparse error caused by empty rows in option files explicit (GH-136795)
(cherry picked from commit 8ffc3ef01e)

Co-authored-by: jdunter <2ve@mailbox.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-19 14:28:52 +00:00
Miss Islington (bot)
2a9aeb0f57
[3.14] gh-136801: Fix PyREPL syntax highlightning on match cases after multi-line case (GH-136804) (GH-136813)
(cherry picked from commit 3a64844533)

Co-authored-by: Olga Matoula <olgamatoula@gmail.com>
2025-07-19 15:56:40 +02:00
Miss Islington (bot)
03457ca2ac
[3.14] gh-135730: Clarify multiprocessing.Queue close() documentation (GH-136803) (GH-136806)
gh-135730: Clarify multiprocessing.Queue close() documentation (GH-136803)

Add a copy of the text from SimpleQueue.close()

---------
(cherry picked from commit f575588ccf)

Co-authored-by: aggshruti99 <aggshruti99@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-19 14:57:52 +02:00
Miss Islington (bot)
8b4275c99a
[3.14] gh-136769: Include fixed-width integers in the fundamental data types table (GH-136784) (#136785)
gh-136769: Include fixed-width integers in the fundamental data types table (GH-136784)

Fixed-sized types, like ``c_int32``, are currently missing from the fundamental data types table
in the ``ctypes`` documentation. This commit adds them, and  notes that ``c_[u]int8`` is an alias
of ``c_[u]byte``.
(cherry picked from commit acefb978dc)

Co-authored-by: Sina Zel taat <111974143+SZeltaat@users.noreply.github.com>
2025-07-19 10:26:22 +00:00
Miss Islington (bot)
a91e2bc440
[3.14] Fix typo in Lib/test/test_ast/test_ast.py (GH-136767) (#136783)
Fix typo in `Lib/test/test_ast/test_ast.py` (GH-136767)

`ASTOptimiziationTests` -> `ASTOptimizationTests`
(cherry picked from commit 60146f4f6f)

Co-authored-by: Hunter Hogan <hunterhogan@users.noreply.github.com>
2025-07-19 10:23:52 +00:00
Miss Islington (bot)
ba6ea7c53d
[3.14] gh-74598: document that fnmatch.filterfalse is affected by cache limitation (GH-136781) (#136782)
gh-74598: document that `fnmatch.filterfalse` is affected by cache limitation (GH-136781)
(cherry picked from commit 263e451c41)

Co-authored-by: Gergely Elias <gergely.elias@gmail.com>
2025-07-19 09:56:55 +00:00
Miss Islington (bot)
aeeacdb8b5
[3.14] Docs: Improve example for `itertools.batched()` (GH-136775) (#136778)
Docs: Improve example for ``itertools.batched()`` (GH-136775)

The current example `batched('ABCDEFG', n=3) → ABC DEF G` can confuse readers because both, the size of the tuples and the number of tuples are 3.
By using a batch size of n=2, it is clearer that the `n` argument refers to the size of the resulting tuples.
I.e. the new example is: `batched('ABCDEFG', n=2) → AB CD EF G`
(cherry picked from commit 3eecc72ac7)

Co-authored-by: RafaelWO <38643099+RafaelWO@users.noreply.github.com>
2025-07-19 09:36:35 +00:00
Miss Islington (bot)
81aab6d51c
[3.14] parser_generator.py typo - keywods -> keywords (GH-135014) (#136772)
Co-authored-by: chemelnucfin <3982092+chemelnucfin@users.noreply.github.com>
2025-07-19 09:18:55 +00:00
Miss Islington (bot)
201c765d76
[3.14] Fix typo: "occured" =>"occurred" (GH-134928) (#136771)
Co-authored-by: Roman <121314722+GameRoMan@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-19 09:13:51 +00:00
Miss Islington (bot)
2ea3b75200
[3.14] gh-136697: Use the standard audit event format for sys.monitoring docs (GH-136747) (#136749)
gh-136697: Use the standard audit event format for sys.monitoring docs (GH-136747)
(cherry picked from commit 28937d3a21)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-07-17 12:00:09 -07:00
Miss Islington (bot)
76d4a43bd8
[3.14] gh-127146: Emscripten: Set umask to zero in python.sh (GH-136740) (#136745)
Clears the umask used during a test of pydoc.apropos when testing on
Emscripten. This is to work around a known issue in Emscripten; but it's not
clear if the chmod call that is causing the problem is actually testing
anything of significance.
(cherry picked from commit 22af5d35a6)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-17 16:05:40 +00:00
Miss Islington (bot)
2ce207108c
[3.14] Improved venv docs to indicate that isolation is the default. (GH-136698) (GH-136705)
(cherry picked from commit 8e2f4b4483)
Co-authored-by: Facundo Batista <facundo@taniquetil.com.ar>
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2025-07-17 11:24:54 +01:00
Miss Islington (bot)
9bf3464852
[3.14] gh-135148: Correctly handle f/t strings with comments and debug expressions (GH-135198) (#136720) 2025-07-17 00:10:46 +02:00
Zachary Ware
5f1d46f7d0
[3.14] gh-136710: Fix bad indentation in os.chdir docstring (GH-136719)
(cherry picked from commit bde808ad6b)

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2025-07-16 17:15:50 +00:00
Miss Islington (bot)
6943d8ef27
[3.14] gh-126548: Add a thread-unsafety warning for importlib.reload() (GH-136704) (GH-136723)
gh-126548: Add a thread-unsafety warning for `importlib.reload()` (GH-136704)
(cherry picked from commit 69d8fe50dd)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-07-16 16:40:11 +00:00
Miss Islington (bot)
9b7c4183cd
[3.14] gh-127146: Emscripten: Don't need to avoid unpaired surrogate anymore (GH-136707) (#136717)
This might have been fixed by gh-136624, or by some Emscripten change.
In any case, it no longer seems to be needed.
(cherry picked from commit dcd27aace1)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-16 16:24:15 +00:00
Miss Islington (bot)
4eee754091
[3.14] gh-127146: Emscripten: Make os.umask() actually work (GH-136706) (#136711)
Provide a stub implementation of umask that is enough to get some tests passing.
More work is needed upstream in Emscripten to make all umask tests to pass.
(cherry picked from commit 12e52cad71)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-16 16:12:36 +00:00
Miss Islington (bot)
ca6db4fdae
[3.14] gh-127146: Emscripten: more regular stack overflow skips (GH-136708) (#136712)
Makes the Emscripten stack overflow skip message consistent with WASI,
and replaces some ad-hoc skips.
(cherry picked from commit c730952aa6)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-16 17:54:04 +02:00
Miss Islington (bot)
9ab29cac19
[3.14] Add .gram file to the .editorconfig (GH-136680) (#136714)
Add `.gram` file to the `.editorconfig` (GH-136680)
(cherry picked from commit 2f0db9b05f)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-16 15:01:44 +00:00
Miss Islington (bot)
677b0e314c
[3.14] gh-136523: Fix wave.Wave_write emitting an unraisable when open raises (GH-136529) (GH-136606)
(cherry picked from commit 171de05b48)

Co-authored-by: Sachin Shah <39803835+inventshah@users.noreply.github.com>
2025-07-16 07:26:52 +00:00
Miss Islington (bot)
cdf98c3b7e
[3.14] gh-127146: Report uid in Emscripten + node as native uid (GH-136509) (#136699)
Corrects the handling of getuid on emscripten, which was consistently reporting as 0.
(cherry picked from commit e81c4e84b3)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-16 06:50:51 +02:00
Miss Islington (bot)
d888f46fba
[3.14] Fix the doctest.testmod() docstring (GH-136675) (GH-136690)
__test__ = None is not supported since Python 2.4.
(cherry picked from commit cb59eaefed)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-15 17:07:01 +00:00
Miss Islington (bot)
323974295d
[3.14] Fix index entry and anchor for module.__test__ (GH-136674) (GH-136688)
It was "doctest.module attribute". Now it is "module attribute".
(cherry picked from commit 7689407fa4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-15 15:58:52 +00:00
Miss Islington (bot)
9ae74e94a0
[3.14] gh-136396: Include instrumentation when creating new copies of the bytecode (GH-136525) (GH-136657)
Previously, we assumed that instrumentation would happen for all copies of
the bytecode if the instrumentation version on the code object didn't match
the per-interpreter instrumentation version. That assumption was incorrect:
instrumentation will exit early if there are no new "events," even if there
is an instrumentation version mismatch.

To fix this, include the instrumented opcodes when creating new copies of
the bytecode, rather than replacing them with their uninstrumented variants.
I don't think we have to worry about races between instrumentation and creating
new copies of the bytecode: instrumentation and new bytecode creation cannot happen
concurrently. Instrumentation requires that either the world is stopped or the
code object's per-object lock is held and new bytecode creation requires holding
the code object's per-object lock.
(cherry picked from commit d995922198)

Co-authored-by: mpage <mpage@meta.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-15 11:10:37 -04:00
Miss Islington (bot)
c939963b53
[3.14] gh-136682: Remove incorrect statement that os.path.samestat accepts file-like objects (GH-136683) (#136684)
gh-136682: Remove incorrect statement that `os.path.samestat` accepts file-like objects (GH-136683)
(cherry picked from commit 7e10a103df)

Co-authored-by: Ran Benita <ran@unusedvar.com>
2025-07-15 12:59:38 +00:00
Miss Islington (bot)
45b72c447c
[3.14] gh-72570: mention the incompatibility of XOFs with HMAC (GH-136676) (#136678)
gh-72570: mention the incompatibility of XOFs with HMAC (GH-136676)
(cherry picked from commit a02cf19dee)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-15 12:09:54 +00:00
Miss Islington (bot)
2ae0eb1a87
[3.14] GH-132661: Add `string.templatelib.convert()` (GH-135217) (#136671)
GH-132661: Add ``string.templatelib.convert()`` (GH-135217)
(cherry picked from commit 5b969fd645)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-15 10:22:24 +00:00
Miss Islington (bot)
115477399b
[3.14] gh-131189: Fix "msvcrt" import warning on Linux when "_ctypes" is not available. (GH-131201) (GH-136668)
Fix "msvcrt" import warning on Linux when "_ctypes" is not available.

On Linux, compiling without "libffi" causes a
"No module named 'msvcrt'" warning when launching PyREPL.
(cherry picked from commit f320c951c3)

Co-authored-by: Dzmitry Plashchynski <plashchynski@gmail.com>
2025-07-15 10:12:45 +02:00
Miss Islington (bot)
088d79e3ee
[3.14] gh-136663: fix signatures of PyFloat_Pack/Unpack in docs (GH-136664) (#136666)
gh-136663: fix signatures of PyFloat_Pack/Unpack in docs (GH-136664)
(cherry picked from commit e4654e0b3e)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-07-15 05:36:47 +00:00
Miss Islington (bot)
55eaaab8a4
[3.14] gh-116738: Make grp module thread-safe (GH-135434) (#136658)
gh-116738: Make grp module thread-safe (GH-135434)

Make grp module methods getgrgid() and getgrnam() thread-safe when the GIL is disabled and getgrgid_r()/getgrnam_r() C APIs are not available.
---------
(cherry picked from commit 9363703bd3)

Co-authored-by: Alper <alperyoney@fb.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-15 11:03:33 +05:30
Miss Islington (bot)
bbbbb2e2d1
[3.14] Partially revert "gh-101100: Fix sphinx warnings in library/email.parser.rst (GH-136475)" (GH-136629) (#136646)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-14 13:19:23 +03:00
Miss Islington (bot)
261818061e
[3.14] gh-127146: Emscripten: Fix test_open_undecodable_uri by setting -sTEXTDECODER=2 (GH-136624) (#136631)
Removes the JS text decoder fallback and gets rid of the bugs due to the differences
in behavior on invalid utf8 strings. See https://github.com/emscripten-core/emscripten/issues/24690.
(cherry picked from commit 283b050523)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-14 04:49:36 +02:00
Miss Islington (bot)
ba070b6b07
[3.14] gh-135256: Simplify parsing parameters in Argument Clinic (GH-135257) (121914136635)
(cherry picked from commit b74fb8e220)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-13 20:52:02 +00:00
Miss Islington (bot)
348e22cf06
[3.14] gh-127971: fix off-by-one read beyond the end of a string during search (GH-132574) (#136628)
gh-127971: fix off-by-one read beyond the end of a string during search (GH-132574)
(cherry picked from commit 85ec3b3b50)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-07-13 13:58:03 +00:00
Miss Islington (bot)
ed1e0cdc58
[3.14] gh-42237: Link to complete list of codec aliases (GH-136625) (#136626)
gh-42237: Link to complete list of codec aliases (GH-136625)

Closes GH-42237
(cherry picked from commit a93d9aaf62)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-13 13:19:23 +00:00
Miss Islington (bot)
9ee72ab266
[3.14] gh-132346: Docs: Clarify that reference counts aren't stable between versions (GH-132352) (GH-136613)
gh-132346: Docs: Clarify that reference counts aren't stable between versions (GH-132352)
(cherry picked from commit 3dbe02ccd3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-07-13 09:17:48 +00:00
Miss Islington (bot)
e1dc08bd9a
[3.14] gh-134833: improve docs for del s[i:j] in Mutable Sequence Types (GH-134834) (#136608)
gh-134833: improve docs for `del s[i:j]` in `Mutable Sequence Types` (GH-134834)
(cherry picked from commit 609d5adc7c)

Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-07-13 12:28:45 +05:30
Miss Islington (bot)
a1ed132a19
[3.14] Docs: Fix and improve the PyUnstable_Object_EnableDeferredRefcount documentation (GH-135323) (GH-136610)
Docs: Fix and improve the `PyUnstable_Object_EnableDeferredRefcount` documentation (GH-135323)
(cherry picked from commit 0d4fd10fba)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-07-13 06:52:58 +00:00
Miss Islington (bot)
f50cd5bec7
[3.14] gh-134939: Correct concurrent.interpreters source code link (GH-136564) (#136605)
gh-134939: Correct `concurrent.interpreters` source code link (GH-136564)
(cherry picked from commit 42b251bceb)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-13 05:42:51 +00:00
Miss Islington (bot)
d351f29ef0
[3.14] gh-101100: Fix sphinx warnings in Doc/library/platform.rst (GH-136562) (GH-136597)
(cherry picked from commit 47b01da4cc)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-07-12 18:22:51 +00:00
Miss Islington (bot)
64df22c190
[3.14] gh-136549: Fix signature of threading.excepthook() (GH-136559) (GH-136589)
(cherry picked from commit be2c3d284e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-12 16:18:23 +00:00
Miss Islington (bot)
d5866a8e84
[3.14] gh-91153: prevent a crash in bytearray.__setitem__(ind, ...) when ind.__index__ has side-effects (GH-132379) (#136581)
gh-91153: prevent a crash in `bytearray.__setitem__(ind, ...)` when `ind.__index__` has side-effects (GH-132379)
(cherry picked from commit 5e1e21dee3)

Co-authored-by: Bast <52266665+bast0006@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-12 14:38:57 +00:00
Miss Islington (bot)
c71ecd1418
[3.14] gh-134759: fix UnboundLocalError in email.message.Message.get_payload (GH-136071) (#136579)
gh-134759: fix `UnboundLocalError` in `email.message.Message.get_payload` (GH-136071)
(cherry picked from commit 25335d297b)

Co-authored-by: Kliment Lamonov <klimentlamonov@yandex.ru>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-12 13:56:10 +00:00
Miss Islington (bot)
33f561d7be
[3.14] gh-89083: Add CLI tests for UUIDv{6,7,8} (GH-136548) (#136576)
gh-89083: Add CLI tests for `UUIDv{6,7,8}` (GH-136548)
(cherry picked from commit c564847e98)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-12 12:33:53 +00:00
Miss Islington (bot)
ac807cb3a0
[3.14] gh-101100: Fix sphinx warnings in Doc/library/functools.rst (GH-136424) (GH-136552)
Add index entries and anchors for cache_info, cache_clear and register.
(cherry picked from commit 252e2f710e)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-07-11 17:09:22 +00:00
Miss Islington (bot)
e4e86a1b87
[3.14] gh-130160: use .. program:: directive for documenting venv CLI (GH-130699) (#136550)
gh-130160: use `.. program::` directive for documenting `venv` CLI (GH-130699)
(cherry picked from commit fb9f933b8e)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-11 17:03:11 +00:00
Miss Islington (bot)
3b28b402a5
[3.14] gh-130478: fix HACL* build for macOS Silicon (GH-134188) (#135009)
gh-130478: fix HACL* build for macOS Silicon (GH-134188)
(cherry picked from commit ac7511062b)

Co-authored-by: Sam Ng <hongsheng@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-11 16:25:58 +00:00
Miss Islington (bot)
e03db7317f
[3.14] gh-136517: Print uncollectable objects if DEBUG_UNCOLLECTABLE mode was set (GH-136518) (#136522)
gh-136517: Print uncollectable objects if DEBUG_UNCOLLECTABLE mode was set (GH-136518)
(cherry picked from commit c560df9658)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-07-11 15:20:05 +01:00
Miss Islington (bot)
5535482d2a
[3.14] gh-136541: Fix several problems of perf trampolines in x86_64 and aarch64 (GH-136500) (#136544)
gh-136541: Fix several problems of perf trampolines in x86_64 and aarch64 (GH-136500)

This commit fixes the following problems:

* The x86_64 trampolines are not preserving frame pointers
* The hardcoded offsets to the code segment from the FDE only worked properly for x64_64
* The CIE data was not following conventions of aarch64
* The eh_frame for aarch64 was not fully correct
(cherry picked from commit 236f733d8f)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-07-11 14:06:19 +00:00
Miss Islington (bot)
a464c4e2e8
[3.14] gh-136434: Fix docs generation of UnboundItem in subinterpreters (GH-136435) (#136540)
gh-136434: Fix docs generation of `UnboundItem` in subinterpreters (GH-136435)
(cherry picked from commit 3343fce05a)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-11 12:57:52 +00:00
Miss Islington (bot)
fdad31924c
[3.14] gh-76637: Note that undefined Codec is for testing (GH-136531) (#136536)
gh-76637: Note that `undefined` Codec is for testing (GH-136531)

Closes GH-76637
(cherry picked from commit 975b57d945)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-11 10:56:34 +00:00
Miss Islington (bot)
ec15251af5
[3.14] gh-101100: Fix sphinx warnings in library/email.parser.rst (GH-136475) (#136532)
Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-07-11 09:43:52 +00:00
Miss Islington (bot)
183b020cb5
[3.14] gh-52876: Implement missing parameter in codecs.StreamReaderWriter functions (GH-136498) (#136514)
gh-52876: Implement missing parameter in `codecs.StreamReaderWriter` functions (GH-136498)

Closes GH-52876
(cherry picked from commit 35e2c35970)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-10 16:09:45 +00:00
Miss Islington (bot)
326fe0df66
[3.14] gh-82663: Clarify codecs.iterdecode/encode docs (GH-136497) (#136513)
gh-82663: Clarify `codecs.iterdecode/encode` docs (GH-136497)

Closes GH-82663
(cherry picked from commit 4b41b2043b)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-10 17:41:31 +02:00
Miss Islington (bot)
95baa28d9f
[3.14] gh-132661: Add default value (of "") for Interpolation.expression (GH-136441) (#136511)
Co-authored-by: Dave Peck <davepeck@gmail.com>
2025-07-10 14:52:18 +00:00
Miss Islington (bot)
da8bcfd949
[3.14] gh-136394: Fix race condition in test_zstd (GH-136432) (GH-136506)
gh-136394: Fix race condition in test_zstd (GH-136432)
(cherry picked from commit f519918ec6)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
2025-07-10 09:13:34 -04:00
Miss Islington (bot)
1346049782
[3.14] gh-136209: Add .. c:var:: declarations for C exception types (GH-136210) (GH-136504)
(cherry picked from commit 85bc89f35f)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-10 15:10:43 +02:00
Miss Islington (bot)
2de82bcc62
[3.14] gh-136438: Make sure test_builtins pass with all optimization levels (GH-136474) (#136496)
gh-136438: Make sure `test_builtins` pass with all optimization levels (GH-136474)
(cherry picked from commit c176543349)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-10 12:30:07 +03:00
Miss Islington (bot)
7880421983
[3.14] gh-136476: Remove creation of unused list (GH-136494) (GH-136495)
(cherry picked from commit b44316a097)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-10 08:36:48 +00:00
Miss Islington (bot)
7937f16ade
[3.14] gh-135846: Add zstd dependency to Android build script (GH-136253) (#136491)
Adds zstd to the Android build process.
(cherry picked from commit 61dd9fdad7)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-07-10 08:51:09 +08:00
Miss Islington (bot)
4d025a2318
[3.14] gh-136476: Show the full stack in get_async_stack_trace in _remote_debugging (GH-136483) (#136490)
gh-136476: Show the full stack in get_async_stack_trace in _remote_debugging (GH-136483)
(cherry picked from commit ea45a2f97c)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-07-10 00:57:40 +01:00
Miss Islington (bot)
b733bf7437
[3.14] gh-102740: Clarify time.monotonic() "system-wide" in the doc (GH-136431) (#136488)
gh-102740: Clarify time.monotonic() "system-wide" in the doc (GH-136431)
(cherry picked from commit 9c4d287775)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-09 23:13:29 +00:00
Miss Islington (bot)
4db567546a
[3.14] gh-136145: Define 'standard library' and 'stdlib' in the glossary (GH-136485)
(cherry picked from commit 92f392ad9e)

Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
2025-07-09 21:39:33 +00:00
Miss Islington (bot)
78359403c5
[3.14] gh-81520: Document unexpected os.path.ismount behaviour with btrfs subvolumes (GH-136058) (GH-136471)
gh-81520: Document unexpected `os.path.ismount` behaviour with btrfs subvolumes (GH-136058)
(cherry picked from commit 591abcc01f)

Co-authored-by: Oskar Roesler <o.roesler@oscloud.info>
2025-07-09 16:00:54 +00:00
Miss Islington (bot)
75640d4b1f
[3.14] gh-131825: Fix sqlite3 timezone-naive adapter recipe (GH-136270) (GH-136467)
gh-131825: Fix `sqlite3` timezone-naive adapter recipe (GH-136270)
(cherry picked from commit 6a6cd3c07c)

Co-authored-by: NekrodNIK <60639354+NekrodNIK@users.noreply.github.com>
2025-07-09 14:12:47 +00:00
Miss Islington (bot)
90717c2cec
[3.14] Docs: unittest.enterModuleContext is not a classmethod (GH-136464) (#136465)
Co-authored-by: Geoffrey Thomas <geofft@ldpreload.com>
2025-07-09 13:59:40 +00:00
Miss Islington (bot)
19518a4205
[3.14] gh-136447: Use self.loop instead of global loop variable in asyncio REPL (GH-136448) (#136458)
gh-136447: Use `self.loop` instead of global `loop` variable in asyncio REPL (GH-136448)
(cherry picked from commit 77fa7a4dcc)

Co-authored-by: Justin Su <injustsu@gmail.com>
2025-07-09 09:23:43 +00:00
Miss Islington (bot)
c29fce05f3
[3.14] gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665) (#136455)
gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665)
(cherry picked from commit 797abd1f7f)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-07-09 08:34:19 +00:00
Miss Islington (bot)
a9d2f08b57
[3.14] gh-136162: Document encodings package functions (GH-136164) (#136454)
gh-136162: Document `encodings` package functions (GH-136164)

Closes GH-136162.
(cherry picked from commit ffd7f2f231)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-09 10:07:34 +02:00
Miss Islington (bot)
85df16b7fa
[3.14] gh-53243: Document codecs.readbuffer_encode() (GH-136284) (#136452)
gh-53243: Document `codecs.readbuffer_encode()` (GH-136284)

Closes GH-53243
(cherry picked from commit f1dcf3c7bf)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-09 10:07:18 +02:00
Miss Islington (bot)
2cb5792836
[3.14] gh-94503: Update logging cookbook example with info on addressing log injection. (GH-136446) (GH-136449)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-09 09:00:30 +01:00
Miss Islington (bot)
e0b9f0721c
[3.14] gh-136229: Remove Platform Emscripten is not supported warning (GH-136230) (#136445)
Updates configure script to identify Emscripten as Tier 3.
(cherry picked from commit 6ea4258285)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-09 02:42:49 +00:00
Miss Islington (bot)
9a79c5128f
[3.14] gh-91048: Revert the memory cache removal for remote debugging (GH-136440) (#136443)
gh-91048: Revert the memory cache removal for remote debugging (GH-136440)
(cherry picked from commit 77d25e5b16)


gh-91048: Reintroduce the memory cache for remote debugging

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-07-09 02:21:56 +01:00
Miss Islington (bot)
6a2a2906f8
[3.14] GH-133136: Revise QSBR to reduce excess memory held (gh-135473) (#135912)
The free threading build uses QSBR to delay the freeing of dictionary
keys and list arrays when the objects are accessed by multiple threads
in order to allow concurrent reads to proceed with holding the object
lock. The requests are processed in batches to reduce execution
overhead, but for large memory blocks this can lead to excess memory
usage.

Take into account the size of the memory block when deciding when to
process QSBR requests.

Also track the amount of memory being held by QSBR for mimalloc pages.  Advance the write sequence if this memory exceeds a limit.  Advancing the sequence will allow it to be freed more quickly.

Process the held QSBR items from the "eval breaker", rather than from `_PyMem_FreeDelayed()`.  This gives a higher chance that the global read sequence has advanced enough so that items can be freed.

(cherry picked from commit 113de8545f)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-07-08 10:58:01 -07:00
Miss Islington (bot)
66f85f4be8
[3.14] Update bytecode magic number in tests for the 3.14 release candidate (GH-136427) (#136429)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-08 17:38:37 +00:00
Miss Islington (bot)
f937b9fffb
[3.14] gh-136380: Fix import behavior for concurrent.futures.InterpreterPoolExecutor (GH-136381) (#136420)
gh-136380: Fix import behavior for `concurrent.futures.InterpreterPoolExecutor` (GH-136381)
(cherry picked from commit 490eea0281)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-08 19:11:48 +03:00
Hugo van Kemenade
0a15ae71ad Merge branch '3.14' of https://github.com/python/cpython into 3.14 2025-07-08 17:35:22 +03:00
Hugo van Kemenade
72358614d2 Post 3.14.0b4 2025-07-08 17:31:34 +03:00
Miss Islington (bot)
78c1227381
[3.14] gh-136186: Fix race condition in test_external_inspection.test_only_active_thread (GH-136347) (#136416) 2025-07-08 12:48:03 +00:00
Miss Islington (bot)
f0e603412b
[3.14] gh-101100: Fix sphinx warnings in Doc/library/exceptions.rst (GH-136309) (#136414)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-08 12:11:28 +00:00
Hugo van Kemenade
7ec1faba0c Python 3.14.0b4 2025-07-08 11:57:23 +03:00
Miss Islington (bot)
376e037ecc
[3.14] gh-120713: Make _Py_NORMALIZE_CENTURY private (GH-135933) (#136387)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-08 11:43:57 +03:00
Miss Islington (bot)
145c08629b
[3.14] gh-136297: Fix hypothesis and subTest usage in test_zoneinfo_property.py (GH-136384) (#136407)
gh-136297: Fix `hypothesis` and `subTest` usage in `test_zoneinfo_property.py` (GH-136384)
(cherry picked from commit db699db99d)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-08 08:16:51 +00:00
Miss Islington (bot)
3296d9bcfd
[3.14] gh-136155: Docs: only add custom OpenGraph protocol meta tags for HTML builds (GH-136187) (#136382)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-07-08 10:03:40 +03:00
Miss Islington (bot)
2733b290ea
[3.14] gh-101100: Fix sphinx warnings in whatsnew/3.11.rst (GH-136402) (#136405)
Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-07-08 06:47:17 +00:00
Miss Islington (bot)
cdeaa64214
[3.14] gh-102567: Add missing newline to --help-all (GH-136391) (GH-136403)
gh-102567: Add missing newline to `--help-all` (GH-136391)
(cherry picked from commit fbef0c1d6a)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-08 06:24:08 +00:00
Miss Islington (bot)
78e5d109f5
[3.14] gh-135913: Document ob_refcnt, ob_type, ob_size (GH-135914) (GH-136377)
gh-135913: Document ob_refcnt, ob_type, ob_size (GH-135914)

* gh-135913: Document ob_refcnt, ob_type, ob_size

In `typeobj.rst`, instead of `:c:member:` it would be better to
use `.. c:member::` with a `:no-index:` option, see:

See ref. https://www.sphinx-doc.org/en/master/usage/domains/index.html#basic-markup

However, `c:member` currently does not support `:no-index:`.
(cherry picked from commit 73e1207a4e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-08 08:03:03 +02:00
Miss Islington (bot)
e1e9d95352
[3.14] gh-136032: Fix argparse.BooleanOptionalAction doc (GH-136133) (#136329)
gh-136032: Fix `argparse.BooleanOptionalAction` doc (GH-136133)
(cherry picked from commit 1953713d0d)

Co-authored-by: W. H. Wang <mattwang44@gmail.com>
2025-07-07 19:34:18 -07:00
Miss Islington (bot)
c72699086f
[3.14] gh-135906: Use _PyObject_CAST in internal headers (GH-135892) (GH-136392)
gh-135906: Use `_PyObject_CAST` in internal headers (GH-135892)

Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build.

---------
(cherry picked from commit fe187fae8d)

Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-07 17:21:28 +00:00
Miss Islington (bot)
5a7d266fcb
[3.14] gh-101100: Fix Sphinx warnings in library/email.compat32-message.rst (GH-136323) (#136389)
Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-07-07 19:50:56 +03:00
Miss Islington (bot)
e25531331b
[3.14] gh-87790: support thousands separators for formatting fractional part of Decimal (GH-132202) (#136365)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-07 19:24:30 +03:00
Miss Islington (bot)
442b781cfc
[3.14] gh-87790: support thousands separators for formatting fractional part of Fraction (GH-132204) (#136364)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-07-07 19:24:24 +03:00
Miss Islington (bot)
d9c36a7aa6
[3.14] gh-124486: Fix test_whichdb_ndbm in test_dbm on NetBSD (GH-136335) (GH-136378)
On NetBSD, ndbm.open() does not fail for empty file.
(cherry picked from commit b7aa2a4b4d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-07 12:57:37 +00:00
Miss Islington (bot)
a7dd48acba
[3.14] gh-86682: Add versionadded for sys._getframemodulename (GH-136325) (#136375)
gh-86682: Add versionadded for sys._getframemodulename (GH-136325)

add versionadded for sys._getframemodulename
(cherry picked from commit 11f074b243)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2025-07-07 11:27:54 +00:00
Miss Islington (bot)
236498c845
[3.14] gh-131591: Document Py_REMOTE_DEBUG (GH-135929) (GH-136374)
gh-131591: Document Py_REMOTE_DEBUG (GH-135929)
(cherry picked from commit 9aac5a3d44)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-07 13:07:23 +02:00
Miss Islington (bot)
5df4f353ad
[3.14] gh-135755: Document __future__.* and CO_* as proper Sphinx objects (GH-135980) (GH-136370)
* Turn the __future__ table to list-table.
  This'll make it easier to add entries that need longer markup
* Semantic markup for __future__ feature descriptions.
* Document CO_* C macros.

(cherry picked from commit 2468aafe98)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-07 12:55:20 +02:00
Miss Islington (bot)
f02be2dfe8
[3.14] gh-101100: Fix sphinx warnings in whatsnew/3.9 (GH-136163) (#136372)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-07 10:48:04 +00:00
Miss Islington (bot)
f87578f831
[3.14] gh-130662: Accept leading zeros in precision/width for Decimal's formatting (GH-132549) (#136362)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-07 09:55:35 +00:00
Miss Islington (bot)
b2a2f032dc
[3.14] gh-130662: Accept leading zeros in precision/width for Fraction's formatting (GH-130663) (#136361)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-07 09:50:02 +00:00
Miss Islington (bot)
57d6db529b
[3.14] gh-136289: Fix test_sqlite3 on platforms with strict UTF-8 filesystem (GH-136326) (GH-136350)
(cherry picked from commit 85b817da94)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-07 12:43:44 +03:00
Miss Islington (bot)
41d1683e05
[3.14] GH-133932: Tagged ints are heap safe (GH-134244) (#134494)
Co-authored-by: Mark Shannon <mark@hotpy.org>
2025-07-07 12:33:55 +03:00
Miss Islington (bot)
46a7981f45
[3.14] GH-135106: Restrict trashcan to GC'ed objects (GH-135682) (#135876)
Co-authored-by: Mark Shannon <mark@hotpy.org>
2025-07-07 12:31:18 +03:00
Miss Islington (bot)
8f06a9c9ce
[3.14] gh-94503: Update logging cookbook with an example of uniformly handling newlines in output. (GH-136217) (GH-136357)
(cherry picked from commit d05423a90c)
2025-07-07 10:18:27 +01:00
Miss Islington (bot)
aa1800b755
[3.14] gh-127502: Remove XML vulnerability table (GH-135294) (#136359)
gh-127502: Remove XML vulnerability table (GH-135294)

* Remove the table
* Replace warnings with notes

Latest releases of Python 3.9-3.15 include expat 2.7.1 which is not vulnerable.

expat 2.6.0 was released in February 2024.
(cherry picked from commit cb99d99277)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-07 09:08:41 +00:00
Miss Islington (bot)
22fad16ebc
[3.14] gh-109700: fix interpreter finalization while handling memory error (GH-136342) (#136352)
gh-109700: fix interpreter finalization while handling memory error (GH-136342)
(cherry picked from commit 0c3e3da195)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-07 07:40:13 +00:00
Jelle Zijlstra
3d01565da4
[3.14] gh-136316: Make typing.evaluate_forward_ref better at evaluating nested forwardrefs (GH-136319) (#136346)
(cherry picked from commit 9312702d2e)
2025-07-07 00:10:57 +00:00
Miss Islington (bot)
bd97cb8229
[3.14] gh-109070: Document that get_context in multiprocessing have side effect (GH-136341) (GH-136343)
gh-109070: Document that get_context in multiprocessing have side effect (GH-136341)

Document that get_context in multiprocessing have side effect
(cherry picked from commit 77a8bd29da)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-07-06 18:32:03 +00:00
Miss Islington (bot)
5b65df7925
[3.14] gh-109700: fix memory error handling in PyDict_SetDefault (GH-136338) (#136340)
gh-109700: fix memory error handling in `PyDict_SetDefault` (GH-136338)
(cherry picked from commit d22e073d2b)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-06 15:43:16 +00:00
Miss Islington (bot)
3ea7276a8e
[3.14] gh-129824: fix data races in subinterpreters under TSAN (GH-135794) (#136266)
gh-129824: fix data races in subinterpreters under TSAN (GH-135794)

This fixes the data races in typeobject.c in subinterpreters under free-threading. The type flags and slots are only modified in the main interpreter as all static types are first initialised in main interpreter.
(cherry picked from commit b582d751b4)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-06 18:53:55 +05:30
Miss Islington (bot)
d86ca7b610
[3.14] gh-136285: Improve pickle protocol testing in test_interpreters (GH-136286) (#136333)
gh-136285: Improve `pickle` protocol testing in `test_interpreters` (GH-136286)
(cherry picked from commit 06e347b846)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-06 11:13:13 +03:00
Miss Islington (bot)
2b2cf81a6c
[3.14] gh-136315: Fix skipped multithreading test in test_zstd (GH-136320) (#136322)
gh-136315: Fix skipped multithreading test in test_zstd (GH-136320)

Fix skipped test in test_zstd
(cherry picked from commit 5dac137b9f)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-07-05 11:24:19 -07:00
Miss Islington (bot)
53584d307a
[3.14] gh-101100: Fix references in http.cookiejar docs (GH-136238) (GH-136318)
gh-101100: Fix references in `http.cookiejar` docs (GH-136238)
(cherry picked from commit f0c7344a8f)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-07-05 13:35:24 +00:00
Miss Islington (bot)
c62c523e03
[3.14] gh-136297: Test all pickle protocols in test_zoneinfo_property.py (GH-136298) (#136311)
gh-136297: Test all `pickle` protocols in `test_zoneinfo_property.py` (GH-136298)
(cherry picked from commit 5de7e3f973)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-05 06:39:48 +00:00
Miss Islington (bot)
6d21cc54ff
[3.14] gh-136288: Fix error message in _testcapi/vectorcall.c (GH-136258) (GH-136294)
gh-136288: Fix error message in `_testcapi/vectorcall.c` (GH-136258)

Use the %N format specifier instead of %s and `PyType_GetName`.
(cherry picked from commit d1d5dce14f)

Co-authored-by: William S Fulton <wsf@fultondesigns.co.uk>
2025-07-04 16:18:32 +00:00
Miss Islington (bot)
1a2898a383
[3.14] Docs: Move "or" outside monospace syntax in tarfile.rst (GH-136263) (GH-136290)
Docs: Move "or" outside monospace syntax in `tarfile.rst` (GH-136263)
(cherry picked from commit ade1988094)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-07-04 14:46:57 +00:00
Miss Islington (bot)
f2f3edb8d7
[3.14] gh-135773: have pyvenv.cfg without home key anchor a venv and deduce home (GH-135831) (#136287)
gh-135773: have pyvenv.cfg without home key anchor a venv and deduce home (GH-135831)

This is still formally undefined behaviour, but we may as well
keep the *same* undefined behaviour as previous versions.

PEP 796 proposes a cleaner and more consistent replacement for 3.15+
(cherry picked from commit 93263d4314)

Co-authored-by: Richard Levasseur <rlevasseur@google.com>
2025-07-05 00:36:12 +10:00
Miss Islington (bot)
fa7e76e4dd
[3.14] gh-102555: Fix comment parsing in HTMLParser according to the HTML5 standard (GH-135664) (GH-136271)
* "--!>" now ends the comment.
* "-- >" no longer ends the comment.
* Support abnormally ended empty comments "<-->" and "<--->".

---------
(cherry picked from commit 8ac7613dc8)

Co-author: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2025-07-04 07:26:03 +00:00
Miss Islington (bot)
2449f77734
[3.14] Clarify some details regarding sys.monitoring (GH-133981) (GH-136259)
Clarify some details regarding `sys.monitoring` (GH-133981)
(cherry picked from commit b4991056f4)

Co-authored-by: Brett Cannon <brett@python.org>
2025-07-03 21:10:27 +00:00
Miss Islington (bot)
03ce4b2617
[3.14] gh-135661: Fix parsing start and end tags in HTMLParser according to the HTML5 standard (GH-135930) (GH-136255)
* Whitespaces no longer accepted between `</` and the tag name.
  E.g. `</ script>` does not end the script section.

* Vertical tabulation (`\v`) and non-ASCII whitespaces no longer recognized
  as whitespaces. The only whitespaces are `\t\n\r\f `.

* Null character (U+0000) no longer ends the tag name.

* Attributes and slashes after the tag name in end tags are now ignored,
  instead of terminating after the first `>` in quoted attribute value.
  E.g. `</script/foo=">"/>`.

* Multiple slashes and whitespaces between the last attribute and closing `>`
  are now ignored in both start and end tags. E.g. `<a foo=bar/ //>`.

* Multiple `=` between attribute name and value are no longer collapsed.
  E.g. `<a foo==bar>` produces attribute "foo" with value "=bar".

* Whitespaces between the `=` separator and attribute name or value are no
  longer ignored. E.g. `<a foo =bar>` produces two attributes "foo" and
  "=bar", both with value None; `<a foo= bar>` produces two attributes:
  "foo" with value "" and "bar" with value None.

---------
(cherry picked from commit 0243f97cba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2025-07-03 20:57:53 +00:00
Miss Islington (bot)
e39f33259e
[3.14] gh-135252: Document Zstandard integration across zipfile, shutil, and tarfile (GH-135311) (#136254)
gh-135252: Document Zstandard integration across zipfile, shutil, and tarfile (GH-135311)

Document Zstandard integration across zipfile, shutil, and tarfile
(cherry picked from commit 938a5d7e62)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-07-03 20:34:38 +00:00
Miss Islington (bot)
ea84943574
[3.14] gh-115119: Recommend upstream libmpdec in build requirements (GH-136205) (#136244)
gh-115119: Recommend upstream libmpdec in build requirements (GH-136205)
(cherry picked from commit b2e498ac26)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-03 12:50:38 +00:00
Miss Islington (bot)
4877f4343c
[3.14] gh-130664: Treat '0' fill character with align '=' as zero-padding for Fraction's (GH-131067) (GH-136241)
(cherry picked from commit c113a8e523)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-07-03 11:22:03 +00:00
Miss Islington (bot)
150262db4c
[3.14] gh-133740: Fix regression in locale.nl_langinfo(ALT_DIGITS) (GH-136237) (GH-136240)
There is no need to temporary switch locale for items ALT_DIGITS and ERA
if the nl_langinfo() result is empty (most locales).
(cherry picked from commit 5c984ae35e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-03 11:04:30 +00:00
Miss Islington (bot)
4bc9c018d1
[3.14] gh-135069: Fix exception message in encodings.idna module (GH-135071) (#136235)
gh-135069: Fix exception message in encodings.idna module (GH-135071)
(cherry picked from commit 8dc3383abe)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
2025-07-03 10:18:27 +00:00
Miss Islington (bot)
84cafc7e94
[3.14] Fix comments for heapq.siftup_max (GH-135359) (#136232)
Fix comments for `heapq.siftup_max` (GH-135359)
(cherry picked from commit 8f8bdf251a)

Co-authored-by: Alper <alperyoney@fb.com>
Co-authored-by: mpage <mpage@meta.com>
2025-07-03 10:17:10 +00:00
Miss Islington (bot)
1a4f92b9fb
[3.14] gh-135640: Adds more type checking to ElementTree (GH-135643) (GH-136225)
(cherry picked from commit e0245c789f)

Co-authored-by: Kira <kirawhoprograms@fastmail.com>
2025-07-03 08:15:01 +00:00
Miss Islington (bot)
8dcf3ed304
[3.14] gh-127705: Move Py_INCREF_MORTAL() to the internal C API (GH-136178) (#136206)
gh-127705: Move Py_INCREF_MORTAL() to the internal C API (GH-136178)

Rename Py_INCREF_MORTAL() to _Py_INCREF_MORTAL() and move it to
pycore_object.h internal header.
(cherry picked from commit fa43a1e0f8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-03 06:42:17 +00:00
Miss Islington (bot)
5216a6c547
[3.14] gh-135836: Fix IndexError in asyncio.create_connection() (GH-135875) (#136221)
gh-135836: Fix `IndexError` in `asyncio.create_connection()` (GH-135875)
(cherry picked from commit 9084b15156)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-03 04:34:30 +00:00
Miss Islington (bot)
8810ccfc60
[3.14] gh-135836: Fix IndexError in asyncio.create_connection with empty exceptions list (GH-135845) (#136167)
gh-135836: Fix `IndexError` in `asyncio.create_connection` with empty exceptions list (GH-135845)
(cherry picked from commit 0e19db653d)

Co-authored-by: heliang666s <147408835+heliang666s@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-03 09:37:18 +05:30
Miss Islington (bot)
b86d3f0d69
[3.14] gh-136135: Doc: Fix some broken links (GH-136137) (GH-136220)
gh-136135: Doc: Fix some broken links (GH-136137)
(cherry picked from commit 135ba86212)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-07-03 00:57:39 +00:00
Miss Islington (bot)
388e8c3676
[3.14] Replace capi-sig mailing list with discuss.python.org (GH-136211) (#136213)
Replace `capi-sig` mailing list with `discuss.python.org` (GH-136211)
(cherry picked from commit 7afe1adb00)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-02 20:55:08 +03:00
Sergey B Kirpichev
23a990d33a
[3.14] gh-115119: Defer removal of bundled libmpdec to 3.16 (GH-133997) (#136199)
Rename libmpdecimal -> libmpdec

see https://www.bytereef.org/mpdecimal/doc/libmpdec/index.html
(cherry picked from commit b19c9da401)
2025-07-02 14:36:15 +02:00
Miss Islington (bot)
8ba024ddf5
[3.14] gh-134280: Disable constant folding for ~ with a boolean argument (GH-134982) (GH-136185)
This moves the deprecation warning from compile time to run time.
(cherry picked from commit 86c3316183)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-02 11:28:09 +03:00
Miss Islington (bot)
3bc42942af
[3.14] GH-134273: Allow setting JIT compiler flags at build time with CFLAGS_JIT (GH-135792)
(cherry picked from commit 2b0c684e07)
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-07-01 14:34:59 -07:00
Miss Islington (bot)
5e09d1913b
[3.14] gh-87298: Add tests for find_in_strong_cache() bug in _zoneinfo (GH-24829) (GH-136181)
(cherry picked from commit 12ce16bc13)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Paul Ganssle <p.ganssle@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-01 15:20:53 +00:00
Miss Islington (bot)
f152d60b68
[3.14] gh-130396: Move PYOS_LOG2_STACK_MARGIN to internal headers (GH-135928) (#136173)
gh-130396: Move PYOS_LOG2_STACK_MARGIN to internal headers (GH-135928)

Move PYOS_LOG2_STACK_MARGIN, PYOS_STACK_MARGIN,
PYOS_STACK_MARGIN_BYTES and PYOS_STACK_MARGIN_SHIFT macros to
pycore_pythonrun.h internal header. Add underscore (_) prefix to the
names to make them private. Rename _PYOS to _PyOS.
(cherry picked from commit 28940e8e48)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-01 13:44:32 +00:00
Miss Islington (bot)
df4e87b153
[3.14] gh-136169: Update parameter name in fractions.from_float method (GH-136172) (#136174)
gh-136169: Update parameter name in fractions.from_float method (GH-136172)

Update parameter name in fractions.from_float method
(cherry picked from commit 9c0cb5beb8)

Co-authored-by: Vladyslav Lazoryk <80263725+lazorikv@users.noreply.github.com>
2025-07-01 13:31:16 +00:00
Miss Islington (bot)
665a682a90
[3.14] gh-135755: Use private names (_Py*) for header file guards new in 3.14 (GH-135921) (GH-135976)
These are private API; let's name new ones accordingly.
(cherry picked from commit 6be17baeb5)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-01 12:37:02 +02:00
Miss Islington (bot)
028901e97f
[3.14] gh-133982: Use implementation-specific open in test_fileio.OtherFileTests (GH-135364) (GH-136148)
gh-133982: Use implementation-specific `open` in `test_fileio.OtherFileTests` (GH-135364)
(cherry picked from commit 23caccf74c)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-06-30 22:23:34 +00:00
Miss Islington (bot)
ebab7c80ca
[3.14] gh-134939: Fill Out the concurrent.interpreters Docs (gh-136141)
(cherry picked from commit fc82cb91b, AKA gh-135902)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-30 17:00:33 +00:00
Miss Islington (bot)
401032a53a
[3.14] gh-63207: Update time.time documentation after GH-116822 (GH-136068) (#136138)
gh-63207: Update `time.time` documentation after GH-116822 (GH-136068)
(cherry picked from commit 486587da42)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-06-30 16:16:08 +00:00
Miss Islington (bot)
e86ac72995
[3.14] gh-85702: Catch PermissionError in zoneinfo.load_tzdata() (GH-136117) (#136128)
gh-85702: Catch PermissionError in zoneinfo.load_tzdata() (GH-136117)
(cherry picked from commit ee47670e8b)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-30 14:58:18 +00:00
Miss Islington (bot)
71bd3d0647
[3.14] gh-136122: Fix video link for math.tau documentation (GH-136129) (#136131)
Co-authored-by: sedram <54665381+sedram@users.noreply.github.com>
2025-06-30 14:49:09 +00:00
Victor Stinner
3267847759
[3.14] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136119)
gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614)

(cherry picked from commit b1056c2a44)

Co-authored-by: Xuanteng Huang <44627253+xuantengh@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-06-30 15:59:22 +02:00
Miss Islington (bot)
729b6747e9
[3.14] gh-48181: Document codecs.charmap_build (GH-135997) (#136123)
gh-48181: Document `codecs.charmap_build` (GH-135997)
(cherry picked from commit 2bdd50309f)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-06-30 15:52:46 +02:00
Miss Islington (bot)
ed7719a08d
[3.14] gh-131885: Update documented signatures for csv.{writer,reader} (GH-136085) (GH-136120)
gh-131885: Update documented signatures for `csv.{writer,reader}` (GH-136085)
(cherry picked from commit 75f40595e5)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
2025-06-30 13:38:57 +00:00
Miss Islington (bot)
130d40aa7b
[3.14] gh-132813: Fix the csv documentation for quoting and escaping (GH-133209) (#136113)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-30 07:47:29 +00:00
Miss Islington (bot)
2e6d3f0a1b
[3.14] gh-136087: Remove \r from documented os.linesep values (GH-136088) (#136111)
gh-136087: Remove `\r` from documented `os.linesep` values (GH-136088)
(cherry picked from commit 980a56843b)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-06-30 10:44:29 +03:00
Miss Islington (bot)
5e65cbbe64
[3.14] Doc: fix duplicated words (GH-136086) (#136108)
Doc: fix duplicated words (GH-136086)

---------
(cherry picked from commit 698bab5a40)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-06-29 18:45:26 -04:00
Miss Islington (bot)
eb8ed2ab85
[3.14] gh-123299: Provide replacement for removed sqlite3 attributes in What's New 3.14 (GH-125566) (#136103)
Co-authored-by: fry69 <142489379+fry69@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-29 15:40:27 +00:00
Miss Islington (bot)
231d801222
[3.14] gh-127604: Docs: Include a C stack in the faulthandler example (GH-136081) (GH-136102)
* gh-127604: Docs: Include a C stack in the `faulthandler` example (GH-136081)
(cherry picked from commit 3947847914)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-29 15:05:40 +00:00
Miss Islington (bot)
ce65956177
[3.14] gh-136053: Check error for TYPE_SLICE in marshal.c (GH-136054) (GH-136092)
Fix a possible crash when deserializing a large marshal data
(at least several GiBs) containing a slice.
(cherry picked from commit 30ba03ea8e)

Co-authored-by: Akshat Gupta <akshat.gupta24@gmail.com>
2025-06-29 07:36:04 +00:00
Miss Islington (bot)
7df3eee645
[3.14] Doc: Fix duplicate words in idlelib (GH-136089) (#136090)
Doc: Fix duplicate words in idlelib (GH-136089)
(cherry picked from commit f04d2b8819)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-06-29 07:12:50 +00:00
Pablo Galindo Salgado
c66b54f361
[3.14] gh-91048: Fix external inspection multi-threaded performance (GH-136005) (#136080)
(cherry picked from commit 5334732f9c)
2025-06-28 19:12:54 +01:00
Miss Islington (bot)
42e13b8f8a
[3.14] gh-76595: Add note on PyCapsule_Import behavior (GH-134022) (GH-136074)
gh-76595: Add note on `PyCapsule_Import` behavior (GH-134022)
(cherry picked from commit 579acf4562)

Co-authored-by: Nicolas Trangez <ikke@nicolast.be>
2025-06-28 13:08:15 +00:00
Bénédikt Tran
c9c51bd770
[3.14] gh-135571: Guard _hashlib usage in test_hashlib.py (GH-135572) (#136042)
(cherry picked from commit 065194c1a9)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
2025-06-28 10:15:39 +02:00
Bénédikt Tran
70280953d2
[3.14] gh-135755: rename undocumented HACL_CAN_COMPILE_SIMD{128,256} macros (GH-135847) (#136045)
Rename undocumented `HACL_CAN_COMPILE_SIMD{128,256}` macros
to `_Py_HACL_CAN_COMPILE_VEC{128,256}`. These macros are private.
(cherry picked from commit 1e975aee28)
2025-06-28 10:05:58 +02:00
Miss Islington (bot)
eff347ccc3
[3.14] gh-108765: fix comment about macro definitions in _stat.c post GH-108854 (GH-136027) (#136043)
gh-108765: fix comment about macro definitions in `_stat.c` post GH-108854 (GH-136027)
(cherry picked from commit 0141e7f9e6)

Co-authored-by: Lee Dogeon <dev.moreal@gmail.com>
2025-06-27 15:40:34 +00:00
Miss Islington (bot)
3bd4a49201
[3.14] gh-136028: Fix parsing month names containing "İ" (U+0130) in strptime() (GH-136029) (GH-136037)
This affects locales az_AZ, ber_DZ, ber_MA and crh_UA.
(cherry picked from commit 731f5b8ab3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-27 14:12:15 +00:00
Miss Islington (bot)
7e4637e48e
[3.14] gh-92266: Replace tabs with four spaces in Python files (GH-135983) (#136035)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-27 16:27:00 +03:00
Miss Islington (bot)
1b218680b7
[3.14] gh-78465: Fix error message for cls.__new__(cls, ...) where cls is not instantiable (GH-135981) (GH-136030)
Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
(cherry picked from commit c45f4f3ebe)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-27 12:01:48 +00:00
Miss Islington (bot)
33c83cea07
[3.14] gh-128051: Fix tests if sys.float_repr_style is 'legacy' (GH-135908) (#136025)
gh-128051: Fix tests if sys.float_repr_style is 'legacy' (GH-135908)
(cherry picked from commit f3aec60d7a)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-27 10:26:51 +00:00
Miss Islington (bot)
a168c77536
[3.14] gh-53203: Fix strptime() for %c, %x and %X formats on some locales (GH-135971) (GH-136019)
* Add detection of decimal non-ASCII alt digits.
* Add support of non-decimal alt digits on locale lzh_TW.
* Accept only numbers in correct range if alt digits are known.
* Fix bug in detecting the position of the week day name on locales byn_ER and wal_ET.
* Fix support of single-digit hour on locales ar_SA and bg_BG.
* Add support for %T, %R, %r, %C, %OC.
* Prepare code to use nl_langinfo().

(cherry picked from commit 07183ebce3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-27 08:16:31 +00:00
Miss Islington (bot)
78de34f910
[3.14] gh-135966: Modify iOS testbed to make app_packages a site directory (GH-135967) (#136012)
The iOS testbed now treats the app_packages folder as a site folder. This ensures it is
on the path, but also ensures any .pth files are processed on app startup.
(cherry picked from commit b38810bab7)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-06-27 13:30:51 +08:00
Miss Islington (bot)
10211a792e
[3.14] gh-135968: Add iOS binary stubs for strip (GH-135970) (#136014)
Adds iOS binary stubs for invoking `strip`
(cherry picked from commit 0c6c09b737)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-06-27 05:24:55 +00:00
Miss Islington (bot)
b99a417a6a
[3.14] Docs: Fix duplicate word typos (GH-135958) (GH-136007)
(cherry picked from commit 34ce1920ca)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-06-27 00:05:53 +00:00
Miss Islington (bot)
9798a8de1a
[3.14] gh-135995: Fix missing char in palmos encoding (GH-135990) (#136001)
gh-135995: Fix missing char in palmos encoding (GH-135990)

0x8b correctly encodes to ‹, but 0x9b was mistakenly marked as a control character instead of ›.
---------
(cherry picked from commit 58a42dea97)

Co-authored-by: Nathan Korth <nkorth@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-06-26 23:01:43 +00:00
Miss Islington (bot)
29cb4d670e
[3.14] IDLE: Update NEWS2x.txt with 2.7.0 release date (GH-129908) (#135999)
IDLE: Update NEWS2x.txt with 2.7.0 release date (GH-129908)
(cherry picked from commit 642e5dfc74)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-06-26 20:46:14 +00:00
Brett Cannon
4ba18128f9
[3.14] GH-133600: Backport file reorg of Tools/wasm/wasi (GH-135950)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-26 19:24:33 +00:00
Miss Islington (bot)
2045453171
[3.14] gh-129958: New syntax error in format spec applies to both f-strings and t-strings (GH-135570) (#135982)
(cherry picked from commit fb9e292919)

Co-authored-by: Dylan <dylwil3@gmail.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2025-06-26 18:40:09 +02:00
Miss Islington (bot)
8752b0815b
[3.14] gh-91555: add warning to docs about possibility of deadlock/infinite recursion (GH-135954) (GH-135988)
(cherry picked from commit a4625d597f)
2025-06-26 15:25:36 +01:00
Miss Islington (bot)
ad6c90f5ba
[3.14] gh-135110: Fix misleading generator.close() documentation (GH-135152) (GH-135985)
gh-135110: Fix misleading `generator.close()` documentation (GH-135152)

The documentation incorrectly stated that generator.close() 'raises' a
GeneratorExit exception. This was misleading because the method doesn't
raise the exception to the caller - it sends the exception internally
to the generator and returns None.
(cherry picked from commit 0d76dccc3b)

Co-authored-by: Connor Denihan <188690869+cdenihan@users.noreply.github.com>
2025-06-26 13:34:33 +00:00
Miss Islington (bot)
19740b7a7a
[3.14] gh-135965: Delete duplicate word in isolating-extensions howto (GH-135964) (#135977)
gh-135965: Delete duplicate word in isolating-extensions howto (GH-135964)

Change use use to use.
(cherry picked from commit ffb2a02f98)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-06-26 11:47:17 +00:00
Miss Islington (bot)
03711fb670
[3.14] gh-125206: Make _Py_FFI_SUPPORT_C_COMPLEX private (GH-135932) (GH-135973)
(cherry picked from commit 9193efdeab)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-26 10:13:47 +00:00
Miss Islington (bot)
a797fe180c
[3.14] gh-135755: Move PyFunction_GET_BUILTINS to the private API (GH-135938) (GH-135972)
(cherry picked from commit 10a3d43188)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-26 10:08:28 +00:00
Miss Islington (bot)
e5abdbfdba
[3.14] gh-131591: Add Py_ prefix to MAX_SCRIPT_PATH_SIZE; remove unprefixed struct tag (GH-135924) (GH-135969)
Names/macros defined in public headers should have `Py`/`_Py` prefixes.
(cherry picked from commit a1da208eec)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-26 10:23:39 +02:00
Miss Islington (bot)
3b5d82a426
[3.14] gh-135956: Remove duplicate word in _pydatetime docstring (GH-135957) (#135962)
gh-135956: Remove duplicate word in _pydatetime docstring (GH-135957)

_pydatetime.isoformat docstring repeats 'giving'.
(cherry picked from commit e3ea6f2b3b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-06-26 04:09:11 +00:00
Miss Islington (bot)
568f50e182
[3.14] Add whatsnew text for warnings module changes. (gh-135869) (gh-135961)
Add whatsnew text for warnings module changes. (gh-135869)
(cherry picked from commit 1f5e23fd70)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2025-06-26 03:09:09 +00:00
Miss Islington (bot)
c8e914cfb5
[3.14] gh-135721: skip test_trashcan_python_class on wasm buildbots with stack overflow (GH-135766) (GH-135955)
gh-135721: skip `test_trashcan_python_class` on wasm buildbots with stack overflow (GH-135766)
(cherry picked from commit 3fb6cfe7a9)

Co-authored-by: Pastukhov Nikita <diementros@yandex.ru>
2025-06-25 23:02:39 +00:00
Miss Islington (bot)
39bbf59a19
[3.14] Docs: Fix indentation in slice class of functions.rst (GH-134393) (#135948)
Docs: Fix indentation in `slice` class of `functions.rst` (GH-134393)

Paragraph should not be under `slice.step`. It applies to the whole class.

(cherry picked from commit 6227662ff3)

Co-authored-by: Rob Reynolds <13379223+reynoldsnlp@users.noreply.github.com>
2025-06-25 17:52:59 +00:00
Miss Islington (bot)
80fc62f8af
[3.14] gh-135871: Fix needless spinning in _PyMutex_LockTimed with zero timeout (gh-135872) (gh-135946)
The free threading build could spin unnecessarily on `_Py_yield()` if the initial
compare and swap failed.
(cherry picked from commit cbfaf41caf)

Co-authored-by: Joseph Tibbertsma <josephtibbertsma@gmail.com>
2025-06-25 17:07:07 +00:00
Miss Islington (bot)
df1c124240
[3.14] gh-91555: Revert disabling of logger while handling log record. (GH-135858) (GH-135910)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2025-06-25 18:03:13 +01:00
Miss Islington (bot)
6e5350d8b9
[3.14] gh-135839: Fix module_traverse and module_clear in subinterp modules (GH-135937) (#135939)
gh-135839: Fix `module_traverse` and `module_clear` in subinterp modules (GH-135937)
(cherry picked from commit bcc2cbaa7f)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-06-25 17:42:57 +03:00
Miss Islington (bot)
8ef0398238
[3.14] Docs: Add cross-reference for positional_item in the calls productionlist (GH-129977) (GH-135940)
Docs: Add cross-reference for `positional_item` in the `calls` productionlist (GH-129977)

Add missing hyperlink for `positional_item`
(cherry picked from commit d2154912b3)

Co-authored-by: HarryLHW <123lhw321@gmail.com>
2025-06-25 14:30:42 +00:00
Miss Islington (bot)
17c6818bfd
[3.14] gh-131591: Make --without-remote-debug work (GH-135925) (GH-135931)
gh-131591: Make --without-remote-debug work (GH-135925)

The feature is checked using `defined(Py_REMOTE_DEBUG)`; defining
the macro (even as `0`) enables it.
(cherry picked from commit c2f2fd4eca)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-25 12:08:27 +00:00
Petr Viktorin
a345fed896
[3.14] gh-135755: Move SPECIAL_ constants to a private header (GH-135922) (GH-135926)
Macros without a `Py`/`_Py` prefix should not be defined in public headers.
(cherry picked from commit 1b1ae82fab)
2025-06-25 13:36:46 +02:00
Miss Islington (bot)
93a31bedd9
[3.14] gh-135839: Fix module_traverse and module_clear in _interpchannelsmodule (GH-135840) (#135918)
gh-135839: Fix `module_traverse` and `module_clear` in `_interpchannelsmodule` (GH-135840)
(cherry picked from commit dd59c786cf)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-06-25 09:20:29 +00:00
Miss Islington (bot)
349f4c24f9
[3.14] gh-135755: Docs: C API: Document missing PyFunction_GET* macros (GH-135762) (GH-135916)
gh-135755: Docs: C API: Document missing `PyFunction_GET*` macros (GH-135762)

(cherry picked from commit ca87a47b3d)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-25 10:50:56 +02:00
Miss Islington (bot)
090a42b5eb
[3.14] gh-135855: Raise TypeError When Passing Non-dict Object to _interpreters.set___main___attrs (gh-135900)
(cherry picked from commit 4e6f0d116, AKA gh-135856)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-06-24 19:19:31 +00:00
Miss Islington (bot)
fa74331a4c
[3.14] gh-135805: Document the X option and env var for controlling thread-local bytecode (GH-135868) (#135897)
gh-135805: Document the X option and env var for controlling thread-local bytecode (GH-135868)

Document the X option and env var for controlling thread-local bytecode.
(cherry picked from commit fea5ccc55d)

Co-authored-by: mpage <mpage@meta.com>
2025-06-24 10:33:15 -07:00
Miss Islington (bot)
88c55528f5
[3.14] gh-135878: Fix crash in types.SimpleNamespace.__repr__ (GH-135889) (#135896)
gh-135878: Fix crash in `types.SimpleNamespace.__repr__` (GH-135889)
(cherry picked from commit b3ab94acd3)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-24 16:58:57 +00:00
Miss Islington (bot)
3cdb659a0c
[3.14] gh-135487: fix reprlib.Repr.repr_int when given very large integers (GH-135506) (#135887)
gh-135487: fix `reprlib.Repr.repr_int` when given very large integers (GH-135506)
(cherry picked from commit e5f03b94b6)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-24 12:02:02 +00:00
Miss Islington (bot)
961dd80e0e
[3.14] gh-135494: Fix python -m test --pgo -x test_re (GH-135713) (#135880)
gh-135494: Fix python -m test --pgo -x test_re (GH-135713)

Fix regrtest to support excluding tests from --pgo tests.
(cherry picked from commit 15c6d63fe6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-24 10:48:10 +00:00
Miss Islington (bot)
148f31f2d8
[3.14] gh-135648: Document that shutil.copyfileobj doesn't flush (GH-135737) (#135873)
Adds a note about flush/close on copyfileobj, and updates
the Emscripten build script to follow documented advice.
(cherry picked from commit 34393cbdd4)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-06-24 01:22:07 +00:00
Miss Islington (bot)
7227aa4bfa
[3.14] Fix example according to PEP 750 in "What's new in 3.14" (GH-134727) (GH-135870)
Fix example according to PEP 750 in "What's new in 3.14" (GH-134727)

A redundant extra part was written. Added a closing tag, to match the usage in PEP 750.
(cherry picked from commit 2793b68f75)

Co-authored-by: Vincent Poulailleau <vpoulailleau@gmail.com>
2025-06-23 23:42:04 +00:00
Miss Islington (bot)
c9cbe060a2
[3.14] Docs: Use arguments to replace args in argparse.rst (GH-135510) (GH-135866)
Docs: Use `arguments` to replace `args` in `argparse.rst` (GH-135510)
(cherry picked from commit caad163b69)

Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-06-23 22:59:24 +00:00
Miss Islington (bot)
aad47c1e0b
[3.14] Bump mypy to 1.16.1 (GH-135720) (#135848)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-06-23 13:09:24 +00:00
Miss Islington (bot)
85fbf80ca2
[3.14] gh-134986: Catch PermissionError when trying to call perf in tests (GH-134987) (#135841)
gh-134986: Catch PermissionError when trying to call perf in tests (GH-134987)

Using Ubuntu 24.04 on the Windows Subsystem for Linux, perf will raise a
`PermissionError` instead of `FileNotFoundError`. This commit modifies
the tests to catch that.
(cherry picked from commit 6ab842fce5)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-06-23 10:53:55 +00:00
Miss Islington (bot)
f0a330e5fb
[3.14] gh-89488: Add warning about Py_BuildValue("p") needing exact int (GH-135610) (GH-135843)
(cherry picked from commit 6aa0826ed7)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-23 10:41:39 +00:00
Miss Islington (bot)
a843fece61
[3.14] patchcheck: use URL paths to identify upstream remote (GH-135806) (#135808)
Co-authored-by: Kattni <kattni@kattni.com>
2025-06-23 12:56:06 +03:00
Miss Islington (bot)
10f9db9b35
[3.14] gh-135815: skip netrc security checks if os.getuid is missing (GH-135816) (#135825)
gh-135815: skip `netrc` security checks if `os.getuid` is missing (GH-135816)
(cherry picked from commit b57b619e34)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-22 20:12:57 +00:00
Miss Islington (bot)
73e2089ed1
[3.14] Docs: Remove unnecessary trailing backslashes (GH-135781) (GH-135791)
Docs: Remove unnecessary trailing backslashes (GH-135781)

This fixes Sphinx's gettext extraction for translations.
(cherry picked from commit 6a16b3c440)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-21 13:07:51 +00:00
Miss Islington (bot)
2b5c904fbb
[3.14] gh-127146: Skip test_os.test_mode for Emscripten (GH-135764) (#135784)
Temporarily skip test_os.test_mode on Emscripten; this fails consistently
on the buildbot, but not on other test configurations. Reported as GH-135783
for follow up.
(cherry picked from commit f4911258a8)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-06-21 19:13:40 +08:00
Miss Islington (bot)
e388b29a10
[3.14] gh-135557: use atomic stores in heapq operations in free-threading (GH-135601) (#135787)
gh-135557: use atomic stores in `heapq` operations in free-threading (GH-135601)
(cherry picked from commit 13cac83347)

Co-authored-by: Xuanteng Huang <44627253+xuantengh@users.noreply.github.com>
2025-06-21 16:32:27 +05:30
Miss Islington (bot)
fa62dfe888
[3.14] gh-135645: Added supports_isolated_interpreters to sys.implementation (GH-135667) (#135786)
gh-135645: Added `supports_isolated_interpreters` to `sys.implementation` (GH-135667)
(cherry picked from commit 8ca1e4d846)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-21 08:21:50 +00:00
Miss Islington (bot)
b1d5e2336e
[3.14] gh-135756: Fix nonexistent parameter in tkinter docs (GH-135770) (#135776)
gh-135756: Fix nonexistent parameter in tkinter docs (GH-135770)

Remove nonexistent color parameter from tkinter.commondialog.Dialog.show() method documentation.
(cherry picked from commit 4ddf505d99)

Co-authored-by: Marcell Perger <102254594+MarcellPerger1@users.noreply.github.com>
2025-06-20 23:35:37 +00:00
Miss Islington (bot)
35b90e8bec
[3.14] gh-135698: Fix Cross-interpreter Queue.full() With Negative/Default max_size (gh-135775)
We weren't handling non-positive maxsize values (including the default) properly
in Queue.full().  This change fixes that and adjusts an associated assert.

(cherry picked from commit c5ea8e8e8, AKA gh-135724)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-20 20:51:01 +00:00
Miss Islington (bot)
bd24261728
[3.14] Docs: Document PyExceptionClass functions in the C API (GH-135697) (GH-135757)
Docs: Document `PyExceptionClass` functions in the C API (GH-135697)

* Docs: Document `PyExceptionClass_Name`

`PyExceptionClass_Name` is an undocumented function in the limited API.

* Document `PyExceptionClass_Check`
(cherry picked from commit 59963e866a)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-06-20 14:03:46 +00:00
Miss Islington (bot)
1ee0bb81a8
[3.14] gh-89083: add links to RFC 9562 sections in UUID docs (GH-135684) (#135747)
gh-89083: add links to RFC 9562 sections in UUID docs (GH-135684)

We also sync the docs for UUIDv1 and UUIDv6 concerning the node address and clock sequence.

---------
(cherry picked from commit b881e3db1e)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-20 11:09:14 +00:00
Miss Islington (bot)
28fc24ebbc
[3.14] gh-135532: update Modules/_hacl/python_hacl_namespaces.h (GH-135741) (#135745)
gh-135532: update `Modules/_hacl/python_hacl_namespaces.h` (GH-135741)
(cherry picked from commit 57dba7c9a5)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-20 13:00:37 +02:00
Miss Islington (bot)
d057cb40ff
[3.14] gh-135532: simplify handling of HACL* errors in _hmac (GH-135740) (#135743)
gh-135532: simplify handling of HACL* errors in `_hmac` (GH-135740)
(cherry picked from commit 2dbada179f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-20 09:22:29 +00:00
Ken Jin
60fc42c169
[3.14] gh-135608: Add a null check for attribute promotion to fix a JIT crash (GH-135613) (#135739)
gh-135608: Add a null check for attribute promotion to fix a JIT crash (GH-135613)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2025-06-20 15:24:25 +08:00
Miss Islington (bot)
203753b4bb
[3.14] gh-127146: Add skip_emscripten_stack_overflow in a few places (GH-135722) (#135733)
More tests that hit stack limits on some platforms.
(cherry picked from commit c8c13f8036)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-06-19 21:54:04 +00:00
Miss Islington (bot)
0370cb42da
gh-135543: Emit sys.remote_exec audit event when sys.remote_exec is called (GH-135544)
(cherry picked from commit 1ddfe59320)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
2025-06-19 20:51:06 +00:00
Miss Islington (bot)
83e0ab17f6
[3.14] gh-135561: ensure that the GIL is held when handling an HACL* error in _hmac (GH-135562) (#135725)
gh-135561: ensure that the GIL is held when handling an HACL* error in `_hmac` (GH-135562)
(cherry picked from commit c765683398)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-19 19:48:29 +00:00
Miss Islington (bot)
8caf3fdacb
[3.14] gh-135709: Fix two compile warnings on WASM buildbot (GH-135712) (#135723)
gh-135709: Fix two compile warnings on WASM buildbot (GH-135712)
(cherry picked from commit 9c3c02019c)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-06-19 16:14:08 +00:00
Miss Islington (bot)
a170086162
[3.14] gh-135273: Unify ZoneInfo.from_file signatures (GH-135274) (#135716)
gh-135273: Unify `ZoneInfo.from_file` signatures (GH-135274)

Align `ZoneInfo.from_file` pure-Python signature with Argument Clinic signature.
(cherry picked from commit 7cc8949692)

Co-authored-by: Andrii Hrimov <andrew.hrimov@gmail.com>
2025-06-19 15:14:14 +00:00
Miss Islington (bot)
a7abb8c8e6
[3.14] Docs: Add missing lines between regex and text (GH-134505) (GH-135718)
Docs: Add missing lines between regex and text (GH-134505)
(cherry picked from commit 754190287e)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-19 15:07:12 +00:00
Miss Islington (bot)
250bb7fffd
[3.14] Docs: Emphasize parameter name in pkgutil.iter_importers (GH-135597) (GH-135710)
Docs: Emphasize parameter name in `pkgutil.iter_importers` (GH-135597)
(cherry picked from commit ff639af8ee)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-19 13:02:22 +00:00
Miss Islington (bot)
53b36e04d4
[3.14] gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (GH-135681) (#135704)
gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (GH-135681)

Use 10 ms for CLOCK_RES instead of 100 ms to tolerate slow buildbots.
(cherry picked from commit 5c25c884b9)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-19 10:06:57 +00:00
Miss Islington (bot)
aee789cf97
[3.14] Document that PyType_GetModuleByDef returns a borrowed reference (GH-135666) (GH-135701)
(cherry picked from commit 140731ff67)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-19 09:17:53 +02:00
Miss Islington (bot)
bc8ed42176
[3.14] gh-133485: Use interpreters.Interpreter in InterpreterPoolExecutor (gh-135695)
Most importantly, this resolves the issues with functions and types defined in __main__.
It also expands the number of supported objects and simplifies the implementation.

(cherry picked from commit 725da50520, AKA gh-133957)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-19 00:23:12 +00:00
Miss Islington (bot)
c03f94e7fe
[3.14] gh-135450: Remove assertion in _PyCode_CheckNoExternalState (gh-135694)
The assertion reflected a misunderstanding of situations where "hidden" variables might exist,
namely generator expressions and comprehensions.

(cherry picked from commit 15f2bac02c, AKA gh-135466)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-18 23:57:18 +00:00
Miss Islington (bot)
47ee2aedf1
gh-134538: Add link to shutil.rmtree example in function docs (GH-135540)
(cherry picked from commit e9b647dd30)

Co-authored-by: alexey semenyuk <alexsemenyuk88@gmail.com>
2025-06-18 21:16:07 +00:00
Miss Islington (bot)
a93ff87375
[3.14] gh-135641: Fix flaky test_capi.test_lock_two_threads test case (gh-135642) (gh-135687)
The mutex may have the `_Py_HAS_PARKED` bit set.
(cherry picked from commit 17ac3933c3)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-06-18 18:49:43 +00:00
Miss Islington (bot)
1734b295b3
[3.14] Docs: Fix markups for emphasis (GH-135598) (GH-135685)
Docs: Fix markups for emphasis (GH-135598)

The word emphasis character `_` is not supported as sphinx markup, so changed to `*`.
(cherry picked from commit 46c60e0d0b)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-06-18 17:39:06 +00:00
Miss Islington (bot)
3ae8a5bed3
[3.14] gh-135376: Fix and improve test_random (GH-135377) (GH-135680)
* Remove duplicated code. Tests for Random and SystemRandom now share
  the code.
* Move implementation agnostic tests that was only run for SystemRandom,
  so they are now run for Random too.
* Add tests for __index__() support.
* Add tests for randint().
(cherry picked from commit c55512311b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-18 15:51:47 +00:00
Miss Islington (bot)
bb9927005f
[3.14] gh-135676: lexical analysis: Improve section on Numeric literals (GH-134850) (GH-135677)
gh-135676: lexical analysis: Improve section on Numeric literals (GH-134850)
(cherry picked from commit 21f3d15534)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-18 14:40:28 +00:00
Miss Islington (bot)
d4daf4da7e
[3.14] gh-135646: Raise consistent NameError exceptions in ForwardRef.evaluate() (GH-135663) (#135673)
gh-135646: Raise consistent `NameError` exceptions in `ForwardRef.evaluate()` (GH-135663)
(cherry picked from commit 343719d98e)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2025-06-18 13:26:58 +00:00
Miss Islington (bot)
9ac369cb73
[3.14] gh-135335: flush stdout/stderr in forkserver after preloading modules (GH-135338) (#135670)
gh-135335: flush stdout/stderr in forkserver after preloading modules (GH-135338)

If a preloaded module writes to stdout or stderr, and the stream is buffered,
child processes will inherit the buffered data after forking. Attempt to
prevent this by flushing the streams after preload.
(cherry picked from commit 9877d191f4)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-18 12:42:18 +00:00
Miss Islington (bot)
91914fd448
[3.14] gh-135627: Remove documentation for LOAD_CONST_IMMORTAL opcode (GH-135632) (GH-135649)
gh-135627: Remove documentation for LOAD_CONST_IMMORTAL opcode (GH-135632)

Remove documentation for LOAD_CONST_IMMORTAL opcode
(cherry picked from commit 7117002591)

Co-authored-by: Vladyslav Lazoryk <80263725+lazorikv@users.noreply.github.com>
2025-06-18 15:27:26 +08:00
Miss Islington (bot)
562f6d1639
[3.14] gh-134632: Add iOS/Android test skip for C API check for headers. (GH-135656) (#135657)
iOS and Android don't ship headers in the testbed, so we can't test for their existence.
(cherry picked from commit 1c7efaf58a)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-06-18 06:48:03 +00:00
Miss Islington (bot)
52cb287bf9
[3.14] gh-127146: Enable large files on Emscripten (GH-135635) (#135655)
Large files have been fully supported by Emscripten for a long time.
(cherry picked from commit 01c80b2650)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-06-18 04:53:01 +00:00
Miss Islington (bot)
1429eefbff
[3.14] gh-119180: Only fetch globals and locals if necessary in annotationlib.get_annotations() (GH-135644) (#135654)
gh-119180: Only fetch globals and locals if necessary in `annotationlib.get_annotations()` (GH-135644)
(cherry picked from commit 504ae606e1)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2025-06-18 04:24:08 +00:00
Miss Islington (bot)
9f63a54aec
[3.14] gh-127146: Emscripten: Fix pathlib glob_dotdot test (GH-135624) (#135653)
The Emscripten path resolver uses the same mechanism for resolving `..`
at a file system root as for resolving symlinks. This is because
roots don't store their mountpoints. If the parent of a node is itself,
it is a root but it might be a mountpoint in some other file system.

If a path has enough `..`'s at the root, it will return ELOOP.
Enough turns out to be 49.
(cherry picked from commit e4ccd46bf7)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-06-18 04:19:43 +00:00
Miss Islington (bot)
a61bd7af6e
[3.14] gh-127146: Emscripten: Fix test failure due to missing os.link (GH-135626) (#135652)
Check for existence of os.link, rather than assuming it exists.
(cherry picked from commit ce58afb400)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-06-18 04:03:32 +00:00
Miss Islington (bot)
bf189d7ab5
[3.14] gh-127146: Emscripten: Skip test_url2pathname_resolve_host (GH-135634) (#135651)
Emscripten currently `gethostbyname_r()` returns an incorrect
IP address for `localhost`. Will be resolved by upstream PR:
https://github.com/emscripten-core/emscripten/pull/24593
(cherry picked from commit 2a49c54ab2)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-06-18 03:23:31 +00:00
Miss Islington (bot)
77e2ac14c6
[3.14] gh-127146: Allow ignored keys to be missing in test_sysconfig (GH-135622) (#135650)
Fixes the test on Emscripten where userbase can be missing.
(cherry picked from commit 28c71ee4b2)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-06-18 03:17:22 +00:00
Miss Islington (bot)
2c29ee835a
[3.14] gh-132775: Fix Interpreter.call() __main__ Visibility (gh-135638)
As noted in the new tests, there are a few situations we must carefully accommodate
for functions that get pickled during interp.call().  We do so by running the script
from the main interpreter's __main__ module in a hidden module in the other
interpreter.  That hidden module is used as the function __globals__.

(cherry picked from commit 269e19e0a7, AKA gh-135595)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-17 20:24:08 +00:00
Hugo van Kemenade
8ec4186b25 Post 3.14.0b3 2025-06-17 21:31:06 +03:00
Hugo van Kemenade
26d485d122 Python 3.14.0b3 2025-06-17 18:40:54 +03:00
Miss Islington (bot)
c1735c5b4e
[3.14] gh-132815: Add support for JUMP_BACKWARD in specialization stats (GH-135606) (#135612)
gh-132815: Add support for JUMP_BACKWARD in specialization stats (GH-135606)
(cherry picked from commit a9e66a7c50)

Co-authored-by: PuQing <me@puqing.work>
2025-06-17 12:38:22 +00:00
Miss Islington (bot)
91d9e9e64e
[3.14] gh-134262: Catch both URLError and ConnectionError in retries (GH-135365) (#135611)
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-06-17 12:16:17 +00:00
Emma Smith
3233cff84e
[3.14] gh-134262: increase retries in Tools/build/generate_sbom.py … (#135596) 2025-06-17 14:50:15 +03:00
Miss Islington (bot)
1bd034de9d
[3.14] gh-134632: Fix build-details.json to use INCLUDEPY path (GH-134633) (#135605)
gh-134632: Fix `build-details.json` to use `INCLUDEPY` path (GH-134633)

* gh-134632: Fix `build-details.json` to use `INCLUDEPY` path

Fix ``build-details.json`` generation to use ``INCLUDEPY``, in order to
reference the ``pythonX.Y`` subdirectory of the include directory, as
required in :pep:`739`, instead of the top-level include directory.

* test_build_details: Add tests for the c_api section

* test_build_details: Expect pkgconfig for CPython unconditionally
(cherry picked from commit 0d582def34)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
2025-06-17 08:31:10 +00:00
Miss Islington (bot)
540fa293ac
[3.14] gh-123299: Add PEP 779 to What's New in Python 3.14 (GH-135555) (#135602)
gh-123299: Add PEP 779 to What's New in Python 3.14 (GH-135555)
(cherry picked from commit c51f241c97)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-17 09:10:24 +03:00
Miss Islington (bot)
d2292c29f7
[3.14] gh-135489: Show verbose output for failing tests during PGO profiling step with --enable-optimizations (#135599)
(cherry picked from commit 5b3a826888)

Co-authored-by: PuQing <me@puqing.work>
2025-06-17 01:37:39 -04:00
Miss Islington (bot)
2b1c0a76dc
[3.14] gh-135443: Sometimes Fall Back to __main__.__dict__ For Globals (gh-135593)
For several builtin functions, we now fall back to __main__.__dict__ for the globals
when there is no current frame and _PyInterpreterState_IsRunningMain() returns
true.  This allows those functions to be run with Interpreter.call().

The affected builtins:

* exec()
* eval()
* globals()
* locals()
* vars()
* dir()

We take a similar approach with "stateless" functions, which don't use any
global variables.

(cherry picked from commit a450a0ddec, AKA gh-135491)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-16 23:59:30 +00:00
Miss Islington (bot)
7aeddeaf93
[3.14] gh-119132: Update 'Using Python on macOS' documentation. (GH-135591) (#135594)
Remove `experimental` qualification for free-threading in the document text. Note that images included in the document will be updated later in the release cycle.
(cherry picked from commit 7c685894cd)

Co-authored-by: Ned Deily <nad@python.org>
2025-06-16 19:43:24 -04:00
Miss Islington (bot)
d62b73a9d8
[3.14] gh-128627: Emscripten: Add missing semicolon in ios detection code (GH-135590) (#135592)
(cherry picked from commit 68b7e1a667)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-06-16 23:41:46 +00:00
Miss Islington (bot)
a2c4791d99
[3.14] Use replacements to update versions in "Using Python on macOS" (GH-130400) (#135586)
(cherry picked from commit 21bac3aecd)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-16 18:15:15 -04:00
Miss Islington (bot)
964c29d281
[3.14] gh-116738: Make _heapq module thread-safe (GH-135036) (gh-135309)
Use critical sections to make heapq methods that update the heap thread-safe when the GIL is disabled.
(cherry picked from commit a58026a5e3)

Co-authored-by: Alper <alperyoney@fb.com>
Co-authored-by: mpage <mpage@meta.com>
2025-06-16 13:27:43 -04:00
Miss Islington (bot)
15f7bd4295
[3.14] gh-132617: Fix dict.update() mutation check (gh-134815) (gh-135581)
Use `ma_used` instead of `ma_keys->dk_nentries` for modification check
so that we only check if the dictionary is modified, not if new keys are
added to a different dictionary that shared the same keys object.
(cherry picked from commit d8994b0a77)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-06-16 17:19:58 +00:00
Miss Islington (bot)
027f58473c
[3.14] gh-135513: Fix unused variable warning in crossinterp.c (GH-135514) (#135577)
gh-135513: Fix unused variable warning in `crossinterp.c` (GH-135514)
(cherry picked from commit 4c15505071)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-06-16 16:37:26 +00:00
Miss Islington (bot)
0e0ad7b8ff
[3.14] gh-134160: Split extension module init from PyModule docs; emphasize multi-phase init (GH-135126) (#135470)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-16 18:01:09 +03:00
Miss Islington (bot)
941011374a
[3.14] gh-119132: Remove "experimental" tag from the CPython free-threading. (gh-135550) (gh-135565)
---------
(cherry picked from commit f079979599)

Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
2025-06-16 14:58:14 +00:00
Mikhail Efimov
2ef78a85e4
[3.14] GH-135171: Revert async generator expressions behavior (#135352) 2025-06-16 17:45:42 +03:00
Miss Islington (bot)
0eec8ddac3
[3.14] gh-120608: fix NEWS entry typo (GH-135535) (#135558)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-16 10:17:37 +00:00
Miss Islington (bot)
43bf8b30f9
[3.14] gh-127319: Disable port reuse on HTTP, XMLRPC, and logging TCP servers (GH-135405) (GH-135538)
(cherry picked from commit 2bd3895fca)
2025-06-16 08:05:26 +01:00
Miss Islington (bot)
e89c7f1fc0
[3.14] gh-111178: fix UBSan failures for RemoteUnwinderObject (GH-135539) (#135547) 2025-06-15 22:54:23 +02:00
Miss Islington (bot)
1c4f01a160
[3.14] gh-67022: Document bytes/str inconsistency in email.header.decode_header() and suggest email.headerregistry.HeaderRegistry as a sane alternative (GH-92900) (#135548)
gh-67022: Document bytes/str inconsistency in email.header.decode_header() and suggest email.headerregistry.HeaderRegistry as a sane alternative (GH-92900)

* gh-67022: Document bytes/str inconsistency in email.header.decode_header()

This function's possible return types have been surprising and error-prone
for the entirety of its Python 3.x history. It can return either:

1. `typing.List[typing.Tuple[bytes, typing.Optional[str]]]` of length >1
2. or `typing.List[typing.Tuple[str, None]]`, of length exactly 1

This means that any user of this function must be prepared to accept either
`bytes` or `str` for the first member of the 2-tuples it returns, which is a
very surprising behavior in Python 3.x, particularly given that the second
member of the tuple is supposed to represent the charset/encoding of the
first member.

This patch documents the behavior of this function, and adds test cases
to demonstrate it.

As discussed in bpo-22833, this cannot be changed in a backwards-compatible
way, and some users of this function depend precisely on the existing
behavior.

Add warnings about obsolescence of 'email.header.decode_header' and 'email.header.make_header' functions.

Recommend use of `email.headerregistry.HeaderRegistry` instead, as suggested
in https://github.com/python/cpython/pull/92900#discussion_r1112472177
(cherry picked from commit 60181f4ed0)

Co-authored-by: Dan Lenski <dlenski@gmail.com>
2025-06-15 16:02:16 -04:00
Miss Islington (bot)
7fd8857b11
[3.14] gh-135371: Clean tags from pointers in all cases in remote debugging module (GH-135534) (#135545) 2025-06-15 19:05:39 +00:00
Miss Islington (bot)
e00aef6c81
[3.14] gh-135361: update documentation for remote_debugger_script audit event (GH-135362) (#135546) 2025-06-15 18:55:24 +00:00
Miss Islington (bot)
f8f99b1cfc
[3.14] gh-135371: Fix asyncio introspection output to include internal coroutine chains (GH-135436) (#135509)
gh-135371: Fix asyncio introspection output to include internal coroutine chains (GH-135436)
(cherry picked from commit 028309fb47)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-06-15 18:38:56 +00:00
Miss Islington (bot)
6ae54553d4
[3.14] gh-65697: Improved error msg for configparser key validation (GH-135527) (#135541)
gh-65697: Improved error msg for configparser key validation (GH-135527)

* Improved error msg for configparser key validation and added note in 3.14 whatsnew

* Properly added change to configparser

* 📜🤖 Added by blurb_it.

---------
(cherry picked from commit 81237fbcf6)

Co-authored-by: Jacob Austin Lincoln <99031153+lincolnj1@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-06-15 16:38:15 +00:00
Miss Islington (bot)
ee141f0277
[3.14] gh-135171: Update documentation for the generator expression (GH-135351) (#135524)
gh-135171: Update documentation for the generator expression (GH-135351)

* gh-135171: Update documentation for the generator expression

Document that the iterator for the leftmost "for" clause is created
immediately.

* Update Doc/reference/expressions.rst



---------
(cherry picked from commit 8979d3afe3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
2025-06-15 00:38:19 +00:00
Miss Islington (bot)
c5f066ddf7
[3.14] gh-135497: fix MAXLOGNAME detection in configure.ac (GH-135508) (#135516)
gh-135497: fix `MAXLOGNAME` detection in `configure.ac` (GH-135508)
(cherry picked from commit 2e15a50851)

Co-authored-by: Caleb Xu <calebcenter@live.com>
2025-06-14 16:50:48 +00:00
Miss Islington (bot)
f346ba7a02
[3.14] gh-135504: Document LIBZSTD_CFLAGS and LIBZSTD_LIBS config options (GH-135505) (#135515) 2025-06-14 15:13:03 +00:00
Miss Islington (bot)
79df5d1c54
[3.14] gh-135368: Fix mocks on dataclass specs with instance=True (GH-135421) (#135503)
gh-135368: Fix mocks on dataclass specs with `instance=True` (GH-135421)

* gh-135368: Fix mocks on dataclass specs with `instance=True`

* Extend dataclass mock_methods

---------
(cherry picked from commit c8319a3fea)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2025-06-14 09:11:31 +00:00
Miss Islington (bot)
7499bcd530
[3.14] gh-135496: Fix f string exclamation mark error typo (GH-135495) (#135499)
gh-135496: Fix f string exclamation mark error typo (GH-135495)
(cherry picked from commit c2bb3f9843)

Co-authored-by: GiGaGon <107241144+MeGaGiGaGon@users.noreply.github.com>
2025-06-14 05:05:55 +00:00
Miss Islington (bot)
0fe5463877
[3.14] gh-132775: Clean Up Cross-Interpreter Error Handling (gh-135492)
In this refactor we:

* move some code around
* make a couple of typedefs opaque
* decouple errors from session state
* improve tracebacks for propagated exceptions

This change helps simplify several upcoming changes.

(cherry picked from commit c7f4a80079, AKA gh-135369)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-14 02:08:25 +00:00
Miss Islington (bot)
f77a911c52
[3.14] gh-135437: Account For Duplicate Names in _PyCode_SetUnboundVarCounts() (gh-135493)
(cherry picked from commit 56eabea, AKA gh-135438)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-13 23:14:00 +00:00
Miss Islington (bot)
d851f8e258
[3.14] gh-135462: Fix quadratic complexity in processing special input in HTMLParser (GH-135464) (GH-135481)
End-of-file errors are now handled according to the HTML5 specs --
comments and declarations are automatically closed, tags are ignored.
(cherry picked from commit 6eb6c5dbfb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-13 17:23:48 +00:00
Miss Islington (bot)
b573a850d6
[3.14] doc: Remove what was essentially duplicate wording. (GH-135431) (GH-135440)
(cherry picked from commit f273fd77d7)
2025-06-13 17:54:20 +01:00
Miss Islington (bot)
5912979975
gh-135455: Fix version and architecture detection in PC/layout script. (GH-135461)
(cherry picked from commit afc5ab6cce)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-06-13 16:10:29 +00:00
Miss Islington (bot)
a9db299afa
[3.14] gh-106318: Add example for str.expandtabs() (GH-134525) (#135476)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-06-13 15:50:16 +00:00
Miss Islington (bot)
46e7ed7206
[3.14] gh-135244: improve wording of uuid8 docs about CSPRNG (GH-135433) (#135467)
gh-135244: improve wording of `uuid8` docs about CSPRNG (GH-135433)
(cherry picked from commit 394d7985da)

Co-authored-by: LamentXU <108666168+LamentXU123@users.noreply.github.com>
2025-06-13 14:11:51 +00:00
Miss Islington (bot)
6754a507c5
[3.14] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) (GH-135344)
gh-132969:  Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222)

When shutdown is called with wait=False, the executor thread keeps running
even after the ProcessPoolExecutor's state is reset. The executor then tries
to replenish the worker processes pool resulting in an error and a potential hang
when it comes across a worker that has died. Fixed the issue by having
_adjust_process_count() return without doing anything if the ProcessPoolExecutor's
state has been reset.

Added unit tests to validate two scenarios:
max_workers < num_tasks (exception)
max_workers > num_tasks (exception + hang)
(cherry picked from commit 598aa7cc98)

Co-authored-by: Ajay Kamdar <140011370+ogbiggles@users.noreply.github.com>
2025-06-13 15:49:54 +02:00
Miss Islington (bot)
8a78ee6d8d
[3.14] gh-106318: Add example for str.endswith() (GH-134523) (#135459)
gh-106318: Add example for `str.endswith()` (GH-134523)
(cherry picked from commit eed827ed09)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-13 15:14:21 +03:00
Miss Islington (bot)
f22aae1908
[3.14] gh-106318: Add example for str.encode() (GH-134520) (#135457)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-13 14:46:06 +03:00
Miss Islington (bot)
b3efd3d7d3
[3.14] Revert "gh-135410: use a critical section around StringIO.__next__ (GH-135412)" (GH-135439) (gh-135449)
Revert "gh-135410: use a critical section around `StringIO.__next__` (GH-135412)" (GH-135439)

This reverts commit e6c3039cb3.
(cherry picked from commit 73431356d3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-12 22:58:58 +00:00
Miss Islington (bot)
f885c7d9b9
[3.14] gh-135429: Fix the argument mismatch in lsprof throw event (GH-135442) (#135446)
gh-135429: Fix the argument mismatch in lsprof throw event (GH-135442)
(cherry picked from commit b03309fe5f)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-06-12 22:13:36 +00:00
Eric Snow
04273adae0
[3.14] gh-134939: Add the concurrent.interpreters Module (gh-135414)
PEP-734 has been accepted (for 3.14).

(FTR, I'm opposed to putting this under the concurrent package, but
doing so is the SC condition under which the module can land in 3.14.)

(cherry picked from commit 62143736b, AKA gh-133958)
2025-06-12 08:19:26 -06:00
Miss Islington (bot)
8cb7d9a810
[3.14] gh-135410: use a critical section around StringIO.__next__ (GH-135412) (#135425)
gh-135410: use a critical section around `StringIO.__next__` (GH-135412)
(cherry picked from commit e6c3039cb3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-12 11:36:44 +00:00
Miss Islington (bot)
e76dbc87a2
[3.14] gh-128627: Fix iPad detection in wasm-gc (GH-135388) (#135419)
On some iPad versions, Safari reports as "macOS". Modifies the GC trampoline detection
to add a feature-based check to detect this case.
(cherry picked from commit d447129758)

Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2025-06-12 04:28:47 +00:00
Miss Islington (bot)
4a30154fd2
[3.14] Fix presentation of dataclasses' unsafe_hash default value (GH-116532) (#135416)
Fix presentation of dataclasses' `unsafe_hash` default value (GH-116532)

(cherry picked from commit 71f5fafdfb)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-06-12 01:36:17 +00:00
Miss Islington (bot)
98136ddb0e
[3.14] gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (GH-135337) (#135394)
gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (GH-135337)
(cherry picked from commit b706ff003c)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-06-11 15:29:46 +00:00
Miss Islington (bot)
0e969fe843
[3.14] gh-135321: Always raise a correct exception for BINSTRING argument > 0x7fffffff in pickle (GH-135322) (GH-135382)
(cherry picked from commit 2b8b4774d2)

Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-11 14:01:15 +03:00
Miss Islington (bot)
30494cc72c
[3.14] gh-133967: Do not normalize locale name 'C.UTF-8' to 'en_US.UTF-8' (GH-135347) (GH-135349)
(cherry picked from commit 0f866cbfef)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-11 12:43:20 +03:00
Miss Islington (bot)
9f6c3769e3
[3.14] gh-135326: Test support of __index__ in random.getrandbits() (GH-135356) (#135373)
gh-135326: Test support of __index__ in random.getrandbits() (GH-135356)
(cherry picked from commit 5ae669fc4e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-11 02:17:06 +00:00
Miss Islington (bot)
f303532857
[3.14] gh-91048: Reorder result tuple of parse_code_object (GH-134898) (#134956)
* gh-91048:  Reorder result tuple of parse_code_object (GH-134898)

Reorder result tuple of parse_code_object

The standard followed by APIs like pstat.Stats is to take a file, line,
function triplet. The parse_code_object function (and callers exposing
this in Python like RemoteUnwinder.get_stack_trace) return function,
file, line triplets which requires the caller to reorder these when
using it in classes like pstat.Stats.
(cherry picked from commit 8e8786f898)

Co-authored-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>

* Reorder asyncio

---------

Co-authored-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2025-06-11 01:33:46 +00:00
Miss Islington (bot)
77c4b5d413
[3.14] gh-130077: Properly match full soft keywords in the parser (GH-135317) (#135348)
gh-130077: Properly match full soft keywords in the parser (GH-135317)
(cherry picked from commit ff2b5f40c2)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-06-11 02:01:37 +01:00
stratakis
4b96a34978
[3.14] gh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606) (#135345)
Apply Intel Control-flow Technology for x86-64 on asm_trampoline.S.

Required for mitigation against return-oriented programming (ROP)
and Call or Jump Oriented Programming (COP/JOP) attacks.

Manual application is required for the assembly files.

See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
2025-06-10 17:41:39 +02:00
Miss Islington (bot)
081421a00e
[3.14] gh-118928: Amend sqlite3 execute*() deprecation notes (GH-135163) (#135342)
(cherry picked from commit ee7345d507)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-06-10 11:30:19 +00:00
Miss Islington (bot)
88d8a2e9f0
[3.14] Docs: fix docstring of email.message.Message.add_header (GH-134355) (#135339)
Docs: fix docstring of `email.message.Message.add_header` (GH-134355)
(cherry picked from commit c23eec2960)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
2025-06-10 11:00:25 +00:00
Miss Islington (bot)
904685f90f
[3.14] gh-133157: remove usage of _Py_NO_SANITIZE_UNDEFINED in Parser/pegen.c (GH-134048) (#135320)
gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `Parser/pegen.c` (GH-134048)
(cherry picked from commit 754e7c9b51)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-10 00:34:49 +00:00
Miss Islington (bot)
84c6fe6ac6
[3.14] Fix warnings set but not used [-Wunused-but-set-variable] in remote_debug.h (GH-135290) (#135319)
Fix warnings `set but not used [-Wunused-but-set-variable]` in remote_debug.h (GH-135290)
(cherry picked from commit 49fc1f215a)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-06-10 00:29:28 +00:00
Miss Islington (bot)
79c86b118c
[3.14] Fix definition of _Py_RemoteDebug_ symbols for static linking (GH-135146) (#135318)
Fix definition of `_Py_RemoteDebug_` symbols for static linking (GH-135146)
(cherry picked from commit 2e1ad6eb26)

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-06-10 00:28:42 +00:00
Miss Islington (bot)
e5a154786b
[3.14] Heavily comment Python/perf_jit_trampoline.c to improve maintainability (GH-134527) (#135299) 2025-06-09 22:09:48 +01:00
Miss Islington (bot)
8b35651853
[3.14] gh-127833: Reword and expand the Notation section (GH-134443) (GH-135301)
Prepare the docs for using the notation used in the `python.gram`
file. If we want to sync the two, the meta-syntax should be the same.

Link the Full Grammar docs here; keep only a few extras.

Also, remove the distinction between lexical and syntactic rules,
except for whitespace handling.
With f- and t-strings, the line between the two is blurry.
(cherry picked from commit 28d91d06f1)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Colin Marquardt <cmarqu42@gmail.com>
2025-06-09 13:56:24 +00:00
Miss Islington (bot)
725ec53032
[3.14] bpo-45210: Document that error indicator may be set in tp_dealloc (GH-28358) (#135298)
bpo-45210: Document that error indicator may be set in tp_dealloc (GH-28358)
(cherry picked from commit 8441b263af)

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Co-authored-by: Edward Z. Yang <ezyang@mit.edu>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-09 13:01:33 +00:00
Victor Stinner
3d69d18322
[3.14] gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973) (#134974)
gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)

Replace most PyUnicodeWriter_WriteUTF8() calls with
PyUnicodeWriter_WriteASCII().

(cherry picked from commit f49a07b531)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-09 14:37:26 +02:00
Miss Islington (bot)
dba307a757
[3.14] GH-135287: clang-cl PGO builds on Windows fail with could not open '/GENPROFILE' (GH-135289)
GH-135287: clang-cl PGO builds on Windows fail with `could not open '/GENPROFILE'` (GH-135289)
(cherry picked from commit 0045100ccb)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-06-09 12:18:51 +00:00
Mark Shannon
a5274cd215
[3.14] GH-135171: Fix generator expressions one last time (hopefully) (GH-135225)
* Add NULL check to FOR_ITER

* Move GET_ITER back to genexpr creation
2025-06-09 11:04:23 +01:00
Miss Islington (bot)
1497866198
[3.14] Use f-strings in csv docs example (GH-135245) (#135285)
Use f-strings in csv docs example (GH-135245)
(cherry picked from commit 2677dd017a)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2025-06-09 06:37:15 +00:00
Miss Islington (bot)
7bb999d431
[3.14] gh-135263: Fix typo in token.NAME documentation (GH-135275) (#135280)
gh-135263: Fix typo in token.NAME documentation (GH-135275)
(cherry picked from commit 8d17a412da)

Co-authored-by: Vladyslav Lazoryk <80263725+lazorikv@users.noreply.github.com>
2025-06-08 17:55:04 -04:00
Miss Islington (bot)
00f824dc5a
[3.14] gh-135276: Refresh zipfile.Path from zipp 3.23 (GH-135277) (#135278)
* gh-135276: Refresh `zipfile.Path` from zipp 3.23 (GH-135277)

Apply changes from zipp 3.23
(cherry picked from commit 8d6eb0c262)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Removed features slated for Python 3.15 only.

---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2025-06-08 20:12:25 +00:00
Miss Islington (bot)
cf2209f5b9
[3.14] Update tutorial for new "Copy" button (GH-135007) (#135270)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-06-08 16:40:07 +00:00
Miss Islington (bot)
483a462580
[3.14] gh-134976: document the exception type that can be raised by s[i] (GH-134977) (#135258)
gh-134976: document the exception type that can be raised by `s[i]` (GH-134977)
(cherry picked from commit 158e5162bf)

Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-06-08 14:37:29 +02:00
Miss Islington (bot)
949248d6db
[3.14] gh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (GH-135226) (#135255)
gh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (GH-135226)

This aligns with the recommendations of RFC 9562, Section 6.10, paragraph 3 [1].

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-6.10-3.

---------
(cherry picked from commit 1cb7163872)

Co-authored-by: LamentXU <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-08 12:13:04 +00:00
Miss Islington (bot)
85efa77e35
[3.14] gh-134151 Fix TypeError in email.utils.decode_params when sorting RFC 2231 continuations (GH-134687) (#135247)
gh-134151 Fix `TypeError` in `email.utils.decode_params` when sorting RFC 2231 continuations (GH-134687)

- Fix sorting logic in `email.utils.decode_params` to handle None values.
- Update tests for RFC 2231 continuation sorting.
(cherry picked from commit bcb6b45cb8)

Co-authored-by: Jiucheng(Oliver) <git.jiucheng@gmail.com>
2025-06-08 07:38:39 +00:00
Miss Islington (bot)
ef539654e6
[3.14] gh-134876: Add fallback for when process_vm_readv fails with ENOSYS (GH-134878) (#135240)
gh-134876: Add fallback for when process_vm_readv fails with ENOSYS (GH-134878)
(cherry picked from commit ac9c3431cc)

Co-authored-by: Daniel Golding <goldingd89@gmail.com>
2025-06-07 18:56:38 +00:00
Miss Islington (bot)
3faf00e003
[3.14] gh-134155: fix AttributeError in email._header_value_parser.get_address (GH-134194) (#135191)
gh-134155: fix AttributeError in email._header_value_parser.get_address (GH-134194)

Append the defect to defects instead of to the parse tree.
(cherry picked from commit d9cad074d5)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-06 14:13:30 -04:00
Miss Islington (bot)
88b5784fc0
[3.14] Docs: Update PyExc_* tables in the c-api documentation (GH-131640) (GH-135220)
Docs: Update `PyExc_*` tables in the c-api documentation (GH-131640)

Add `PyExc_BaseExceptionGroup` and `PyExc_EncodingWarning`
(cherry picked from commit f00512db20)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-06-06 15:57:37 +00:00
Miss Islington (bot)
dd4a819a82
[3.14] gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174) (GH-135213)
gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174)
(cherry picked from commit 1adca08d65)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2025-06-06 17:08:45 +02:00
Miss Islington (bot)
f32c7b9100
[3.14] gh-57089: Note _layout_ in the bitfield docs (GH-134148) (GH-135216)
(cherry picked from commit b22b964a5c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Meador Inge <meadori@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-06-06 14:58:48 +00:00
Miss Islington (bot)
23552b3d8f
[3.14] feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181) (#135212)
feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181)

Giving the right example incitates the tutorial readers to do the same in the future.
(cherry picked from commit 343182853f)

Co-authored-by: Jean-Louis GUENEGO <jlguenego@gmail.com>
2025-06-06 13:22:50 +00:00
Serhiy Storchaka
5b38af57e0
[3.14] gh-135120: Add test.support.subTests() (GH-135121) (GH-135208)
(cherry picked from commit 6ef06fad84)
2025-06-06 13:03:28 +00:00
Miss Islington (bot)
4e2e02eec9
[3.14] gh-134993: Add os.lstat() to os.supports_dir_fd (GH-135188) (#135205)
gh-134993: Add os.lstat() to os.supports_dir_fd (GH-135188)
(cherry picked from commit e004cf8fd5)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-06 12:38:59 +00:00
Miss Islington (bot)
daf11fca03
[3.14] Fix versionadded directive rendering in c-api/arg.rst (GH-135199) (#135207)
Fix versionadded directive rendering in c-api/arg.rst (GH-135199)
(cherry picked from commit 39859fcac5)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-06 12:30:33 +00:00
Petr Viktorin
b477e21d5c
[3.14] gh-128605: Revert "Add branch protections for x86_64 in asm_tr…ampoline.S (#128606) (#135077)" (GH-135175)
This reverts commit 899cca6dbf,
which broke buildbots.
2025-06-06 13:55:26 +02:00
Miss Islington (bot)
897b81500c
[3.14] gh-135155: Added dependencies required for compiling the _zstd module (GH-135156) (#135197)
gh-135155: Added dependencies required for compiling the _zstd module (GH-135156)
(cherry picked from commit a7d41e8aab)

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
2025-06-06 01:09:08 +00:00
mpage
be2f32e60f
[3.14] gh-134889: Fix handling of a few opcodes when optimizing LOAD_FAST (#134958) (#135187)
We were incorrectly handling a few opcodes that leave their operands on the stack. Treat all of these conservatively; assume that they always leave operands on the stack.

(cherry picked from commit 6b77af257c)
2025-06-05 13:06:51 -07:00
Miss Islington (bot)
945af60f04
[3.14] gh-135166: Fix exception type expected by test.test_zstd (GH-135167)
gh-135166: Fix exception type expected by test.test_zstd (GH-135167)
(cherry picked from commit 1b55e12766)

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
2025-06-05 18:41:51 +01:00
Miss Islington (bot)
5b39741a09
[3.14] gh-134938: Add set_pledged_input_size() to ZstdCompressor (GH-135010) (GH-135173)
(cherry picked from commit 4b44b3409a)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-06-05 14:51:11 +00:00
Miss Islington (bot)
97822b8199
[3.14] gh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys=True (GH-132200) (GH-135060)
(cherry picked from commit ec12559eba)

Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
2025-06-05 14:38:09 +00:00
Miss Islington (bot)
e11d4a18e1
[3.14] gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) (#135178)
gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165)

Fix Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE macros in the
limited C API 3.11 and older:
Don't treat Py_None, Py_True and Py_False as immortal.
(cherry picked from commit 9258f3da91)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-05 15:35:54 +02:00
Miss Islington (bot)
285c69ea38
[3.14] gh-135124: Change stdout errors in regrtest worker process (GH-135138) (#135168)
gh-135124: Change stdout errors in regrtest worker process (GH-135138)

Set sys.stdout encoder error handler to backslashreplace in regrtest
workers to avoid UnicodeEncodeError when printing a traceback
or any other non-encodable character.

Move the code from the Regrtest class to setup_process().

Call setup_process() earlier, before displaying regrtest headers.
(cherry picked from commit 3d396ab759)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-05 09:42:38 +00:00
Miss Islington (bot)
07921d4169
[3.14] gh-131531: android.py enhancements to support cibuildwheel (GH-132870) (#135158)
Modifies the environment handling and execution arguments of the Android management
script to support the compilation of third-party binaries, and the use of the testbed to
invoke third-party test code.
(cherry picked from commit 2e1544fd2b)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-06-05 14:24:52 +08:00
Miss Islington (bot)
169cdfefce
[3.14] gh-135144: Add _remote_debugging to the MSI (legacy) Windows installers. (GH-135145) (#135150)
(cherry picked from commit e598eecf4c)

Co-authored-by: T. Wouters <thomas@python.org>
2025-06-04 20:08:52 +00:00
Miss Islington (bot)
02bcd1b142
[3.14] gh-129876: Update IDLE News3.txt to May 2025 (GH-135139) (#135140)
gh-129876: Update IDLE News3.txt to May 2025 (GH-135139)
(cherry picked from commit 0df15d0d4d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-06-04 15:52:53 +00:00
Miss Islington (bot)
da1bbce4ce
[3.14] gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021) (#135133)
gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021)
(cherry picked from commit c21113072c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-04 13:33:20 +00:00
Miss Islington (bot)
3b01be24e7
[3.14] gh-126483: disable warnings filters mutation in concurrent test (GH-132694) (GH-135131)
The `test_ssl_in_multiple_threads` test failed because `test_check_hostname_idn()`
modified the global warnings filters via `warnings_helper.check_no_resource_warning()`.
Only check for warnings when the context aware warnings feature is enabled, which makes
the warnings filter context-local and thread-safe.
(cherry picked from commit 40c8be0008)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-06-04 13:25:47 +00:00
Miss Islington (bot)
5008317dcd
[3.14] gh-135074: Fix exception messages in test.support module (GH-135076) (GH-135129)
(cherry picked from commit bc00ce941e)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
2025-06-04 13:25:15 +00:00
Miss Islington (bot)
afe244d694
[3.14] gh-135108: Fix utmp.h inclusion in posixmodule.c on NetBSD (GH-135109) (GH-135127)
(cherry picked from commit 5b3865418c)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-06-04 13:16:39 +00:00
Miss Islington (bot)
b2b9aaa93d
[3.14] gh-135099: Only wait on _PyOS_SigintEvent() in main thread (GH-135100) (GH-135116)
On Windows, the `_PyOS_SigintEvent()` event handle is used to interrupt
the main thread when Ctrl-C is pressed. Previously, we also waited on
the event from other threads, but ignored the result. However, this can
race with interpreter shutdown because the main thread closes the handle
in `_PySignal_Fini` and threads may still be running and using mutexes
during interpreter shtudown.

Only use `_PyOS_SigintEvent()` in the main thread in parking_lot.c, like
we do in other places in the CPython codebase.
(cherry picked from commit cc581f32bf)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-06-04 08:44:35 -04:00
Miss Islington (bot)
f5b438517d
[3.14] Use a more clear example for the PEP 758 what's new section (GH-135118) (#135119)
Use a more clear example for the PEP 758 what's new section (GH-135118)
(cherry picked from commit 1f51510444)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-06-04 09:28:59 +00:00
Miss Islington (bot)
5b3983b1a3
[3.14] gh-135101: When choosing the default simulator device, don't use simctl --set testing (GH-135102) (#135113)
On a fresh Xcode install (including some CI provider configurations), there is
no pre-existing testing set that can be used to identify simulator models. Use
the default device set to detect available models instead. Live testing
simulators are still created in the testing set.
(cherry picked from commit dba9de731b)

Co-authored-by: Joe Rickerby <joerick@mac.com>
2025-06-04 00:57:45 +00:00
Miss Islington (bot)
d8c2bfac1f
[3.14] gh-127081: use getlogin_r if available (gh-132751) (gh-135097)
The `getlogin` function is not thread-safe: replace with `getlogin_r` where
available.
(cherry picked from commit 1ffe913c20)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-06-03 14:41:47 -04:00
Miss Islington (bot)
81999f157f
[3.14] gh-134248 test_getallocatedblocks pre-check to ignore immortalized strings (GH-134871) (#135095)
gh-134248 test_getallocatedblocks pre-check to ignore immortalized strings (GH-134871)

When sanity checking against gettotalrefcount(), we exclude the blocks for
immortalized strings since their references are not tracked/reported. This
now matches refleak.py's book-keeping using the same functions.
(cherry picked from commit 54ca55978e)

Co-authored-by: tpburns <trevorpburns@gmail.com>
2025-06-03 16:26:32 +00:00
stratakis
899cca6dbf
[3.14] gh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606) (#135077)
Apply Intel Control-flow Technology for x86-64 on asm_trampoline.S.

Required for mitigation against return-oriented programming (ROP)
and Call or Jump Oriented Programming (COP/JOP) attacks.

Manual application is required for the assembly files.

See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
2025-06-03 15:31:06 +02:00
Miss Islington (bot)
89df01bd27
[3.14] gh-135028: Increase parser MAXSTACK for nested parenthesis (GH-135031) (#135059)
gh-135028: Increase parser MAXSTACK for nested parenthesis (GH-135031)
(cherry picked from commit 6e80f11eb5)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-03 12:23:06 +00:00
Łukasz Langa
9e0ac76d96
[3.14] gh-135034: Normalize link targets in tarfile, add os.path.realpath(strict='allow_missing') (gh-135037) (gh-135065)
Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.

(cherry picked from commit 3612d8f517)

Signed-off-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-03 14:05:00 +02:00
Miss Islington (bot)
78fd7ce3d2
[3.14] gh-134875: Fix mimallc build error for the old compilers (gh-134994) (gh-135053)
gh-134875: Fix mimallc build error for the old compilers (gh-134994)
(cherry picked from commit b525e31b7f)

Co-authored-by: Donghee Na <donghee.na@python.org>
2025-06-03 17:03:36 +09:00
Miss Islington (bot)
d420d82c63
[3.14] gh-134830: Fix reference in Doc/extending/windows.rst (GH-134831) (GH-135058)
(cherry picked from commit 0ac9e17fb4)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2025-06-03 06:33:04 +00:00
Miss Islington (bot)
94306f73f0
[3.14] gh-132813: Improve error messages for incorrect types and values of csv.Dialog attributes (GH-133241) (GH-135050)
Make them similar to PyArg_Parse error messages, mention None as
a possible value, show a wrong type and the string length.
(cherry picked from commit df98a47a61)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-02 21:01:18 +00:00
Miss Islington (bot)
9bbb0c5df8
[3.14] gh-133454: Mark test_queue tests with many threads as bigmem (gh-134575) (GH-135046)
50 producer and 50 consumer threads need more than 5GB of memory.
(cherry picked from commit 7a79f52d83)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-02 20:50:43 +00:00
Miss Islington (bot)
bf0d4127b0
[3.14] gh-74232: Add a note about roundtrip of non-float numerics in CSV (GH-134963) (GH-135048)
(cherry picked from commit e814f43f2c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-02 20:43:45 +00:00
Miss Islington (bot)
428b0ca114
[3.14] gh-134908: Protect textiowrapper_iternext with critical section (gh-134910) (gh-135039)
The `textiowrapper_iternext` function called `_textiowrapper_writeflush`, but did not
use a critical section, making it racy in free-threaded builds.
(cherry picked from commit 44fb7c361c)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-06-02 19:16:54 +00:00
Miss Islington (bot)
7ac461883d
[3.14] Remove newline in Doc/c-api/lifecycle.rst for gettext builder (GH-135013) (GH-135038)
(cherry picked from commit c7051a3669)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-02 18:19:54 +00:00
Miss Islington (bot)
7775d93e2d
[3.14] gh-130999: Avoid exiting the new REPL when there are non-string candidates for suggestions (gh-131001) (gh-135019)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-06-02 16:58:03 +02:00
Bénédikt Tran
0947773528
[3.14] gh-122153: indicate that Windows does not support socket.{send,recv}_fds (GH-134960) (#135018)
This amends commit e3b6ff19aa.
(cherry picked from commit 128195e12e)

Co-authored-by: GalaxySnail <me@glxys.nl>
2025-06-02 10:44:30 +00:00
Miss Islington (bot)
16d5bdd6e5
[3.14] gh-134449: fix grammar for precision_with_grouping in format description (GH-134608) (#135015)
gh-134449: fix grammar for `precision_with_grouping` in format description (GH-134608)

This amends commit f39a07be47.
(cherry picked from commit 7828d52680)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-06-02 09:51:45 +00:00
Miss Islington (bot)
035c4d6238
[3.14] gh-132983: Minor fixes and clean up for the _zstd module (GH-134930) (GH-134998)
(cherry picked from commit b595237166)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-01 08:46:51 +00:00
Bénédikt Tran
777fd4979c
[3.14] gh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures (GH-134713) (#134961)
OpenSSL and HACL*-based hash functions constructors now support both `data` and `string` parameters.
Previously these constructor functions inconsistently supported sometimes `data` and sometimes `string`,
while the documentation expected `data` to be given in all cases.

(cherry picked from commit c6e63d9d35)
(cherry picked from commit 379d0bc956)
2025-06-01 10:26:56 +02:00
Miss Islington (bot)
5d07d16d45
[3.14] gh-133503: clarify compileall -s/-p docs (GH-134756) (#134997)
gh-133503: clarify `compileall -s/-p` docs (GH-134756)
(cherry picked from commit fe6f8a3619)

Co-authored-by: Rihaan Meher <meherrihaan@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-01 08:24:41 +00:00
Miss Islington (bot)
df7247a380
[3.14] gh-134970: Fix exception message in argparse module (GH-134971) (GH-134991)
Fix the "unknown action" exception in argparse.ArgumentParser.add_argument_group()
to correctly replace the action class.
(cherry picked from commit 965c480566)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
2025-06-01 06:21:34 +00:00
Miss Islington (bot)
7c1dfd9c98
[3.14] gh-133489: Remove size restrictions on getrandbits() and randbytes() (GH-133658) (#134964)
gh-133489: Remove size restrictions on getrandbits() and randbytes() (GH-133658)

random.getrandbits() can now generate more that 2**31 bits.
random.randbytes() can now generate more that 256 MiB.
(cherry picked from commit 68784fed78)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-31 20:02:38 -07:00
Miss Islington (bot)
a8708f7320
[3.14] gh-133891: Add missing error check to SET_COUNT macro in _testinternalcapi.c (GH-133892) (#134988)
gh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c` (GH-133892)
(cherry picked from commit cebae977a6)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-31 21:57:52 +00:00
Miss Islington (bot)
890607fa05
[3.14] gh-134835: Remove outdated list from howto/urllib2.rst (GH-134844) (#134984)
gh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844)

🫖
(cherry picked from commit 3704171415)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-31 17:55:48 +00:00
Miss Islington (bot)
f734531bbe
[3.14] gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775) (#134932)
gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775)

(cherry picked from commit eb145fabbd)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-31 18:41:07 +01:00
Miss Islington (bot)
d6f356e1ab
[3.14] gh-134954: Hard-cap max file descriptors in subprocess test fd_status (GH-134955) (#134980)
gh-134954: Hard-cap max file descriptors in subprocess test fd_status (GH-134955)

* Hard-cap max file descriptors in subprocess test fd_status

On some systems, `SC_OPEN_MAX` may return a very large value (i.e. 10**30), leading to the subprocess test timing out (or run forever).
Prevent this situation by applying a hard cap on how many file descriptors are checked.

* Fix typo in usage docstring

s/fd_stats/fd_status/
(cherry picked from commit f58873e4b2)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2025-05-31 14:55:03 +00:00
Miss Islington (bot)
0df99207b3
[3.14] Improve format of InternalDocs/exception_handling.md (GH-134969) (#134975)
Improve format of `InternalDocs/exception_handling.md` (GH-134969)
(cherry picked from commit 5507eff19c)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-31 12:02:20 +00:00
Miss Islington (bot)
aceb5041d2
[3.14] gh-134918: Fix and improve doctest's documentation (GH-134919) (GH-134966)
(cherry picked from commit 3c66e59766)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-31 09:09:00 +00:00
Miss Islington (bot)
2912fcc2e4
[3.14] GH-106235: Clarify parse_known_args documentation by removing "remaining" (GH-126921) (#134913)
GH-106235: Clarify `parse_known_args` documentation by removing "remaining" (GH-126921)
(cherry picked from commit a4251411a9)

Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
2025-05-30 13:24:08 -07:00
Miss Islington (bot)
32574d4bc0
gh-134923: Use /GENPROFILE and /USEPROFILE for Windows PGO builds (GH-134924)
(cherry picked from commit 8865b4f95b)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-30 19:04:47 +00:00
Miss Islington (bot)
d45d053267
[3.14] gh-132775: Expand the Capability of Interpreter.call() (gh-134933)
It now supports most callables, full args, and return values.

(cherry picked from commit 52deabe, AKA gh-133484)

Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
2025-05-30 18:28:35 +00:00
Gregory P. Smith
69536093de
[3.14] .gitignore personal Claude Code configs (GH-134942) (#134944)
.gitignore personal Claude Code configs (GH-134942)

https://docs.anthropic.com/en/docs/claude-code/memory

backports 98a5b830d2
2025-05-30 18:26:24 +00:00
Miss Islington (bot)
41fe324d8b
[3.14] gh-134733: Fix documentation for the show_empty option of ast.dump() (GH-134925) (GH-134940)
Optional None values are always omitted.
(cherry picked from commit 1a89991d23)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-30 19:30:13 +03:00
Miss Islington (bot)
ecf11416b6
[3.14] gh-134718: Fix ast.dump() for empty non-default values (GH-134926) (GH-134931)
(cherry picked from commit cc344e8dd0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-30 18:24:59 +03:00
Miss Islington (bot)
f28f9304bf
[3.14] gh-134885: zstd: Use Py_XSETREF (GH-134886) (GH-134922)
(cherry picked from commit 45c6c48afc)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-30 12:50:42 +02:00
Miss Islington (bot)
d7d3e6915f
[3.14] gh-134857: Improve error report for doctests run with unittest (GH-134858) (GH-134903)
Remove doctest module frames from tracebacks and redundant newline
character from a failure message.
(cherry picked from commit cb8a72b301)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-30 13:44:40 +03:00
Miss Islington (bot)
02712fa848
Doc: remove unnecessary section header (GH-134917)
(cherry picked from commit b367e27af9)
2025-05-30 18:13:36 +09:00
Miss Islington (bot)
e0e8f28f27
[3.14] gh-134768: Fix definition of mt_continue_should_break() (GH-134769) (#134916)
gh-134768: Fix definition of `mt_continue_should_break()` (GH-134769)

In 121ed71f4e, mt_continue_should_break
was changed to be guarded by `Py_DEBUG`, but it's used in `compress_mt_continue_lock_held`
with just `assert`, so it needs to be available when `NDEBUG` is undefined
too.

`Py_DEBUG` implies `NDEBUG` is undefined, so we can check just that.
(cherry picked from commit 2f2bee2111)


Fixes: 121ed71f4e

Co-authored-by: Sam James <sam@gentoo.org>
2025-05-30 05:08:43 +00:00
Miss Islington (bot)
370f91b946
[3.14] gh-134906: Document CompressionParameter.content_size_flag (GH-134907) (#134915)
gh-134906: Document CompressionParameter.content_size_flag (GH-134907)

* Document CompressionParameter.content_size_flag
(cherry picked from commit 5f60d0fccc)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-30 04:43:33 +00:00
Miss Islington (bot)
4927596c49
[3.14] ast docs: Fix description of ast.Constant (GH-134741) (#134911)
Contrary to the current docs, ast.Constant will never hold containers
such as frozenset or tuple; the Python parser only emits it for simple
literals.

For precision, add the exact list of types that may be contained in an
ast.Constant.
(cherry picked from commit 381020d41f)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-30 04:17:18 +00:00
Miss Islington (bot)
9c2e0febb4
[3.14] gh-132775: Fix _PyFunctIon_VerifyStateless() (gh-134901)
gh-132775: Fix _PyFunctIon_VerifyStateless() ()

The problem we're fixing here is that we were using PyDict_Size() on "defaults",
which it is actually a tuple.  We're also adding some explicit type checks.

This is a follow-up to gh-133221/gh-133528.

(cherry picked from commit dafd14146f, AKA gh-134900)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-29 20:55:42 +00:00
Miss Islington (bot)
4670dddbf6
[3.14] GH-133912: Fix PyObject_GenericSetDict to handle inline values (GH-134725) (#134859) 2025-05-29 11:19:58 -07:00
Miss Islington (bot)
2d40dd01fa
[3.14] gh-133260: Remove claim that PyUnicode_InternFromString immortalizes (GH-134213) (GH-134883)
(cherry picked from commit 4109a9c6b3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-05-29 13:43:27 +00:00
Miss Islington (bot)
da4f37596f
[3.14] gh-69011: clarify & deduplicate ctypes.create_*_buffer docs (GH-132858) (GH-134881)
This adds a warning about the possibly-missing NUL terminator, but in a way
that doesn't make it sound like a bug/wart.
(cherry picked from commit b783e1791b)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-29 13:23:19 +00:00
Miss Islington (bot)
7dc4496655
[3.14] gh-134262: Add retries to generate_sbom.py (GH-134460)
(cherry picked from commit 0c5a8b0b55)

Includes fix for off-by-one error from GH-134867
(cherry-picked from commit e64395e8eb)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-28 23:52:31 +00:00
Miss Islington (bot)
34b451532b
[3.14] gh-134262: Add retries to downloads in PCbuild\get_external.py (GH-134865)
(cherry picked from commit e9d845b41d)

Includes fix for off-by-one error from GH-134867
(cherry-picked from commit e64395e8eb)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-28 23:47:26 +00:00
Miss Islington (bot)
52bae918c3
[3.14] gh-108885: Imporove tests for doctest (GH-134832) (GH-134855)
Test the error and failure report in more detail.
(cherry picked from commit f6324bc7ee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-28 17:41:07 +00:00
Miss Islington (bot)
381144f043
[3.14] GH-134848: Use a set to store `AuditEvents.sources` (GH-134849) (#134853)
GH-134848: Use a set to store ``AuditEvents.sources`` (GH-134849)
(cherry picked from commit b265a7ddeb)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 16:37:57 +00:00
Miss Islington (bot)
4841201666
[3.14] gh-132983: Convert dict_content to take Py_buffer in `ZstdDict()` (GH-133924) (#134723)
gh-132983: Convert dict_content to take Py_buffer in ``ZstdDict()`` (GH-133924)
(cherry picked from commit f2ce4bbdfd)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 17:25:35 +01:00
Miss Islington (bot)
117bb29f6b
[3.14] gh-132983: Split `_zstd_set_c_parameters` (GH-133921) (#134838)
gh-132983: Split ``_zstd_set_c_parameters`` (GH-133921)
(cherry picked from commit 11f7a939de)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 17:25:06 +01:00
Miss Islington (bot)
072d03352c
[3.14] gh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (GH-134841) (#134851)
gh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (GH-134841)

Skip the test if the Python UTF-8 Mode is enabled and the LC_CTYPE
encoding is not UTF-8.
(cherry picked from commit 4635115c3f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-28 16:10:37 +00:00
Miss Islington (bot)
24404494fb
[3.14] gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (GH-134836) (#134845)
gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (GH-134836)
(cherry picked from commit d83576bf48)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-28 15:50:40 +00:00
Miss Islington (bot)
afb5221b3d
[3.14] gh-133711: Fix test_regrtest for PYTHONUTF8=1 (GH-134839) (#134842)
gh-133711: Fix test_regrtest for PYTHONUTF8=1 (GH-134839)

Use "backslashreplace" error handler to decode stdout and stderr.
Example:

    vstinner@WIN C:\victor\python\main\build\test_python_worker_8360\x91>
    "C:\victor\python\main\PCbuild\amd64\python_d.exe"  -m test
    --fast-ci --slow-ci --testdir
    C:\Users\vstinner\AppData\Local\Temp\tmp0t59e8da
    test_regrtest_noop1 test_regrtest_noop2 test_regrtest_noop3
    test_regrtest_noop4

Notice the "\x91" byte at the end of the first line: it's the
non-ASCII U+00E6 character encoded to the OEM cp437 code page.
(cherry picked from commit 91618278e7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-28 15:48:03 +00:00
Miss Islington (bot)
7515384974
[3.14] gh-134817: Document [Timed]RotatingFileHandler shouldRollover method (GH-134818) (GH-134823)
(cherry picked from commit 7be5916f6d)
2025-05-28 12:32:59 +00:00
Miss Islington (bot)
998cedb9bc
[3.14] gh-134160: Block multiple module initialization (GH-134773) (#134827)
gh-134160: Block multiple module initialization (GH-134773)
(cherry picked from commit 469a56470b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 07:58:49 +00:00
Miss Islington (bot)
2194729f3a
[3.14] Update outdated statement from math about C standard (GH-134621) (#134825)
Update outdated statement from `math` about C standard (GH-134621)
(cherry picked from commit 21672b694b)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-05-28 07:36:40 +00:00
Miss Islington (bot)
0aa0b9b05f
[3.14] Fix typing.TYPE_CHECKING docs to reflect PEP 649. (GH-134813) (#134822)
Fix typing.TYPE_CHECKING docs to reflect PEP 649. (GH-134813)

typing.TYPE_CHECKING should no longer steer users towards
manual or automatic stringization (and PEP 563); PEP 649
makes all that unnecessary.
(cherry picked from commit d7256ae4d7)

Co-authored-by: larryhastings <larry@hastings.org>
2025-05-27 23:15:17 -07:00
Miss Islington (bot)
3681e3a831
[3.14] gh-134679: Fix assertion failure in QSBR (gh-134811) (gh-134814)
This is the same underlying bug as gh-130519. The destructor may call
arbitrary code, changing the `tstate->qsbr pointer` and invalidating the
old `struct _qsbr_thread_state`.
(cherry picked from commit a4d37f88b6)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-05-27 20:46:02 +00:00
Chris Eibl
6c74700dd8
[3.14] gh-134774: Remove additional Py_DEBUG definition (GH-134791) 2025-05-27 20:08:41 +01:00
Miss Islington (bot)
0ea41f8464
[3.14] gh-134789: Document del s[i] operation for mutable sequences (GH-134804) (#134808)
gh-134789: Document del s[i] operation for mutable sequences (GH-134804)

[main] Update stdtypes.rst

- Added explicit mention of `del s[i]` (item deletion by index) to the Mutable Sequence Types section.
- Clarified that this operation removes the item at the specified index from the sequence.
- Addresses issue GH-134789.
(cherry picked from commit 967f361993)

Co-authored-by: Rishabh Singh <67859818+rishabh11336@users.noreply.github.com>
2025-05-27 18:53:52 +00:00
Miss Islington (bot)
cc81b63a75
[3.14] gh-132917: fix data race on last_mem in free-threading gc (GH-134692) (#134802)
gh-132917: fix data race on `last_mem` in free-threading gc  (GH-134692)
(cherry picked from commit ac539e7e0d)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-27 18:00:19 +00:00
Victor Stinner
8a6a6f39c8
[3.14] gh-134744: Fix fcntl error handling (#134748) (#134795)
gh-134744: Fix fcntl error handling (#134748)

Fix also reference leak on buffer overflow.

(cherry picked from commit 9300a596d3)
2025-05-27 16:13:20 +00:00
Miss Islington (bot)
6493395f4b
[3.14] gh-132775: Always Set __builtins__ In _PyFunction_FromXIData() (gh-134794)
This is a small follow-up to gh-133481.  There's a corner case
in the behavior of PyImport_ImportModuleAttrString(), where
it expects __builtins__ to be set if __globals__ is set.

(cherry picked from commit 9b5e80000, AKA gh-134758)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-27 16:07:44 +00:00
Miss Islington (bot)
a1b6252c88
[3.14] gh-133678: Document C API third party tools (GH-134526) (#134793)
gh-133678: Document C API third party tools (GH-134526)
(cherry picked from commit c3c88064f5)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-27 15:45:08 +00:00
Mark Shannon
00122c8b2a
[3.14] GH-128161: Remove redundant GET_ITER from list comprehension code (GH-134778) 2025-05-27 12:29:48 +01:00
Miss Islington (bot)
266b541cc6
[3.14] gh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks (GH-134777) (GH-134781)
gh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks (GH-134777)
(cherry picked from commit 8704d6b391)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2025-05-27 11:28:30 +02:00
Miss Islington (bot)
58549cfd49
[3.14] gh-134210: handle signals in _curses.window.getch (GH-134326) (#134783)
gh-134210: handle signals in `_curses.window.getch` (GH-134326)
(cherry picked from commit 51762b6cad)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-27 09:16:50 +00:00
Miss Islington (bot)
452d098c0b
[3.14] gh-134752: Improve speed of test_tokenize.StringPrefixTest.test_prefixes. (GH-134766) (#134782)
gh-134752: Improve speed of test_tokenize.StringPrefixTest.test_prefixes. (GH-134766)
(cherry picked from commit 579686d9fb)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-05-27 09:16:23 +00:00
Miss Islington (bot)
0f93b2f862
[3.14] gh-134664: document cleanup_socket parameter in asyncio.start_unix_server (GH-134750) (#134779)
gh-134664: document `cleanup_socket` parameter in `asyncio.start_unix_server` (GH-134750)
(cherry picked from commit 92ea1eb38f)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-05-27 14:04:43 +05:30
Miss Islington (bot)
b6e624a3fc
[3.14] gh-134160: Use multi-phase init in documentation examples (GH-134296) (#134753)
gh-134160: Use multi-phase init in documentation examples (GH-134296)
(cherry picked from commit 96905bdd27)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-26 21:50:18 +00:00
Eric Snow
e86efabaee
[3.14] gh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134736)
This reverts commit 7476f90af2, AKA gh-134600.

This effectively unreverts commit bbf8048c0f (gh-134515).
2025-05-26 19:41:14 +00:00
Miss Islington (bot)
74f5667bd9
[3.14] gh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, and add a test to make sure we catch this error in the future. (GH-134734) (#134739)
gh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, and add a test to make sure we catch this error in the future. (GH-134734)

* Add t-string prefixes to _all_string_prefixes, and add a test to make sure we catch this error in the future.

* Update lexical analysis docs for t-string prefixes.
(cherry picked from commit 08c78e02fa)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-05-26 15:24:24 -04:00
Miss Islington (bot)
c6cc28299e
[3.14] gh-134557: Suppress immortalization in _PyCode_GetScriptXIData under free-threading (gh134738)
Disable immortalization around Py_CompileString*().

The same approach as 332356b that fixed the refleaks in compile() and eval().

E: 09e72cf can pass test_capi, test_sys and test__interpchannels with this patch for me.

(cherry picked from commit c60f39ada6, AKA gh-134686)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2025-05-26 13:14:58 -06:00
Hugo van Kemenade
bc3d892113 Merge branch '3.14' of https://github.com/python/cpython into 3.14 2025-05-26 21:51:15 +03:00
Miss Islington (bot)
8c699015c5
[3.14] gh-134637: Fix performance regression in calling ctypes function pointer in free threading. (GH-134702) (#134742)
gh-134637: Fix performance regression in calling `ctypes` function pointer in `free threading`. (GH-134702)

Fix performance regression in calling `ctypes` function pointer in `free threading`.
(cherry picked from commit 3c0525126e)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-26 18:51:13 +00:00
Hugo van Kemenade
cde768cd63 Post 3.14.0b2 2025-05-26 21:50:01 +03:00
Miss Islington (bot)
b187e9403c
[3.14] Add CODEOWNERS and YAML to end-of-file-fixer and trailing-whitespace (GH-134730) (#134737) 2025-05-26 18:08:37 +00:00
Miss Islington (bot)
9ddc7c548d
[3.14] gh-119180: Updates to PEP 649/749 docs (GH-134640) (#134731)
gh-119180: Updates to PEP 649/749 docs (GH-134640)

- Mention (again) that `type.__annotations__` is unsafe. It is now safe
  when using only classes defined under PEP 649 semantics, but not with
  classes defined using `from __future__ import annotations`.
- Mention that annotations on instances no longer work. There was already
  an issue about this.
- Mention the general changes in the "Porting to Python 3.14" section.
- `annotationlib` was proposed by PEP-749, not PEP-649.
(cherry picked from commit 7291eaba8b)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2025-05-26 15:40:43 +00:00
Miss Islington (bot)
2a089244f0
[3.14] gh-134693: Fix [-Wmaybe-uninitialized] warning in _remote_debugging_module.c (GH-134694) (#134726)
gh-134693: Fix `[-Wmaybe-uninitialized]` warning in `_remote_debugging_module.c` (GH-134694)
(cherry picked from commit 806107d7a2)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-26 15:32:52 +00:00
Miss Islington (bot)
aded785b8c
[3.14] gh-91048: Add better error messages for remote debugging for CI builds (GH-134682) (#134719) 2025-05-26 15:04:36 +00:00
Miss Islington (bot)
01ccc824ca
[3.14] Add CODEOWNERS for remote debugging (GH-134720) (#134721) 2025-05-26 15:46:51 +01:00
Hugo van Kemenade
12d3f883ae Python 3.14.0b2 2025-05-26 16:26:47 +03:00
Miss Islington (bot)
6c917cb11c
[3.14] gh-91048: Correct Apple platform includes for iOS. (GH-134712) (#134714)
Correct Apple platform includes for iOS.
(cherry picked from commit 965662ee4a)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-05-26 13:10:37 +00:00
Miss Islington (bot)
da3d55403a
[3.14] gh-132710: add missing NEWS entry for GH-134697 (GH-134705) (#134707)
gh-132710: add missing NEWS entry for GH-134697 (GH-134705)
(cherry picked from commit 9eb84d83e0)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-26 12:46:29 +02:00
Bénédikt Tran
072f50fc12
[3.14] gh-132710: only use stable _uuid.generate_time_safe() to deduce MAC address (GH-132901) (#134697)
(cherry picked from commit 3bffada467)
2025-05-26 10:45:36 +00:00
Miss Islington (bot)
c8379c7edf
[3.14] gh-134559: Add versionadded for `object.__replace__()` (GH-134672) (#134699)
gh-134559: Add versionadded for ``object.__replace__()`` (GH-134672)
(cherry picked from commit 71290a6fbe)

Co-authored-by: tmlnv <108088921+tmlnv@users.noreply.github.com>
2025-05-26 10:29:51 +00:00
Bénédikt Tran
ed52549c37
[3.14] gh-134208: remove dead AC directives for _curses.window.{chgat,getstr,instr} (GH-134325) (#134701)
(cherry picked from commit 29e8115964)
2025-05-26 10:09:02 +00:00
Miss Islington (bot)
dc441efbd0
[3.14] gh-132493: Remove __annotations__ usage in inspect._signature_is_functionlike (GH-133415) (#133796)
gh-132493: Remove __annotations__ usage in inspect._signature_is_functionlike (GH-133415)

This check is potentially problematic because it could force evaluation of
annotations unnecessarily. This doesn't trigger for builtin objects (functions,
classes, or modules) with annotations, but it could trigger for third-party objects.

The check was not particularly useful anyway, because it succeeds if ``__annotations__``
is a dict or None, so the only thing this did was guard against objects that have an
``__annotations__`` attribute that is of some other type. That doesn't seem particularly
useful, so I just removed the check.
(cherry picked from commit cb6596c6aa)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-26 08:22:14 +00:00
Miss Islington (bot)
1ce68f6297
[3.14] gh-134152: Fix UnboundLocalError in email._header_value_parser _get_ptext_to_endchars (GH-134233) (#134678)
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2025-05-26 11:02:52 +03:00
Miss Islington (bot)
ebfd18b3f0
[3.14] gh-127833: lexical analysis: Improve section on Names (GH-131474) (#134423)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-05-26 11:00:17 +03:00
Miss Islington (bot)
16187b58bf
[3.14] gh-132876: workaround broken ldexp() on Windows 10 (GH-133135) (#134684)
gh-132876: workaround broken ldexp() on Windows 10 (GH-133135)

* gh-132876: workaround broken ldexp() on Windows 10

ldexp() fails to round subnormal results before Windows 11,
so hide their bug.
(cherry picked from commit cf8941c603)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Tim Peters <tim.peters@gmail.com>
2025-05-25 22:23:45 -05:00
Miss Islington (bot)
7216f7b59c
[3.14] gh-69605: Disable PyREPL module autocomplete fallback on regular completion (gh-134181) (gh-134680)
(cherry picked from commit 0e3bc962c6)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
2025-05-25 23:33:02 +00:00
Pablo Galindo Salgado
1822f33b1a
[3.14] gh-91048: Refactor and optimize remote debugging module (#134652) (#134673)
gh-91048: Refactor and optimize remote debugging module (#134652)

Completely refactor Modules/_remote_debugging_module.c with improved
code organization, replacing scattered reference counting and error
handling with centralized goto error paths. This cleanup improves
maintainability and reduces code duplication throughout the module while
preserving the same external API.

Implement memory page caching optimization in Python/remote_debug.h to
avoid repeated reads of the same memory regions during debugging
operations. The cache stores previously read memory pages and reuses
them for subsequent reads, significantly reducing system calls and
improving performance.

Add code object caching mechanism with a new code_object_generation
field in the interpreter state that tracks when code object caches need
invalidation. This allows efficient reuse of parsed code object metadata
and eliminates redundant processing of the same code objects across
debugging sessions.

Optimize memory operations by replacing multiple individual structure
copies with single bulk reads for the same data structures. This reduces
the number of memory operations and system calls required to gather
debugging information from the target process.

Update Makefile.pre.in to include Python/remote_debug.h in the headers
list, ensuring that changes to the remote debugging header force proper
recompilation of dependent modules and maintain build consistency across
the codebase.

Also, make the module compatible with the free threading build as an extra :)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>

(cherry picked from commit 42b25ad4d3)
2025-05-25 22:10:20 +00:00
Miss Islington (bot)
f68f05cbe3
[3.14] gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (GH-134286) (#134348)
gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (GH-134286)
(cherry picked from commit dd7f113057)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-05-25 21:16:10 +00:00
Miss Islington (bot)
f5a8bfa335
[3.14] Fix sphinx-lint warnings (default-role used). (GH-134647) (#134670)
Fix sphinx-lint warnings (default-role used). (GH-134647)
(cherry picked from commit 24a47155d2)

Co-authored-by: Julien Palard <julien@palard.fr>
2025-05-25 19:29:04 +00:00
Miss Islington (bot)
6917fbf98f
[3.14] GH-130328: Fix WindowsConsoleGetEventTests after gh-133728 (gh-134660) (gh-134666)
(cherry picked from commit 1000283694)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-25 18:43:07 +00:00
Miss Islington (bot)
9c6d2dbe26
[3.14] gh-133960: Improve typing.evaluate_forward_ref (GH-133961) (#134663)
gh-133960: Improve typing.evaluate_forward_ref (GH-133961)

As explained in GH-133960, this removes most of the behavior differences with ForwardRef.evaluate.
The remaining difference is about recursive evaluation of forwardrefs; this is practically useful
in cases where an annotation refers to a type alias that itself is string-valued.

This also improves several edge cases that were previously not handled optimally. For example,
the function now takes advantage of the partial evaluation behavior of ForwardRef.evaluate() to
evaluate more ForwardRefs in the FORWARDREF format.

This also fixes GH-133959 as a side effect, because the buggy behavior in GH-133959 derives from
evaluate_forward_ref().
(cherry picked from commit 57fef27cfc)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-25 17:52:04 +00:00
Miss Islington (bot)
8c6653428f
[3.14] annotationlib docs: note that ForwardRef.evaluate eventually defaults to empty globals (GH-134661) (#134662)
annotationlib docs: note that ForwardRef.evaluate eventually defaults to empty globals (GH-134661)
(cherry picked from commit b51b08a0a5)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-25 10:39:44 -07:00
Miss Islington (bot)
c61fd7c0f2
[3.14] gh-134582: Fix t-strings untokenize() roundtrip removing space between braces (GH-134603) (#134659)
gh-134582: Fix t-strings untokenize() roundtrip removing space between braces (GH-134603)
(cherry picked from commit 52509cc94b)

Co-authored-by: Loïc Simon <loic.pano@gmail.com>
2025-05-25 16:48:19 +00:00
Miss Islington (bot)
cbf4ccf1d0
[3.14] gh-133684: Fix get_annotations() where PEP 563 is involved (GH-133795) (#134656)
gh-133684: Fix get_annotations() where PEP 563 is involved (GH-133795)
(cherry picked from commit 3e562b3942)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-25 16:05:19 +00:00
Miss Islington (bot)
d82d445b18
[3.14] gh-133778: Fix setting __annotations__ under PEP 563 (GH-133794) (#134655)
gh-133778: Fix setting `__annotations__` under PEP 563 (GH-133794)
(cherry picked from commit 4443110c34)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-25 16:04:22 +00:00
Miss Islington (bot)
93aee568c0
[3.14] GH-130328: Speedup pasting in legacy console on Windows (gh-133728) (#134653)
(cherry picked from commit 91b48868a8)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-25 15:54:28 +02:00
Miss Islington (bot)
80d70defc2
[3.14] gh-134578: Mark more slow tests (GH-134579) (GH-134590)
(cherry picked from commit 77eade39f9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-24 15:06:54 +00:00
Bénédikt Tran
81f099375e
[3.14] gh-134168: fix http.server CLI support for IPv6 and --directory when serving over HTTPS (GH-134169) (#134630)
[3.14] gh-134168: fix `http.server` CLI support for IPv6 and `--directory` when serving over HTTPS (GH-134169)
(cherry picked from commit 2fd09b0110)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
2025-05-24 15:34:31 +02:00
Miss Islington (bot)
162e3f3511
[3.14] gh-134595: Update HOWTO to reflect change in CIBW option (GH-134598) (#134622)
Co-authored-by: Jasper Wong <111284156+3willows@users.noreply.github.com>
2025-05-24 07:21:34 +00:00
Miss Islington (bot)
00fd5440f0
[3.14] gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462) (#134619)
gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462)

Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform
Have multiprocessing.freeze_support() enable on spawn, not just win32.

---------
(cherry picked from commit 80284b5c5e)

Co-authored-by: Eddy Mulyono <eddymul@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-24 04:16:02 +00:00
Miss Islington (bot)
de9444ef94
[3.14] gh-134546: ensure remote pdb script is readable (GH-134552) (#134616)
gh-134546: ensure remote pdb script is readable (GH-134552)
(cherry picked from commit 74a9c60f3e)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2025-05-24 03:34:17 +00:00
Miss Islington (bot)
576177d4b3
[3.14] gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841) (#134610)
gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841)

GH-128840: Limit the number of parts in IPv6 address parsing
Limit length of IP address string to 39

---------
(cherry picked from commit 47f1161d3a)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-23 20:33:35 -07:00
Miss Islington (bot)
38a38243b7
[3.14] gh-132983: Make _zstd C code PEP 7 compliant (GH-134605) (#134609)
gh-132983: Make _zstd C code PEP 7 compliant (GH-134605)

Make _zstd C code PEP 7 compliant
(cherry picked from commit 973b8f69d3)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-24 02:28:40 +00:00
Miss Islington (bot)
f301af627e
[3.14] gh-132983: Slightly tweak error messages for _zstd compressor/decompressor options dict (GH-134601) (#134602)
gh-132983: Slightly tweak error messages for _zstd compressor/decompressor options dict (GH-134601)

Slightly tweak error messages for options dict
(cherry picked from commit f478331f98)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-23 22:18:08 +00:00
Eric Snow
7476f90af2
[3.14] gh-134557: Revert "[3.14] gh-132775: Use _PyCode GetScriptXIData()" (gh-134600)
This reverts commit bbf8048c0f, AKA gh-134515.

We are reverting due to refleaks on free-threaded builds.
2025-05-23 20:11:38 +00:00
Miss Islington (bot)
09a34f1f65
[3.14] gh-134381: Fix RuntimeError when starting not-yet started Thread after fork (gh-134514) (gh-134596)
(cherry picked from commit 9a2346df86)

Co-authored-by: Jiucheng(Oliver) <git.jiucheng@gmail.com>
2025-05-23 19:49:13 +00:00
Miss Islington (bot)
6e60586175
[3.14] gh-133454: Reduce the number of threads in test_racing_getbuf_and_releasebuf (GH-133458) (GH-134589)
The original reproducer only used 10 threads.
(cherry picked from commit fc0c9c2412)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-23 17:23:47 +00:00
Miss Islington (bot)
adb0794692
[3.14] Further improves Advanced installation docs for PyManager (GH-134541) (GH-134576)
Further improves Advanced installation docs for PyManager (GH-134541)
(cherry picked from commit 99a9ab1c64)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-23 10:23:06 +00:00
Miss Islington (bot)
81675941fb
[3.14] gh-133885: Use locks instead of critical sections for _zstd (gh-134289) (gh-134560)
Move from using critical sections to locks for the (de)compression methods.
Since the methods allow other threads to run, we should use a lock rather
than a critical section.
(cherry picked from commit 8dbc119719)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-23 10:00:38 +00:00
Miss Islington (bot)
896b745a7a
[3.14] gh-106318: Add example for str.count() (GH-134519) (#134574)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-05-23 09:53:16 +00:00
Miss Islington (bot)
7efe67ae35
[3.14] gh-106318: Add example for str.center() (GH-134518) (#134571)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-05-23 09:51:17 +00:00
Miss Islington (bot)
73967c4c01
[3.14] gh-134451: Converted asyncio.tools.CycleFoundException from dataclass to a regular exception type. (GH-134513) (#134564)
gh-134451: Converted `asyncio.tools.CycleFoundException` from dataclass to a regular exception type. (GH-134513)
(cherry picked from commit f9324cb3cb)

Co-authored-by: Evgeny Demchenko <v1mpire@icloud.com>
2025-05-23 05:40:56 +00:00
Miss Islington (bot)
c67eb41a3b
[3.14] gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (GH-134508) (#134561)
gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (GH-134508)
(cherry picked from commit 5804ee7b46)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-23 04:58:51 +00:00
Miss Islington (bot)
1cdbb33771
[3.14] gh-128307: Update docs for asyncio.create_task, TaskGroup.create_task, asyncio.create_task (GH-134202) (#134553)
gh-128307: Update docs for asyncio.create_task, TaskGroup.create_task, asyncio.create_task (GH-134202)
(cherry picked from commit a3d0306ca0)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-05-23 09:36:19 +05:30
Miss Islington (bot)
ee3a0efc9d
[3.14] Docs: fix link in free-threading-python.rst (GH-134548) (#134555) 2025-05-23 00:42:48 +00:00
Brett Cannon
8f4bf1538d
[3.14] GH-131769: fix detecting a pydebug build of the build Python when building for WASI (GH-133219) 2025-05-22 22:07:21 +00:00
Miss Islington (bot)
15e26eebf7
[3.14] GH-130397: remove special-casing of C stack depth for WASI (GH-134469) (GH-134547)
GH-130397: remove special-casing of C stack depth for WASI (GH-134469)

Removed special-casing for WASI when setting C stack depth limits. Since WASI has its own C stack checking this isn't a security risk.

Also disabled some tests that stopped passing. They all happened to have already been disabled under Emscripten.
(cherry picked from commit ad42dc1909)

Co-authored-by: Brett Cannon <brett@python.org>
2025-05-22 14:42:23 -07:00
Miss Islington (bot)
06a3a85f15
[3.14] Avoid __file__ in hashlib example (GH-134540) (#134549)
Avoid `__file__` in `hashlib` example (GH-134540)
(cherry picked from commit 9b292ff022)

Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
2025-05-22 21:37:52 +00:00
Miss Islington (bot)
37c2c8c9d8
[3.14] Docs: Add note to tutorial clarifying scope (GH-134534) (#134536)
Docs: Add note to tutorial clarifying scope (GH-134534)

* Add note to tutorial

* Update formatting
(cherry picked from commit 742d5b5c5d)

Co-authored-by: Kattni <kattni@kattni.com>
2025-05-22 18:32:49 +00:00
Miss Islington (bot)
7480e50217
[3.14] gh-132775: Fix Recently Introduced Warnings (gh-134532)
(cherry picked from commit ac06b534ee, AKA gh-134530)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-22 17:49:05 +00:00
Miss Islington (bot)
04e2dd6513
[3.14] gh-132775: Make _PyXI_session Opaque (gh-134522)
This is mostly a refactor to clean things up a bit, most notably the "XI namespace" code.

Making the session opaque requires adding the following internal-only functions:

* _PyXI_NewSession()
* _PyXI_FreeSession()
* _PyXI_GetMainNamespace()

(cherry picked from commit 4a4ac3ab4d, gh-134452)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-22 17:12:52 +00:00
Miss Islington (bot)
068d570be8
[3.14] gh-134322: Fix repr(threading.RLock) (GH-134389) (#134528)
gh-134322: Fix `repr(threading.RLock)` (GH-134389)

Fix the `__repr__` value of `threading.RLock` from `_thread` module, when just created.
(cherry picked from commit fade146cfb)

Co-authored-by: Duprat <yduprat@gmail.com>
2025-05-22 17:12:21 +00:00
Miss Islington (bot)
bbf8048c0f
[3.14] gh-132775: Use _PyCode GetScriptXIData() (gh-134515)
(cherry picked from commit 09e72cf091, AKA gh-134511)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-22 15:07:11 +00:00
Miss Islington (bot)
c31b25c705
[3.14] gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (GH-134468) (#134512)
gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (GH-134468)

Set the LC_CTYPE locale to the LC_TIME locale even if
nl_langinfo(ALT_DIGITS) result is ASCII. The result is a list
separated by NUL characters and the code only checks the first list
item which can be ASCII whereas following items are non-ASCII.

Fix test__locale for the uk_UA locale on RHEL 7.
(cherry picked from commit 899c7dc283)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-22 14:31:26 +00:00
Miss Islington (bot)
ced49a196f
[3.14] gh-134323: Fix the new threading.RLock.locked method (GH-134368) (#134510)
gh-134323: Fix the new `threading.RLock.locked` method (GH-134368)
(cherry picked from commit 3effede97c)

Co-authored-by: Duprat <yduprat@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-22 14:14:53 +00:00
Miss Islington (bot)
7e7391810f
[3.14] gh-134370: Added clarification on instance annotations (GH-134387) (#134509)
gh-134370: Added clarification on instance annotations (GH-134387)

Instances of classes cannot have annotations,
however sometimes they will erroneously have the
__annotations__ attribute
(cherry picked from commit bd4046f4f8)

Co-authored-by: Alex Kautz <alex@takemobi.com>
2025-05-22 13:52:37 +00:00
Miss Islington (bot)
85c8c0a003
[3.14] gh-132775: Use _PyObject_GetXIData (With Fallback) (gh-134507)
This change includes some semi-related refactoring of queues and channels.

(cherry picked from commit d0eedfa10e, gh-134440)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-22 07:21:05 -06:00
Miss Islington (bot)
59cb829eb9
[3.14] gh-134455: Fix build-details.json to use the `c_api.headers` key (GH-134456) (#134504)
Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
2025-05-22 15:26:26 +03:00
Miss Islington (bot)
db98e0bb12
[3.14] gh-71339: Use new assertion methods in tests (GH-129046) (GH-134498)
(cherry picked from commit 2602d8ae98)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-22 10:42:50 +00:00
Miss Islington (bot)
d5f7e80d44
[3.14] Consistent sentence case in docs template files (GH-134412) (#134495)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-22 12:57:42 +03:00
Miss Islington (bot)
64c265a638
[3.14] gh-131357: Add some extra tests for empty bytes and bytearray (GH-134458) (#134489)
gh-131357: Add some extra tests for empty bytes and bytearray (GH-134458)
(cherry picked from commit 7309eb60c0)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-05-22 08:34:46 +00:00
Miss Islington (bot)
9cef5c1f65
[3.14] Add notes on nogil & reinitialization to the Opt-Out section in Module Isolation HOWTO (GH-134141) (GH-134492)
Add notes on nogil & reinitialization to the Opt-Out section in Module Isolation HOWTO (GH-134141)
(cherry picked from commit 1f0a294e8c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-05-22 10:20:11 +02:00
Miss Islington (bot)
03a211290e
[3.14] gh-134309: Add `github.actor` to the GitHub Actions concurrency key (GH-134310) (#134484)
gh-134309: Add ``github.actor`` to the GitHub Actions concurrency key (GH-134310)

When inexperienced users create a PR from their default branch, all of the concurrency keys
collide as there is no namespacing. This becomes an issue at events with many new contributors,
where workflow runs are cancelled on other pull requests.
Disambiguate by adding the username of the relevant 'actor' to the concurrency key.
(cherry picked from commit 979d81a179)





Authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

Co-authored-by: Kira <coldcaption@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <sviat@redhat.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2025-05-22 04:15:06 +00:00
Miss Islington (bot)
4e9248f685
[3.14] gh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063) (#134476)
gh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063)
(cherry picked from commit f3fc0c16e0)


gh-134062: Fix hash collisions in IPv4Network and IPv6Network
gh-134062: Add hash collision regression test

Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2025-05-22 03:14:10 +00:00
Miss Islington (bot)
998991513b
[3.14] gh-127960 Fix the REPL to set the correct namespace by setting the correct __main__ module (gh-134275) (gh-134473)
The `__main__` module imported in the `_pyrepl` module points to the `_pyrepl` module itself when the interpreter was launched without `-m` option and didn't execute a module,
while it's an unexpected behavior that `__main__` can be `_pyrepl` and relative imports such as `from . import *` works based on the `_pyrepl` module.
(cherry picked from commit b1b8962443)

Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-22 03:33:35 +02:00
Miss Islington (bot)
93ab55bd70
[3.14] gh-132775: Use _PyFunction_VerifyStateless() and _PyCode_VerifyStateless() (gh-134465)
(cherry picked from commit a66bae8bb, AKA gh-134439)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-21 20:43:29 +00:00
Miss Islington (bot)
11d77d2112
[3.14] gh-132983: Fix refleak in zstd dictionary functions (gh-134463)
(cherry picked from commit fb68776591, AKA gh-134459)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-21 19:35:31 +00:00
Miss Islington (bot)
f8ced87fa3
[3.14] gh-132124: improve safety nets for creating AF_UNIX socket files (GH-134085) (#134447)
gh-132124: improve safety nets for creating AF_UNIX socket files (GH-134085)

* ensure that we can create AF_UNIX socket files
* emit a warning if system-wide temporary directory is used
(cherry picked from commit 1a07a01014)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-21 17:36:32 +00:00
Miss Islington (bot)
df6d9e7fbd
[3.14] gh-80050: Update BufferedReader.read docs around non-blocking (GH-130653) (#134444)
gh-80050: Update BufferedReader.read docs around non-blocking (GH-130653)
(cherry picked from commit e1f891414b)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-21 09:50:02 -07:00
Miss Islington (bot)
6ea83e077e
[3.14] gh-134026: Fix grammar description of for statement (GH-134034) (GH-134424)
gh-134026: Fix grammar description of for statement (GH-134034)
(cherry picked from commit 4eacf3883d)

Co-authored-by: Yash Vijay <yash_vijay@outlook.com>
2025-05-21 18:43:07 +02:00
Miss Islington (bot)
cdc92cd9fc
[3.14] gh-132983: Refactor shared code in train_dict and finalize_dict (GH-134432) (#134442)
gh-132983: Refactor shared code in train_dict and finalize_dict (GH-134432)

Refactor shared code in train_dict and finalize_dict
(cherry picked from commit c64a21454b)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-21 16:19:25 +00:00
Miss Islington (bot)
17bf6ab0c1
[3.14] gh-62184: Remove _pyio import of _io.FileIO (gh-134192) (gh-134437)
This was added in the add of `_io`, isn't used since bpo-21859 when a
`_pyio` implementation was added which defines `FileIO` lower down in
the file.
(cherry picked from commit 0a68068bd2)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-21 17:57:58 +02:00
Miss Islington (bot)
fade04e0f4
[3.14] gh-133982: Run unclosed file test on all io implementations (gh-134165) (gh-134433)
Update `test_io` `_check_warn_on_dealloc` to use `self.` to dispatch to
different I/O implementations.

Update the `_pyio` implementation to match expected behavior, using the
same `_dealloc_warn` design as the C implementation uses to report the
topmost `__del__` object.

The FileIO one now matches all the others, so can use IOBase. There was
a missing check on closing (self._fd must be valid), add that check
(cherry picked from commit 5b0e827521)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-21 17:22:44 +02:00
Miss Islington (bot)
74dde92903
[3.14] gh-71253: Match _io exception in _pyio (gh-133985) (gh-134430)
Test was only testing _io, expanded to cover _pyio.

(cherry picked from commit 06eaf4055c)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-05-21 17:13:43 +02:00
Miss Islington (bot)
c612a4d2c0
[3.14] gh-133982: Update test_bufio to use self.open (gh-133983) (gh-134428)
(cherry picked from commit 84d5f8d799)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-21 17:13:13 +02:00
Miss Islington (bot)
2ffc10bd39
[3.14] gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-134418)
It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`.
There's also room for other fallback modes if that later makes sense.

(cherry picked from commit 88f8102a8f, AKA gh-133482)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-21 14:47:56 +00:00
Miss Islington (bot)
cd3395a8b1
[3.14] gh-132246: Add special buffer methods to C API Type Object docs (gh-132247) (gh-134426)
Two special methods, __buffer__ and __release_buffer__ were added to
Python 3.12 by PEP 688. The C API Type Object documentation for slots
includes `tp_as_buffer`, and sub-slots `bf_getbuffer`, `bf_releasebuffer`
but does not refer to the Python Data Model version of those. Add the
missing references.

(cherry picked from commit b529b60fc2)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-21 16:33:35 +02:00
Miss Islington (bot)
f1a9d89107
[3.14] gh-90871: fix connection backlog offset in asyncio (gh-134392) (gh-134421)
(cherry picked from commit 109f7597d2)

Co-authored-by: Christian Harries <68507104+ChristianHrs@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-21 16:27:13 +02:00
Miss Islington (bot)
9be568eda4
[3.14] gh-132983: Add documentation for compression.zstd (GH-133911) (#134425)
gh-132983: Add documentation for compression.zstd (GH-133911)

Add documentation for compression & compression.zstd.

🎉

---------
(cherry picked from commit d862b6de1b)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Sumana Harihareswara <sh@changeset.nyc>
Co-authored-by: Martin Panter <vadmium@users.noreply.github.com>
2025-05-21 14:24:23 +00:00
Miss Islington (bot)
f7cdee93f4
[3.14] gh-110631: Fix some incorrect indents in the documentation (GH-129312) (#134419)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-05-21 13:58:09 +00:00
Miss Islington (bot)
ac27008ccd
[3.14] Fix signature of _curses.assume_default_colors in the docs (GH-134409) (#134417)
Fix signature of `_curses.assume_default_colors` in the docs (GH-134409)
(cherry picked from commit dcfc91e4e5)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-21 13:08:20 +00:00
Miss Islington (bot)
7c3e21540b
[3.14] gh-132542: Only run test_native_id_after_fork if native_id is supported (GH-134408) (GH-134413)
(cherry picked from commit e6dde10a69)

Co-authored-by: Noam Cohen <noam@noam.me>
2025-05-21 11:38:37 +00:00
Miss Islington (bot)
87d7a19ef0
[3.14] gh-133980: use atomic store in PyObject_GenericSetDict (GH-133988) (#134354)
gh-133980: use atomic store in `PyObject_GenericSetDict` (GH-133988)
(cherry picked from commit ec39fd2c20)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-21 15:06:39 +05:30
Miss Islington (bot)
b0bf48a134
[3.14] Add documentation for remote debugging with pdb (GH-134260) (#134398) 2025-05-21 09:29:42 +00:00
Miss Islington (bot)
64047f7e92
[3.14] gh-134360 Add processName attribute to logging.Formatter docstring (GH-134371) (GH-134405)
Co-authored-by: Sofia Toro <sofie.torch@outlook.com>
2025-05-21 06:16:56 +01:00
Miss Islington (bot)
af428a3894
[3.14] gh-72680: Fix false positives when using zipfile.is_zipfile() (GH-134250) (#134401)
gh-72680: Fix false positives when using zipfile.is_zipfile() (GH-134250)

bpo-28494: Improve zipfile.is_zipfile reliability

The zipfile.is_zipfile function would only search for the EndOfZipfile
section header. This failed to correctly identify non-zipfiles that
contained this header. Now the zipfile.is_zipfile function verifies
the first central directory entry.

Changes:
* Extended zipfile.is_zipfile to verify zipfile catalog
* Added tests to validate failure of binary non-zipfiles
* Reuse 'concat' handling for is_zipfile
(cherry picked from commit 1298511b41)

Co-authored-by: Tim Hatch <timhatch@netflix.com>
Co-authored-by: John Jolly <john.jolly@gmail.com>
2025-05-21 01:58:48 +00:00
Miss Islington (bot)
e379a71811
[3.14] gh-91048: Fix error path result in _remote_debugging_module (GH-134347) (#134399) 2025-05-21 00:20:53 +00:00
Miss Islington (bot)
81c348b6da
GH-130727: Avoid race condition in _wmimodule by copying shared data (GH-134313)
(cherry picked from commit e4fbfb1288)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-20 21:47:12 +00:00
Miss Islington (bot)
69710b7087
[3.14] gh-134215: PyREPL: Do not show underscored modules by default during autocompletion (gh-134267) (gh-134388)
(cherry picked from commit a3a3cf6d15)

Co-authored-by: Kevin Hernández <kevin.hernandez@unet.edu.ve>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 23:12:02 +02:00
Miss Islington (bot)
04829d4d87
[3.14] gh-134209: use heap-allocated memory in _curses.window.{instr,getstr} (GH-134283) (#134391)
gh-134209: use heap-allocated memory in `_curses.window.{instr,getstr}` (GH-134283)

* made curses buffer heap allocated instead of stack
* change docs to explicitly mention the max buffer size
* changing GetStr() function to behave similarly too
* Update Doc/library/curses.rst
* Update instr with proper return error handling
* Update Modules/_cursesmodule.c
* change to strlen and better memory safety
* change from const int to Py_ssize_t
* add mem allocation guard
* update versionchanged to mention it was an increase.
* explicitly use versionchanged 3.14 as that is its own branch now.

TESTED: `python -m test -u curses test_curses`

---------
(cherry picked from commit aadda87b3d)

Co-authored-by: tigerding <43339228+zydtiger@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-20 14:01:45 -07:00
Miss Islington (bot)
379805d03c
[3.14] gh-128066: Properly handle history file writes for RO fs on PyREPL (gh-134380) (gh-134385)
(cherry picked from commit c91ad5da9d)

Co-authored-by: Chris Patti <feoh@feoh.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 22:15:23 +02:00
Miss Islington (bot)
899ce7d390
[3.14] gh-85045: clarified that the underlying buffer of a TextIOBase can be a RawIOBase (GH-134372) (#134374)
gh-85045: clarified that the underlying buffer of a TextIOBase can be a RawIOBase (GH-134372)

Added a clarification that the underlying binary buffer of a TextIOBase can be a BufferedIOBase OR a RawIOBase
(cherry picked from commit 36eb711d2f)

Co-authored-by: Alex Kautz <alex@takemobi.com>
2025-05-20 12:28:03 -07:00
Miss Islington (bot)
6f1f871483
[3.14] gh-127146: xfail more Emscripten stack overflows (GH-134358) (#134382)
Adds some additional test xfails for Emscripten stack overflows. Also corrects a test skip for test_io.
(cherry picked from commit 91e6a58e2d)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-05-20 19:07:08 +00:00
Miss Islington (bot)
a2950d50cc
[3.14] gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (GH-134234) (#134378)
gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (GH-134234)
(cherry picked from commit 306f9e04e5)

Co-authored-by: abstractedfox <coldcaption@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-20 18:59:00 +00:00
Miss Islington (bot)
2d90cc8b35
[3.14] gh-106213: Shorten Emscripten wasm-gc trampoline by a little (GH-133984) (#134376)
Using the if instruction results in slightly shorter trampoline code.
(cherry picked from commit 3b7888bf3d)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-05-20 18:49:29 +00:00
Miss Islington (bot)
efdaae5b35
[3.14] gh-86802: Fix asyncio memory leak; shielded task exceptions log once through the exception handler (gh-134331) (gh-134343)
(cherry picked from commit f695eca60c)

Co-authored-by: Christian Harries <68507104+ChristianHrs@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 19:43:09 +02:00
Miss Islington (bot)
6ce2045139
[3.14] GH-133779: Fix finding pyconfig.h on Windows JIT builds (GH-134359)
(cherry picked from commit 7ad90463df)
2025-05-20 13:22:24 -04:00
Miss Islington (bot)
6074e1e6c4
[3.14] gh-75459: Doc: C API: Improve object life cycle documentation (GH-125962) (GH-134344)
gh-75459: Doc: C API: Improve object life cycle documentation (GH-125962)

  * Add "cyclic isolate" to the glossary.
  * Add a new "Object Life Cycle" page.
  * Improve docs for related API, with special focus on cross-references and warnings
(cherry picked from commit 3246ea514d)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-05-20 19:11:01 +02:00
Miss Islington (bot)
6d4b56d2f3
[3.14] gh-127945: Update What's New in Python 3.14 for free-threaded ctypes (GH-134332) (#134364)
gh-127945: Update What's New in Python 3.14 for free-threaded ctypes (GH-134332)
(cherry picked from commit b430e92dd8)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-20 17:02:55 +00:00
Miss Islington (bot)
402d983f27
[3.14] gh-128002: add what's new docs for asyncio (GH-134324) (#134362)
gh-128002: add what's new docs for `asyncio` (GH-134324)
(cherry picked from commit 0584533dc7)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-20 16:47:42 +00:00
Miss Islington (bot)
8e8d5c91cd
[3.14] gh-132542: Set native thread ID after fork (GH-132701) (GH-134356)
(cherry picked from commit 6b73502313)

Co-authored-by: Noam Cohen <noam@noam.me>
2025-05-20 16:46:52 +00:00
Miss Islington (bot)
dc5866ab25
[3.14] gh-129748: Update mimalloc to use atomic store for mi_block_set_nextx (GH-134238) (gh-134352)
gh-129748: Update mimalloc to use atomic store for mi_block_set_nextx (GH-134238)
(cherry picked from commit 317c496223)

Co-authored-by: Donghee Na <donghee.na@python.org>
2025-05-20 16:25:04 +00:00
Miss Islington (bot)
ff0facd332
[3.14] gh-101100: Fix Sphinx warnings in library/decimal.rst (GH-134303) (#134338)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-05-20 14:52:11 +00:00
Miss Islington (bot)
b9a7e79ee1
[3.14] gh-128307: Update what's new in 3.13 and 3.14 with create_task changes of asyncio (GH-134304) (#134319)
gh-128307: Update what's new in 3.13 and 3.14 with create_task changes of asyncio  (GH-134304)
(cherry picked from commit 28625d4f95)

Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-20 14:15:18 +00:00
Miss Islington (bot)
2dedf5eb45
[3.14] gh-62824: Add alias for iso-8859-8-i which is the same as iso-8859-8 (gh-134306) (gh-134330)
(cherry picked from commit 5ab66a882d)

Co-authored-by: Bas Bloemsaat <bas@bloemsaat.com>
Co-authored-by: David Goncalves <davegoncalves@gmail.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2025-05-20 16:05:16 +02:00
Miss Islington (bot)
7e67b36d97
[3.14] gh-117596: Add more tests for os.path with invalid paths (GH-134189) (GH-134265)
(cherry picked from commit 871d269875)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-20 12:55:21 +00:00
Miss Islington (bot)
a3fa72578a
[3.14] gh-53189: Document peculiarities of InteractiveConsole in relation to pickle (GH-123069) (GH-134328)
gh-53189: Document peculiarities of InteractiveConsole in relation to pickle (GH-123069)

(cherry picked from commit a31bbc951a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-05-20 12:15:34 +00:00
Miss Islington (bot)
c23bdc2ece
[3.14] gh-133890: Handle UnicodeEncodeError in tarfile (GH-134147) (GH-134195)
UnicodeEncodeError is now handled the same way as OSError during
TarFile member extraction.
(cherry picked from commit 9983c7d441)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-20 10:13:40 +00:00
Miss Islington (bot)
9c73a4de0c
[3.14] gh-133940: test_strftime incorrectly calculates expected week (GH-134281) (#134301)
gh-133940: test_strftime incorrectly calculates expected week (GH-134281)

Let the system determine the correct tm_wday and tm_isdst.
(cherry picked from commit e3dda8f818)

Co-authored-by: Gustaf <79180496+GGyll@users.noreply.github.com>
2025-05-20 10:11:39 +00:00
Miss Islington (bot)
ccaf865364
[3.14] gh-131505: Move len boundary assertions before using len. (GH-131536) (GH-134239)
gh-131505: Move len boundary assertions before using len. (GH-131536)

Move len boundary assertions before using len.
(cherry picked from commit c45e661226)

Co-authored-by: naya451 <41294408+naya451@users.noreply.github.com>
2025-05-20 09:57:39 +00:00
Miss Islington (bot)
9be3413b60
[3.14] Clean up test_posixpath (GH-134315) (GH-134316)
* Ensure that created files and dirs are always removed after test.
  Now addCleanup() does not conflict with tearDown().
* Use os_helper.unlink() and os_helper.rmdir().
* Import TESTFN from os_helper.
(cherry picked from commit e29171bf8a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-20 08:18:13 +00:00
Miss Islington (bot)
90aa13ae47
[3.14] gh-133374: fix test_python_legacy_windows_stdio (GH-134080) (GH-134314)
(cherry picked from commit 652d6938ef)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2025-05-20 06:53:44 +00:00
Miss Islington (bot)
07a2033fcf
[3.14] gh-132983: Call Py_XDECREF rather than PyObject_GC_Del in failed __new__ (GH-133962) (#134305)
gh-132983: Call Py_XDECREF rather than PyObject_GC_Del in failed __new__ (GH-133962)

Call Py_XDECREF rather than PyObject_GC_Del in failed __new__

This will call tp_dealloc and clear all members.
(cherry picked from commit e575190abb)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-05-20 02:58:51 +00:00
Miss Islington (bot)
4effd060fc
[3.14] gh-132983: Convert zstd `__new__` methods to Argument Clinic (GH-133860) (#133915)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-20 03:25:24 +01:00
Miss Islington (bot)
e20f05f53f
[3.14] gh-134201: Expand explanation of Base85 encodings in base64 docs (GH-134288) (#134298)
gh-134201: Expand explanation of Base85 encodings in base64 docs (GH-134288)

Explain history of de-facto standard and how to pick between the two Base-85 encoding functions in the base-64 module.

---------
(cherry picked from commit 66aaad6103)

Co-authored-by: Alek Binion <aleksander.binion@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2025-05-20 00:05:26 +00:00
Miss Islington (bot)
7cbc3ea8fb
[3.14] gh-134235: Import Autocomplete for Builtin Modules (GH-134277) (#134285)
gh-134235: Import Autocomplete for Builtin Modules (GH-134277)

* added enhancement auto completing import with sys builtins

---------
(cherry picked from commit 8421b03b16)

Co-authored-by: Tom Wang <85062819+tommix626@users.noreply.github.com>
Co-authored-by: Hunter <hyoung3@gmail.com>
2025-05-19 21:46:50 +00:00
Steve Dower
7686c752b3
[3.14] gh-133779: Revert Windows generation of pyconfig.h and go back to a static header. (GH-133966)
Extension builders must specify Py_GIL_DISABLED if they want to link to the free-threaded builds.
This was usually the case already, but this change guarantees it in all circumstances.
2025-05-19 21:24:53 +01:00
Miss Islington (bot)
89b744a772
[3.14] gh-125225: Fix column misalignment in help('topics') output (gh-125226) (gh-134225)
The 'help("topics")' output was misaligned due to "ASSIGNMENTEXPRESSIONS"
exceeding the implicit maximum default column width of 19 characters.

Reduced the number of columns from 4 to 3 in the listtopics()
function to allow more space for longer topic names.
(cherry picked from commit b22460c44d)

Co-authored-by: Étienne Pelletier <EtiennePelletier@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 17:22:14 +02:00
Miss Islington (bot)
c869898f39
[3.14] gh-128045: Mark unknown opcodes as deopting to themselves (GH-128044) (#134228)
* gh-128045: Mark unknown opcodes as deopting to themselves (GH-128044)
2025-05-19 11:09:15 -04:00
Miss Islington (bot)
7d995ea9fd
[3.14] gh-134214: Fix test case in pyrepl (gh-134223) (gh-134229)
(cherry picked from commit faebf87b37)

Co-authored-by: Jessica Temporal <jtemporal@users.noreply.github.com>
2025-05-19 14:51:46 +00:00
Miss Islington (bot)
a3c3d6f0ef
[3.14] gh-134158: Fix PyREPL coloring of double braces in f/t-strings (gh-134159) (#134227)
Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 17:39:05 +03:00
Miss Islington (bot)
182464eb9e
[3.14] gh-134097: Print number of refs & blocks after each statement in new REPL (gh-134136) (gh-134220)
(cherry picked from commit c31547a591)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 16:13:44 +02:00
Miss Islington (bot)
e3cc4008c4
[3.14] gh-122055: Clarify documentation for empty matches in RE (GH-133169) (GH-134217)
(cherry picked from commit 44b73d3cd4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-19 16:49:46 +03:00
Miss Islington (bot)
d9c08c57e9
[3.14] gh-133999: Fix except parsing regression in 3.14 (GH-134035) (#134206)
gh-133999: Fix `except` parsing regression in 3.14 (GH-134035)
(cherry picked from commit 84914ad0e5)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-19 14:26:27 +03:00
Miss Islington (bot)
9136ccfffe
[3.14] gh-76023: Make os.path.realpath to ignore WinError 1005 in non-strict mode (GH-128328) (GH-134203)
(cherry picked from commit d55e11b804)

Co-authored-by: BecoKo <koev_v@yahoo.com>
2025-05-19 09:59:58 +00:00
Stan Ulbrych
91d71ac1bd
[3.14] gh-134060: Don't create a certain symlink in venv if platform does not support it (GH-134061) 2025-05-18 22:33:14 +03:00
Miss Islington (bot)
70735878ab
[3.14] gh-133889: Only show the path of the URL in the SimpleHTTPRequestHandler page (GH-134135) (GH-134190)
The query and fragment are ambiguous and not used.
(cherry picked from commit 5cbc8c632e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-18 22:16:37 +03:00
Miss Islington (bot)
76957eb8cc
[3.14] document Py_VISIT as a macro in the docs (GH-133688) (#134186)
document `Py_VISIT` as a macro in the docs (GH-133688)
(cherry picked from commit bb32f3c698)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2025-05-18 16:34:19 +00:00
Miss Islington (bot)
11650c354f
[3.14] fix indent in controlflow.rst docs (GH-134008) (#134184)
fix indent in `controlflow.rst` docs (GH-134008)
(cherry picked from commit 4ce91871a9)

Co-authored-by: Yongzi Li <1538321957@qq.com>
2025-05-18 16:29:03 +00:00
Miss Islington (bot)
bb5f92adcf
[3.14] gh-134144: Fix use-after-free in zapthreads() (GH-134145) (#134182)
gh-134144: Fix use-after-free in zapthreads() (GH-134145)
(cherry picked from commit f2de1e6861)

Co-authored-by: b-pass <b-pass@users.noreply.github.com>
2025-05-18 15:29:19 +00:00
Miss Islington (bot)
8d51ed6b05
[3.14] gh-134100: Fix use-after-free in PyImport_ImportModuleLevelObject (GH-134117) (#134171)
gh-134100: Fix use-after-free in `PyImport_ImportModuleLevelObject` (GH-134117)
(cherry picked from commit 4e9005d32f)

Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
2025-05-18 20:38:40 +05:30
Miss Islington (bot)
bf39decabd
[3.14] gh-134150: Clarify distinction between JSON and Python objects (GH-134154) (#134166)
gh-134150: Clarify distinction between JSON and Python objects (GH-134154)

* gh-134150: Clarify distinction between JSON objects and Python objects in json module docs

* Revert change to JSON introduction

* Clarify occurrences of "object literal" as JSON
(cherry picked from commit fa4e088668)

Co-authored-by: Micha Albert <micha@2231puppy.tech>
2025-05-18 01:54:00 +00:00
Miss Islington (bot)
eaee2ae033
[3.14] gh-134064: Fix sys.remote_exec() error checking (GH-134067) (#134162)
gh-134064: Fix sys.remote_exec() error checking (GH-134067)
(cherry picked from commit 009e7b3698)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-17 22:50:00 +00:00
Miss Islington (bot)
1ba5e65b76
[3.14] gh-134119: Fix crash from calling next() on exhausted template iterator (GH-134120) (#134153)
gh-134119: Fix crash from calling next() on exhausted template iterator (GH-134120)
(cherry picked from commit fc7f4c3666)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-17 19:48:54 +00:00
Miss Islington (bot)
cca18fcbe8
[3.14] gh-88275: Add missing __init__ method to match example (GH-120281) (#134142)
gh-88275: Add missing `__init__` method to `match` example (GH-120281)
(cherry picked from commit 7a9d46295a)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2025-05-17 13:17:23 +00:00
Miss Islington (bot)
b43e1d0b48
[3.14] Docs: fix spelling of "test case" in unittest documentation (GH-134137) (#134138)
Docs: fix spelling of "test case" in `unittest` documentation (GH-134137)
(cherry picked from commit b41d79c776)

Co-authored-by: Clifford Gama <53076065+cliff688@users.noreply.github.com>
2025-05-17 14:03:33 +02:00
Miss Islington (bot)
9f1307afa0
[3.14] Docs: C API: Improve documentation around non-Python threads with subinterpreters (GH-131087) (GH-134130)
Docs: C API: Improve documentation around non-Python threads with subinterpreters (GH-131087)

(cherry picked from commit af6b3b825f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-17 09:04:42 +00:00
Miss Islington (bot)
851b26f4be
[3.14] gh-113878: fix versionadded in dataclasses.field() documentation (GH-134065) (#134128)
gh-113878: fix `versionadded` in `dataclasses.field()` documentation (GH-134065)
(cherry picked from commit 9d73875072)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2025-05-17 08:06:04 +00:00
Miss Islington (bot)
075cabb026
[3.14] gh-133881: add forward reference to list.sort() in lambda expression tutorial (GH-133910) (#134126)
gh-133881: add forward reference to `list.sort()` in lambda expression tutorial (GH-133910)
(cherry picked from commit c1c9ad1d5a)

Co-authored-by: Oleg Burnaev <51371645+Shepard2154@users.noreply.github.com>
2025-05-17 08:05:47 +00:00
Miss Islington (bot)
d7230e1110
[3.14] gh-134098: Fix handling %-encoded trailing slash in SimpleHTTPRequestHandler (GH-134099) (GH-134123)
(cherry picked from commit 2f1ecb3bc4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-17 07:37:43 +00:00
Miss Islington (bot)
5cdad8c90c
[3.14] gh-133889: Improve tests for SimpleHTTPRequestHandler (GH-134102) (GH-134121)
(cherry picked from commit fcaf009907)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-17 07:27:38 +00:00
Miss Islington (bot)
f89323236f
[3.14] gh-134109: Fix showing comments in pydoc output for argparse (GH-134110) (GH-134112)
Comments immediately preceding the object's source code are used
if the object has no docstring.
Comments that do not describe the object should be separated from
the following source code by an empty line.
(cherry picked from commit 71cf4dd622)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-16 20:56:24 +00:00
Miss Islington (bot)
7a5851dc90
[3.14] gh-117026: Remove outdated sentence in SimpleHTTPRequestHandler docs (GH-117027) (GH-134107)
The code was changed in 0f7cddc308 (bpo-839496/gh-39531).
(cherry picked from commit ea2d707bd5)

Co-authored-by: Saleh Dehqanpour <salehdeh76@gmail.com>
2025-05-16 22:23:52 +03:00
Miss Islington (bot)
c8dcde4d5e
[3.14] gh-133286: add explanation about seq for pathlib Pattern Language (GH-133340) (#134105)
gh-133286: add explanation about `seq` for pathlib Pattern Language (GH-133340)
(cherry picked from commit ac8df4b589)

Co-authored-by: alexey semenyuk <alexsemenyuk88@gmail.com>
2025-05-16 20:20:47 +01:00
Miss Islington (bot)
2d00484f30
[3.14] gh-133515: fix docs for unawaited coroutines in debug mode (GH-134081) (#134093)
gh-133515: fix docs for unawaited coroutines in debug mode (GH-134081)
(cherry picked from commit d94b1e9cac)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-16 15:37:01 +00:00
Miss Islington (bot)
fe5636ea96
[3.14] gh-124210: Add introduction to threading docs (GH-127046) (#134090)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-05-16 12:29:40 +00:00
Miss Islington (bot)
dda5dc5f06
[3.14] gh-132388: test HACL* and OpenSSL hash functions in pure Python HMAC (GH-134051) (#134089)
gh-132388: test HACL* and OpenSSL hash functions in pure Python HMAC (GH-134051)
(cherry picked from commit 73d71a416f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-16 12:26:37 +00:00
Miss Islington (bot)
7725ba8461
[3.14] gh-134069: bump HACL* revision to incoporate memset_s (GH-134027) (#134084)
Bumps the HACL* revision to include recent revisions that corrects issues
building with legacy/cross-platform macOS SDKs.
(cherry picked from commit 1566c34dc7)

Signed-off-by: aeiouaeiouaeiouaeiouaeiouaeiou <aeioudev@outlook.com>
Co-authored-by: aeiouaeiouaeiouaeiouaeiouaeiou <aeioudev@outlook.com>
2025-05-16 10:49:08 +00:00
Miss Islington (bot)
5374762234
[3.14] gh-130000: Release the GIL in winreg when doing Windows API calls (GH-130001) (#134072)
gh-130000: Release the GIL in winreg when doing Windows API calls (GH-130001)
(cherry picked from commit 7a504b3d5d)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-05-16 10:04:24 +00:00
Miss Islington (bot)
ba06ccbb6d
Improve the administrative install docs for Python Install Manager (GH-134066)
(cherry picked from commit 6a22963291)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-15 21:18:26 +00:00
Miss Islington (bot)
438f464a5a
[3.14] gh-77065: Use putwch instead of putch in getpass.win_getpass (GH-134058) (#134059)
gh-77065: Use `putwch` instead of `putch` in `getpass.win_getpass` (GH-134058)
(cherry picked from commit 52a7a22a6b)

Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-15 15:41:37 +00:00
Miss Islington (bot)
31deafb8ee
[3.14] gh-133410: Fix PR detection in build workflow (GH-133671) (#134055)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-15 13:37:41 +00:00
Miss Islington (bot)
29d69e8b66
[3.14] gh-77065: add missing parameter echo_char in getpass.fallback_getpass (GH-133849) (#134053)
gh-77065: add missing parameter `echo_char` in `getpass.fallback_getpass` (GH-133849)
(cherry picked from commit d029a1a1cb)

Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-15 13:34:50 +00:00
Miss Islington (bot)
620065c33e
[3.14] gh-133403: Check Tools/build/deepfreeze.py with mypy (GH-133802) (#134038)
gh-133403: Check `Tools/build/deepfreeze.py` with mypy (GH-133802)
(cherry picked from commit 7eaa097390)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-15 09:39:20 +00:00
Miss Islington (bot)
fede4ed1d3
[3.14] Test also error messages in test_limit_int. (GH-134018) (GH-134033)
(cherry picked from commit e123a1d09b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-15 07:47:24 +00:00
Miss Islington (bot)
f2a4b1066b
[3.14] gh-133970: Make PEP750 types generic (GH-133976) (#134029)
gh-133970: Make PEP750 types generic (GH-133976)
(cherry picked from commit c3a1da5b93)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-15 06:39:39 +00:00
Miss Islington (bot)
b6299e8f16
[3.14] gh-133986: Document string split algorithm when sep is None and maxsplit is 0 (GH-133987) (#133993)
---------
(cherry picked from commit 3e23047363)

Co-authored-by: Joey Smith <joeysmith@gmail.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-14 21:32:45 -04:00
Miss Islington (bot)
4adb1ddac8
[3.14] Improve tests for str to Fraction conversion (GH-134010) (GH-134016)
(cherry picked from commit 17d0fec702)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-14 18:18:04 +00:00
Miss Islington (bot)
ea15c55143
[3.14] Docs: remove link elements in builders other than HTML (GH-133720) (#134005)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2025-05-14 18:22:07 +03:00
Miss Islington (bot)
d6cb8fa86e
[3.14] gh-133701: Fix incorrect __annotations__ on TypedDict defined under PEP 563 (GH-133772) (#134003)
gh-133701: Fix incorrect `__annotations__` on TypedDict defined under PEP 563 (GH-133772)
(cherry picked from commit 9836503b48)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-14 13:54:29 +00:00
Miss Islington (bot)
a962934106
[3.14] gh-132983: Style improvements for compression.zstd (GH-133547) (#134001)
gh-132983: Style improvements for `compression.zstd` (GH-133547)
(cherry picked from commit b44c824856)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-14 12:39:43 +00:00
Miss Islington (bot)
275c8d5dbd
[3.14] Remove trailing whitespace from python.gram (GH-133858) (#133990)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-05-14 08:19:47 +00:00
Miss Islington (bot)
66d6860439
[3.14] gh-132641: fix race in lru_cache under free-threading (GH-133787) (#133979)
gh-132641: fix race in `lru_cache` under free-threading (GH-133787)

Fix race in `lru_cache` by acquiring critical section on the cache object itself and call the lock held variant of dict functions to modify the underlying dict.
(cherry picked from commit 9ad0c7b0f1)

Co-authored-by: Peter Hawkins <phawkins@google.com>
2025-05-14 07:11:38 +00:00
Miss Islington (bot)
b94a63c0f1
[3.14] gh-132983: Fix small issues with zstd support in zipfile (GH-133723) (#133974)
gh-132983: Fix small issues with zstd support in zipfile (GH-133723)
(cherry picked from commit 35f47d0589)

Co-authored-by: Carey Metcalfe <carey@cmetcalfe.ca>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-13 16:10:59 +00:00
Miss Islington (bot)
24847d04b2
gh-133928: Improvements to using/windows.rst (GH-133952)
(cherry picked from commit fc3cddd90a)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-13 16:06:29 +00:00
Miss Islington (bot)
5632e93f46
[3.14] gh-133968: Add fast path to PyUnicodeWriter_WriteStr() (GH-133969) (#133971)
gh-133968: Add fast path to PyUnicodeWriter_WriteStr() (GH-133969)

Don't call PyObject_Str() if the input type is str.
(cherry picked from commit fe9f6e829a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-13 13:58:25 +00:00
Miss Islington (bot)
69b4387f78
[3.14] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133942)
If the error handler is used, a new bytes object is created to set as
the object attribute of UnicodeDecodeError, and that bytes object then
replaces the original data. A pointer to the decoded data will became invalid
after destroying that temporary bytes object. So we need other way to return
the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal().

_PyBytes_DecodeEscape() does not have such issue, because it does not
use the error handlers registry, but it should be changed for compatibility
with _PyUnicode_DecodeUnicodeEscapeInternal().
(cherry picked from commit 9f69a58623)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-13 16:25:08 +03:00
Miss Islington (bot)
f0a7a6c2cc
[3.14] gh-133886: Fix sys.remote_exec() for non-UTF-8 paths (GH-133887) (GH-133963)
It now supports non-ASCII paths in non-UTF-8 locales and
non-UTF-8 paths in UTF-8 locales.
(cherry picked from commit c09cec5d69)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-13 09:23:39 +00:00
Miss Islington (bot)
198dc8dcb2
[3.14] gh-133885: skip test_compress_locking in test_zstd (GH-133943) (#133949)
gh-133885: skip `test_compress_locking` in `test_zstd` (GH-133943)
(cherry picked from commit e8665d4d46)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-13 08:27:17 +00:00
Miss Islington (bot)
3467656b18
[3.14] gh-132775: Add _PyFunction_GetXIData() (gh-133955)
(cherry picked from commit 8cf4947b0f, AKA gh-133481)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-12 22:37:55 +00:00
Miss Islington (bot)
c1aa5f82d9
[3.14] gh-132983: Fix compiler warning about unused function `mt_continue_should_break()` (GH-133947) (#133950)
gh-132983: Fix compiler warning about unused function ``mt_continue_should_break()`` (GH-133947)
(cherry picked from commit 121ed71f4e)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-05-12 19:49:44 +00:00
Miss Islington (bot)
5ba525c7d0
[3.14] gh-133413: Fix references to removed Request.has_data (GH-133414) (GH-133945)
The has_data() method of http.request.Request
was removed in version 3.4.
(cherry picked from commit 86c1d439e0)

Co-authored-by: ppaez <pp@pp.com.mx>
2025-05-12 18:23:35 +00:00
Miss Islington (bot)
c15980b57b
[3.14] gh-133653: Fix argparse.ArgumentParser with the formatter_class argument (GH-133813) (GH-133941)
* Fix TypeError when formatter_class is a custom subclass of
  HelpFormatter.
* Fix TypeError when formatter_class is not a subclass of
  HelpFormatter and non-standard prefix_char is used.
* Fix support of colorizing when formatter_class is not a subclass of
  HelpFormatter.
* Remove the prefix_chars parameter of HelpFormatter.
(cherry picked from commit 734e15b70d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-12 17:54:07 +00:00
Miss Islington (bot)
c11fc4bc96
[3.14] gh-133677: Fix tests when running in non-UTF-8 locale (GH-133865) (GH-133938)
(cherry picked from commit 14305a83d3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-12 16:41:40 +00:00
Miss Islington (bot)
89c801b84e
[3.14] gh-133925: Make typing._UnionGenericAlias hashable (GH-133929) (#133936)
gh-133925: Make typing._UnionGenericAlias hashable (GH-133929)
(cherry picked from commit 8d478c7953)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-12 15:50:10 +00:00
Miss Islington (bot)
ecc12bff24
[3.14] gh-133904: Fix math.factorial documentation (GH-133907) (#133918)
gh-133904: Fix `math.factorial` documentation (GH-133907)
(cherry picked from commit 27ed64575d)

Co-authored-by: mkaraev <maruf.karaev97@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-12 12:53:44 +00:00
Miss Islington (bot)
cedc37a894
[3.14] gh-91555: disable logger while handling log record (GH-131812) (GH-133899)
Prevent the possibility of re-entrancy leading to deadlock or infinite recursion (caused by logging triggered by logging), by disabling logging while the logger is handling log messages.
(cherry picked from commit 2561e148ec)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-05-12 13:02:21 +01:00
Miss Islington (bot)
f5d2d73995
[3.14] gh-133744: Fix multiprocessing interrupt test: add an event (GH-133746) (#133916)
gh-133744: Fix multiprocessing interrupt test: add an event (GH-133746)

Add an event to synchronize the parent process with the child
process: wait until the child process starts sleeping.
(cherry picked from commit c2989b7070)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-12 09:38:07 +00:00
Miss Islington (bot)
94938caf35
[3.14] gh-119180: annotationlib: Fix values of Format members in docs (GH-133841) (#133903)
gh-119180: annotationlib: Fix values of Format members in docs (GH-133841)
(cherry picked from commit 0eb448cae5)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-11 15:49:21 +00:00
Miss Islington (bot)
a3475e68bb
[3.14] gh-119180: More documentation for PEP 649/749 (GH-133552) (#133902)
gh-119180: More documentation for PEP 649/749 (GH-133552)

The SC asked that the Appendix in PEP-749 be added to the docs.
(cherry picked from commit 3396df56d0)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-11 15:49:06 +00:00
Miss Islington (bot)
507715d5f7
[3.14] gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (GH-133894) (#133901)
gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (GH-133894)
(cherry picked from commit 1d3eacedb8)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2025-05-11 15:25:43 +00:00
Miss Islington (bot)
98ef4837ec
[3.14] gh-133590: ensure that TableEntry.linenumber_borrow is initialized (GH-133681) (#133872)
gh-133590: ensure that `TableEntry.linenumber_borrow` is initialized (GH-133681)
(cherry picked from commit c838e21fda)

Co-authored-by: Lauta <ljfp@ljfp.xyz>
2025-05-11 08:44:22 +00:00
Miss Islington (bot)
f7d7248a03
[3.14] gh-133823: update "Pending Removal in 3.15" notes about TypedDict (GH-133864) (#133870)
gh-133823: update "Pending Removal in 3.15" notes about `TypedDict` (GH-133864)
(cherry picked from commit f91127ae1a)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-11 08:16:28 +00:00
Miss Islington (bot)
5c9f0ae49d
gh-133703: dict: fix calculate_log2_keysize() (GH-133809)
(cherry picked from commit 92337f666e)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2025-05-11 16:34:15 +09:00
Miss Islington (bot)
2b761d1122
[3.14] gh-132983: Remove leftovers from EndlessZstdDecompressor (GH-133856) (#133859)
gh-132983: Remove leftovers from EndlessZstdDecompressor (GH-133856)
(cherry picked from commit 878e0fb8b4)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-05-11 02:30:55 +00:00
Miss Islington (bot)
1e8a534533
[3.14] gh-132983: Make zstd types immutable (GH-133784) (#133857)
gh-132983: Make zstd types immutable (GH-133784)
(cherry picked from commit 1a87b6e9ae)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-10 23:02:44 +00:00
Miss Islington (bot)
da1e5c434b
[3.14] gh-133336: Remove comment about reserved -J in `initconfig.c` (GH-133821) (#133855) 2025-05-10 22:25:42 +00:00
Miss Islington (bot)
f7c441cc82
[3.14] gh-132983: Reduce the size of `_zstdmodule.h` (GH-133793) (#133854)
gh-132983: Reduce the size of ``_zstdmodule.h`` (GH-133793)
(cherry picked from commit 1a548c0a50)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-10 21:51:11 +00:00
Miss Islington (bot)
39485d5935
[3.14] Add classmethod to setUpClass in test_pdb (GH-133840) (#133846)
Add classmethod to setUpClass in test_pdb (GH-133840)
(cherry picked from commit 4f2f780d53)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-05-10 18:38:14 +00:00
Miss Islington (bot)
e7e105f51b
[3.14] gh-86155: Fix data loss after unclosed script or style tag in HTMLParser (GH-22658) (GH-133844)
When calling .close() the HTMLParser should flush all remaining content,
even when that content is in an unclosed script or style tag.
(cherry picked from commit 53383e90e4)

Co-authored-by: Waylan Limberg <waylan.limberg@icloud.com>
2025-05-10 18:02:23 +00:00
Miss Islington (bot)
856e5903ba
[3.14] gh-133783: Fix __replace__ on AST nodes for optional attributes (GH-133797) (#133842)
gh-133783: Fix __replace__ on AST nodes for optional attributes (GH-133797)
(cherry picked from commit 7dddb4e667)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-10 16:44:07 +00:00
Miss Islington (bot)
13c94d0401
[3.14] gh-132642: document how to render human-readable timedelta objects (GH-133825) (#133837)
gh-132642: document how to render human-readable `timedelta` objects (GH-133825)
(cherry picked from commit efcc42ba70)

Co-authored-by: Kentaro Jay Takahashi <64148935+KentaroJay@users.noreply.github.com>
2025-05-10 16:00:36 +00:00
Miss Islington (bot)
6dc12dad4b
[3.14] gh-117088: Fix AIX build (GH-132595) (GH-133838)
(cherry picked from commit 47f1722d80)

Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
2025-05-10 15:55:47 +00:00
Miss Islington (bot)
381159b2be
[3.14] gh-77057: Fix handling of invalid markup declarations in HTMLParser (GH-9295) (GH-133833)
(cherry picked from commit 76c0b01bc4)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-10 14:58:23 +00:00
Miss Islington (bot)
f3f22f9f51
[3.14] Tiny doc fix to double up backslashes in a Windows filesystem path (GH-133828) (#133830)
Tiny doc fix to double up backslashes in a Windows filesystem path (GH-133828)
(cherry picked from commit e7741dd773)

Co-authored-by: Tim Golden <mail@timgolden.me.uk>
2025-05-10 13:51:49 +00:00
Miss Islington (bot)
10cd1aafc4
[3.14] gh-115999: Note Python 3.14 free-threaded changes in What's New (gh-131285) (gh-133824)
gh-115999: Note Python 3.14 free-threaded changes in What's New (gh-131285)

---------
(cherry picked from commit f28cbc9fd3)

Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: mpage <mpage@cs.stanford.edu>
2025-05-10 10:37:02 +00:00
Miss Islington (bot)
4b78cbd76f
[3.14] gh-132971: Update shutil.which() docs (GH-133067) (#133803)
gh-132971: Update shutil.which() docs (GH-133067)
(cherry picked from commit d13d5fdf61)

Co-authored-by: Kokona <125976684+985025074@users.noreply.github.com>
2025-05-10 10:51:55 +02:00
Miss Islington (bot)
62109c4174
[3.14] gh-133009: fix UAF in xml.etree.ElementTree.Element.__deepcopy__ (GH-133010) (#133805)
gh-133009: fix UAF in `xml.etree.ElementTree.Element.__deepcopy__` (GH-133010)
(cherry picked from commit 116a9f9b37)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-10 07:58:10 +00:00
Miss Islington (bot)
99ca086f91
[3.14] gh-132983: Don't allow trailer data in ZstdFile (GH-133736) (#133799)
gh-132983: Don't allow trailer data in ZstdFile (GH-133736)
(cherry picked from commit 50b5370664)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
2025-05-10 02:58:43 +00:00
Miss Islington (bot)
f6a4604017
[3.14] Fix a typo in Misc/NEWS.d/3.140a1.rst (GH-133790) (#133798)
Fix a typo in Misc/NEWS.d/3.140a1.rst (GH-133790)
(cherry picked from commit c896dae029)

Co-authored-by: Tan Long <tanloong@foxmail.com>
2025-05-10 02:37:05 +00:00
Miss Islington (bot)
d9571c938c
[3.14] GH-132983: PEP 7 and Argument Clinic changes for zstd (GH-133791) (#133792)
GH-132983: PEP 7 and Argument Clinic changes for zstd (GH-133791)
(cherry picked from commit 1978904a2f)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-10 00:59:30 +00:00
Miss Islington (bot)
9023b6ffae
[3.14] GH-132983: remove empty_bytes from _zstd module state (GH-133785) (#133788)
GH-132983: remove empty_bytes from _zstd module state (GH-133785)
(cherry picked from commit 98e2c3af47)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-09 20:42:55 +00:00
Miss Islington (bot)
5796e3b588
[3.14] gh-132983: Simplify `_zstd_exec()` (GH-133775) (#133786)
gh-132983: Simplify ``_zstd_exec()`` (GH-133775)
(cherry picked from commit bbe9c31edc)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-09 20:15:32 +00:00
Miss Islington (bot)
aaeca91b05
[3.14] gh-133532: Run GC fast cycles test in subprocess. (gh-133533) (gh-133716)
This makes the test more reliable since there are not extra objects on the heap leftover
from other tests.

(cherry picked from commit 8598e57942)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2025-05-09 12:30:27 -07:00
Miss Islington (bot)
da41ce6b69
[3.14] Update HTTP links in the _pydatetime docstrings (GH-133025) (GH-133781)
(cherry picked from commit aed28eb5a0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-09 19:06:49 +00:00
Miss Islington (bot)
359696f031
[3.14] gh-133519: Add console to resources in libregrtest (GH-133520) (#133776)
gh-133519: Add console to resources in libregrtest (GH-133520)

Add console to resources in libregrtest
(cherry picked from commit 4274b47156)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-05-09 16:56:39 +00:00
Miss Islington (bot)
5e730a8baa
[3.14] gh-133741: Fix _can_strace(): check --trace option (GH-133766) (#133774)
gh-133741: Fix _can_strace(): check --trace option (GH-133766)

The --trace option needs strace 5.5 or newer.
(cherry picked from commit 67086282fc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-09 16:52:23 +00:00
Miss Islington (bot)
4e57e213d6
[3.14] gh-123299: Some copyedits to What's New in 3.14 (GH-133622) (#133771)
Co-authored-by: Éric <earaujo@caravan.coop>
2025-05-09 19:12:48 +03:00
Miss Islington (bot)
9ad1516357
[3.14] gh-46236: Document PyUnicode_BuildEncodingMap (GH-133270) (#133769)
gh-46236: Document PyUnicode_BuildEncodingMap (GH-133270)
(cherry picked from commit f34ec09ba5)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-09 15:24:59 +00:00
Miss Islington (bot)
b6c55511c3
[3.14] GH-132983: Restore libzstd fallback detection (GH-133565) (#133757)
GH-132983: Restore libzstd fallback detection (GH-133565)
(cherry picked from commit 2c7cac4c0d)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-09 15:59:07 +01:00
Miss Islington (bot)
2df021d9dc
[3.14] gh-132983: Clean-ups for `_zstd` (GH-133670) (#133756)
gh-132983: Clean-ups for ``_zstd`` (GH-133670)
(cherry picked from commit c2a5d4b383)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-09 15:58:58 +01:00
Miss Islington (bot)
bd6aad0ec4
[3.14] gh-133403: Check Tools/build/generate-build-details.py with mypy (GH-133735) (#133764)
gh-133403: Check `Tools/build/generate-build-details.py` with mypy (GH-133735)
(cherry picked from commit cd2f234ad2)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-09 14:48:05 +00:00
Miss Islington (bot)
5dddedf327
[3.14] GH-132983: Remove subclassing support from zstd types (GH-133694) (#133762)
GH-132983: Remove subclassing support from zstd types (GH-133694)

For consistency with ``bz2``, ``lzma``, and ``zlib``.
(cherry picked from commit bd7c5859c6)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-09 14:43:52 +00:00
Miss Islington (bot)
52d89f5343
[3.14] gh-133682: Fix inconsistent set ordering in annotationlib test (GH-133702) (#133754)
gh-133682: Fix inconsistent set ordering in annotationlib test (GH-133702)
(cherry picked from commit a2a0fa91c4)

Co-authored-by: Akshat Gupta <akshat.gupta24@gmail.com>
2025-05-09 14:27:13 +00:00
Miss Islington (bot)
94a823f501
[3.14] Docs: use boolean constants for returning boolean value (GH-133325) (GH-133760)
(cherry picked from commit 076004ae54)

Co-authored-by: Yongzi Li <1538321957@qq.com>
2025-05-09 14:17:53 +00:00
Miss Islington (bot)
a100a2b1b8
[3.14] Manpage: -X gil is not related to PYTHON_HISTORY (GH-133753) (#133758)
Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2025-05-09 14:17:33 +00:00
Miss Islington (bot)
9a77637067
[3.14] gh-133644: update Py_InteractiveFlag deprecation notice (GH-133749) (#133751)
gh-133644: update `Py_InteractiveFlag` deprecation notice (GH-133749)
(cherry picked from commit 3ed8d6fdd1)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-09 13:48:35 +00:00
Miss Islington (bot)
beb8a50ca1
[3.14] gh-133439: Fix dot commands with trailing spaces are mistaken for multi-line sqlite statements in the sqlite3 command-line interface (GH-133440) (GH-133738)
(cherry picked from commit ebd4881db2)

Co-authored-by: Tan Long <tanloong@foxmail.com>
2025-05-09 15:17:24 +03:00
Miss Islington (bot)
92d56777a1
[3.14] gh-133581: Fix refleak in t-string AST unparsing (GH-133724) (#133731)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-09 07:38:12 +00:00
Miss Islington (bot)
47d4947823
[3.14] gh-133412: amend docs for the inst definition (GH-133708) (#133729)
gh-133412: amend docs for the `inst` definition (GH-133708)

The `stack_effect` is incorrectly documented as being allowed to be optional.
(cherry picked from commit f77dac66e1)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
2025-05-09 07:12:41 +00:00
Miss Islington (bot)
3937c78e36
[3.14] gh-69426: HTMLParser: only unescape properly terminated character entities in attribute values (GH-95215) (GH-133704)
According to the HTML5 spec, named character references in attribute values
should only be processed if they are not followed by an ASCII alphanumeric,
or an equals sign.
(cherry picked from commit 77b14a6d58)


https: //html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state

Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com>
2025-05-09 09:43:21 +03:00
Miss Islington (bot)
8e86f9c3cc
[3.14] gh-132917: Use /proc/self/status for mem usage info. (GH-133544) (gh-133718)
On Linux, use /proc/self/status for mem usage info.  Using smaps_rollup is quite a lot slower and
we can get the similar info from /proc/self/status.
(cherry picked from commit 751db4e649)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2025-05-08 16:37:59 -07:00
Miss Islington (bot)
4c6fa89216
[3.14] gh-133467: Add TSAN suppressions for races in typeobject (gh-133534) (gh-133717)
(cherry picked from commit 8679c8d5cc)
2025-05-08 16:37:08 -07:00
Miss Islington (bot)
0c340d1083
[3.14] gh-133541: Handle SyntaxError raised by the tokenizer on user input (GH-133606) (#133709) 2025-05-08 20:41:01 +00:00
Miss Islington (bot)
add970f08e
gh-133626: Ensure the traditional Windows installer doesn't accidentally pick up site-packages (GH-133693)
(cherry picked from commit 6ce469dcba)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-08 20:17:11 +00:00
Miss Islington (bot)
79644893c5
[3.14] Fix typo in pending-removal-in-3.14.rst (GH-133680) (GH-133697)
(cherry picked from commit 9546eeea90)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-05-08 19:03:10 +00:00
Miss Islington (bot)
8806d0f499
[3.14] gh-103092: Support subinterpreters in `_zstd` (GH-133674) (#133695)
gh-103092: Support subinterpreters in ``_zstd`` (GH-133674)
(cherry picked from commit 6f6f48d289)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 18:38:40 +00:00
Miss Islington (bot)
3fcb9afb20
Adds docs to help with troubleshooting pip installs. (GH-133692)
(cherry picked from commit dd670fa7ca)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-08 18:35:57 +00:00
Miss Islington (bot)
cc6cf8a928
[3.14] gh-133403: Check Tools/build/verify_ensurepip_wheels.py with mypy (GH-133453) (#133689)
gh-133403: Check `Tools/build/verify_ensurepip_wheels.py` with mypy (GH-133453)
(cherry picked from commit 5f3d3f2a6c)

Co-authored-by: Flosckow <66554425+Flosckow@users.noreply.github.com>
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-08 18:20:13 +00:00
Miss Islington (bot)
3e7552e4ae
[3.14] gh-132762: Fix underallocation bug in dict.fromkeys()(gh-133627) (gh-133685)
The function `dict_set_fromkeys()` adds elements of a set to an existing
dictionary. The size of the expanded dictionary was estimated with
`PySet_GET_SIZE(iterable)`, which did not take into account the size of the
existing dictionary.
(cherry picked from commit 421ba589d0)

Co-authored-by: Angela Liss <59097311+angela-tarantula@users.noreply.github.com>
2025-05-08 17:39:39 +00:00
Miss Islington (bot)
8f071bc322
[3.14] gh-132886: use relaxed atomics for sock_fd in gil builds in socket module (GH-133208) (#133683)
gh-132886: use relaxed atomics for `sock_fd` in gil builds in socket module (GH-133208)
(cherry picked from commit 2d82ab761a)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-08 17:30:40 +00:00
Miss Islington (bot)
1059548686
[3.14] gh-132775: Add _PyCode_GetScriptXIData() (gh-133676)
This converts functions, code, str, bytes, bytearray, and memoryview objects to PyCodeObject,
and ensure that the object looks like a script.  That means no args, no return, and no closure.
_PyCode_GetPureScriptXIData() takes it a step further and ensures there are no globals.

We also add _PyObject_SupportedAsScript() to the internal C-API.

(cherry picked from commit c81fa2b9cd, AKA gh-133480)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-08 10:05:34 -06:00
Miss Islington (bot)
dc1a4dda88
[3.14] gh-131031: Fix test_pickle when invoked directly (GH-133356) (GH-133673)
(cherry picked from commit e15bbfafbc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-08 15:19:58 +00:00
Miss Islington (bot)
153496921a
[3.14] gh-133581: Improve AST unparsing of t-strings (GH-133635) (#133666)
gh-133581: Improve AST unparsing of t-strings (GH-133635)
(cherry picked from commit bfac7d2edc)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-08 13:40:44 +00:00
Miss Islington (bot)
863722be6b
[3.14] gh-133454: Mark tests with many threads that use much memory as bigmem (GH-133456) (GH-133663)
(cherry picked from commit 26839eae20)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-08 13:24:38 +00:00
Miss Islington (bot)
caeb422cbc
gh-133597: Fix memory leak if error occurred in _sys_getwindowsversion_from_kernel32 (GH-133598)
(cherry picked from commit 0ec8fc83a8)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-05-08 11:36:38 +00:00
Miss Islington (bot)
0f7046b187
[3.14] gh-133583: Add support for fixed size unsigned integers in argument parsing (GH-133584) (GH-133650)
* Add Argument Clinic converters: uint8, uint16, uint32, uint64.
* Add private C API: _PyLong_UInt8_Converter(),
  _PyLong_UInt16_Converter(), _PyLong_UInt32_Converter(),
  _PyLong_UInt64_Converter().
(cherry picked from commit 4c914e7a36)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-08 09:54:44 +00:00
Miss Islington (bot)
a020336256
[3.14] gh-127833: Add links to token types to the lexical analysis intro (GH-131468) (#133652)
gh-127833: Add links to token types to the lexical analysis intro (GH-131468)
(cherry picked from commit 45bb5ba61a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 10:46:47 +01:00
Miss Islington (bot)
3cd4c2db7b
[3.14] Doc: Allow translating a code block in the tutorial (GH-131353) (#133648)
Doc: Allow translating a code block in the tutorial (GH-131353)
(cherry picked from commit 3224b99872)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 09:28:58 +00:00
Miss Islington (bot)
2de8a8b7e9
[3.14] gh-133639: Fix test_auto_indent_default() doesn't run input_code (GH-133640) (#133646) 2025-05-08 08:50:57 +00:00
Miss Islington (bot)
d35c0e48da
[3.14] gh-133641: Doc: Add missing source link in `concurrent.futures` (GH-133642) (#133643)
gh-133641: Doc: Add missing source link in ``concurrent.futures`` (GH-133642)
(cherry picked from commit 4fcd377563)

Co-authored-by: Jonas Obrist <ojiidotch@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 09:34:20 +01:00
Miss Islington (bot)
effe8d4971
[3.14] gh-125028: Prohibit placeholders in partial keywords (GH-126062) (GH-133645)
(cherry picked from commit afed5f8835)

Co-authored-by: dgpb <3577712+dg-pb@users.noreply.github.com>
2025-05-08 08:26:14 +00:00
Miss Islington (bot)
c6a56e3d91
[3.14] gh-132983: Remove pyzstd in identifiers (GH-133535) (#133629) 2025-05-08 08:11:49 +01:00
Miss Islington (bot)
e8c279f394
[3.14] gh-133403: Type Tools/build/update_file.py and check it with mypy (GH-133404) (#133603)
gh-133403: Type `Tools/build/update_file.py` and check it with `mypy` (GH-133404)
(cherry picked from commit 50b52cba2d)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Zachary Ware <zach@python.org>
2025-05-08 09:32:05 +03:00
Miss Islington (bot)
f12e576128
[3.14] gh-133551: Skip annotationlib for now in ast roundtrip tests (GH-133634) (#133636)
gh-133551: Skip annotationlib for now in ast roundtrip tests (GH-133634)
(cherry picked from commit 0a3ccb8dff)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-08 03:01:33 +00:00
Miss Islington (bot)
aadfc2cbc7
[3.14] gh-133555: Allow regenerating the parser with Python < 3.14 (GH-133557) (#133630)
gh-133555: Allow regenerating the parser with Python < 3.14 (GH-133557)
(cherry picked from commit b48599b801)

Co-authored-by: Alex Prengère <2138730+alexprengere@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 01:54:42 +00:00
Miss Islington (bot)
ca3e3b8a27
[3.14] gh-127833: lexical analysis: Add backticks to BOM example (GH-132407) (#133632)
gh-127833: lexical analysis: Add backticks to BOM example (GH-132407)
(cherry picked from commit 0552ce0fb2)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-08 01:40:41 +00:00
Miss Islington (bot)
9e1aa354ae
[3.14] gh-133551: Support t-strings in annotationlib (GH-133553) (#133628)
gh-133551: Support t-strings in annotationlib (GH-133553)

I don't know why you'd use t-strings in annotations, but now if you do,
the STRING format will do a great job of recovering the source code.
(cherry picked from commit 90f476e0f8)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-08 01:37:03 +00:00
Eric Snow
c39bc81b70
[3.14] gh-132775: Unrevert "Add _PyCode_VerifyStateless()" (gh-133625)
This reverts commit 3c73cf5 (gh-133497), which itself reverted
the original commit d270bb5 (gh-133221).

We reverted the original change due to failing android tests.
The checks in _PyCode_CheckNoInternalState() were too strict,
so we've relaxed them.
2025-05-08 00:00:33 +00:00
Miss Islington (bot)
54c3aa1597
[3.14] gh-133516: Raise ValueError when constants True, False or None are used as an identifier after NFKC normalization (GH-133523) (#133596) 2025-05-07 22:26:06 +00:00
Miss Islington (bot)
c98b5a9369
[3.14] gh-133558: Skip test_pdb tests on FreeBSD (GH-133566) (#133616)
gh-133558: Skip test_pdb tests on FreeBSD (GH-133566)

'\x08' is not interpreted as backspace on FreeBSD.
(cherry picked from commit 79b8a32fcb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-07 22:20:17 +00:00
Miss Islington (bot)
cc588aaa5f
[3.14] gh-133361: move the explanation of dict equal before its use (GH-133424) (#133620)
gh-133361: move the explanation of dict equal before its use (GH-133424)

Also move up the explanation of insertion order preservation.  Both paragraphs seemed out of place down where they were.
---------
(cherry picked from commit 61ac88c06e)

Co-authored-by: Yongzi Li <1538321957@qq.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-05-07 22:10:51 +00:00
Brian Schubert
e2d440ebc6
[3.14] gh-131535: Fix stale example in html.parser docs, make examples doctests (GH-131551) (GH-133589)
(cherry picked from commit ee76e36d76)
2025-05-07 22:03:30 +00:00
Zachary Ware
0eb2291a7e
[3.14] Forward-port 'check-abi' CI job from 3.13 (GH-133614)
Also add the python3.14.abi file as generated by the new job and remove
the 'main branch only' entry from .gitignore.

The only difference from the 3.13 job is the addition of `with.python-version: 3.x`
to the `setup-python` configuration to pacify a warning.
2025-05-07 21:35:46 +00:00
Hugo van Kemenade
7504fe61b8 Post 3.14.0b1 2025-05-07 18:45:45 +03:00
1349 changed files with 104180 additions and 149143 deletions

View file

@ -1,73 +0,0 @@
{
"image": "ghcr.io/python/wasicontainer:latest",
"onCreateCommand": [
// Install common tooling.
"dnf",
"install",
"-y",
// For umask fix below.
"/usr/bin/setfacl"
],
"updateContentCommand": {
// Using the shell for `nproc` usage.
"python": "python3 Tools/wasm/wasi build --quiet -- --with-pydebug -C"
},
"postCreateCommand": {
// https://github.com/orgs/community/discussions/26026
"umask fix: workspace": ["sudo", "setfacl", "-bnR", "."],
"umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"]
},
"customizations": {
"vscode": {
"extensions": [
// Highlighting for Parser/Python.asdl.
"brettcannon.zephyr-asdl",
// Highlighting for configure.ac.
"maelvalais.autoconf",
// C auto-complete.
"ms-vscode.cpptools",
// Python auto-complete.
"ms-python.python"
],
"settings": {
"C_Cpp.default.compilerPath": "/usr/bin/clang",
"C_Cpp.default.cStandard": "c11",
"C_Cpp.default.defines": [
"CONFIG_64",
"Py_BUILD_CORE"
],
"C_Cpp.default.includePath": [
"${workspaceFolder}/*",
"${workspaceFolder}/Include/**"
],
// https://github.com/microsoft/vscode-cpptools/issues/10732
"C_Cpp.errorSquiggles": "disabled",
"editor.insertSpaces": true,
"editor.rulers": [
80
],
"editor.tabSize": 4,
"editor.trimAutoWhitespace": true,
"files.associations": {
"*.h": "c"
},
"files.encoding": "utf8",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"python.analysis.diagnosticSeverityOverrides": {
// Complains about shadowing the stdlib w/ the stdlib.
"reportShadowedImports": "none",
// Doesn't like _frozen_importlib.
"reportMissingImports": "none"
},
"python.analysis.extraPaths": [
"Lib"
],
"[restructuredtext]": {
"editor.tabSize": 3
}
}
}
}
}

1
.gitattributes vendored
View file

@ -104,4 +104,3 @@ Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
aclocal.m4 generated
configure generated
*.min.js generated

825
.github/CODEOWNERS vendored
View file

@ -1,261 +1,147 @@
# See https://help.github.com/articles/about-codeowners/
# for further details about the .github/CODEOWNERS file.
# for more info about CODEOWNERS file
# It uses the same pattern rule for gitignore file
# https://git-scm.com/docs/gitignore#_pattern_format
# Notably, a later match overrides earlier matches, so order matters.
# If using a wildcard pattern, try to be as specific as possible to avoid
# matching unintended files or overriding previous entries.
# To exclude a file from ownership, add a line with only the file.
# See the exclusions section at the end of the file for examples.
# =======
# Purpose
# =======
#
# An entry in this file does not imply 'ownership', despite the name of the
# file, but instead that those listed take an interest in that part of the
# project and will automatically be added as reviewers to PRs that affect
# the matching files.
# See also the Experts Index in the Python Developer's Guide:
# https://devguide.python.org/core-developers/experts/
#
# =========
# Structure
# =========
#
# The CODEOWNERS file is organised by topic area.
# Please add new entries in alphabetical order within the relevant section.
# Where possible, keep related files together. For example, documentation,
# code, and tests for a given item should all be listed in the same place.
#
# GitHub usernames should be aligned to column 31, or the next multiple
# of three if the relevant paths are too long to fit.
#
# Top-level sections are:
#
# * Buildbots, Continuous Integration, and Testing
# project-wide configuration files, internal tools for use in CI,
# linting.
# * Build System
# the Makefile, autoconf, and other autotools files.
# * Documentation
# broader sections of documentation, documentation tools
# * Internal Tools & Data
# internal tools, integration with external systems,
# entries that don't fit elsewhere
# * Platform Support
# relating to support for specific platforms
# * Interpreter Core
# the grammar, parser, compiler, interpreter, etc.
# * Standard Library
# standard library modules (from both Lib and Modules)
# and related files (such as their tests and docs)
# * Exclusions
# exclusions from .github/CODEOWNERS should go at the very end
# because the final matching pattern will take precedence.
# GitHub
.github/** @ezio-melotti @hugovk @AA-Turner
# ----------------------------------------------------------------------------
# Buildbots, Continuous Integration, and Testing
# ----------------------------------------------------------------------------
# Azure Pipelines
.azure-pipelines/ @AA-Turner
# GitHub & related scripts
.github/ @ezio-melotti @hugovk @AA-Turner
Tools/build/compute-changes.py @AA-Turner
Tools/build/verify_ensurepip_wheels.py @AA-Turner @pfmoore @pradyunsg
# Pre-commit
# pre-commit
.pre-commit-config.yaml @hugovk
.ruff.toml @hugovk @AlexWaygood @AA-Turner
# Patchcheck
Tools/patchcheck/ @AA-Turner
# ----------------------------------------------------------------------------
# Build System
# ----------------------------------------------------------------------------
# Autotools
configure* @erlend-aasland @corona10 @AA-Turner @emmatyping
Makefile.pre.in @erlend-aasland @AA-Turner @emmatyping
Modules/makesetup @erlend-aasland @AA-Turner @emmatyping
Modules/Setup* @erlend-aasland @AA-Turner @emmatyping
Tools/build/regen-configure.sh @AA-Turner
# Build system
configure* @erlend-aasland @corona10
Makefile.pre.in @erlend-aasland
Modules/Setup* @erlend-aasland
# generate-build-details
Tools/build/generate-build-details.py @FFY00
Lib/test/test_build_details.py @FFY00
# argparse
**/*argparse* @savannahostrowski
# ----------------------------------------------------------------------------
# Documentation
# ----------------------------------------------------------------------------
# asyncio
**/*asyncio* @1st1 @asvetlov @kumaraditya303 @willingc
# Internal Docs
InternalDocs/ @AA-Turner
# Tools, Configuration, etc
Doc/Makefile @AA-Turner @hugovk
Doc/_static/ @AA-Turner @hugovk
Doc/conf.py @AA-Turner @hugovk
Doc/make.bat @AA-Turner @hugovk
Doc/requirements.txt @AA-Turner @hugovk
Doc/tools/ @AA-Turner @hugovk
# PR Previews
.readthedocs.yml @AA-Turner
# Sections
Doc/reference/ @willingc @AA-Turner
Doc/whatsnew/ @AA-Turner
# ----------------------------------------------------------------------------
# Internal Tools and Data
# ----------------------------------------------------------------------------
# Argument Clinic
Tools/clinic/ @erlend-aasland @AA-Turner
Lib/test/test_clinic.py @erlend-aasland @AA-Turner
Doc/howto/clinic.rst @erlend-aasland @AA-Turner
# C Analyser
Tools/c-analyzer/ @ericsnowcurrently
# C API Documentation Checks
Tools/check-c-api-docs/ @ZeroIntensity
# Fuzzing
Modules/_xxtestfuzz/ @ammaraskar
# Limited C API & Stable ABI
Doc/c-api/stable.rst @encukou
Doc/data/*.abi @encukou
Misc/stable_abi.toml @encukou
Tools/build/stable_abi.py @encukou
# SBOM
Misc/externals.spdx.json @sethmlarson
Misc/sbom.spdx.json @sethmlarson
Tools/build/generate_sbom.py @sethmlarson
# ----------------------------------------------------------------------------
# Platform Support
# ----------------------------------------------------------------------------
# Android
Android/ @mhsmith @freakboy3742
Doc/using/android.rst @mhsmith @freakboy3742
Lib/_android_support.py @mhsmith @freakboy3742
Lib/test/test_android.py @mhsmith @freakboy3742
# iOS
Doc/using/ios.rst @freakboy3742
Lib/_ios_support.py @freakboy3742
Apple/ @freakboy3742
iOS/ @freakboy3742
# macOS
Mac/ @python/macos-team
Lib/_osx_support.py @python/macos-team
Lib/test/test__osx_support.py @python/macos-team
# WebAssembly
Tools/wasm/README.md @brettcannon @freakboy3742 @emmatyping
# WebAssembly (Emscripten)
Tools/wasm/config.site-wasm32-emscripten @freakboy3742 @emmatyping
Tools/wasm/emscripten @freakboy3742 @emmatyping
# WebAssembly (WASI)
Tools/wasm/wasi-env @brettcannon @emmatyping
Tools/wasm/wasi.py @brettcannon @emmatyping
Tools/wasm/wasi @brettcannon @emmatyping
# Windows
PC/ @python/windows-team
PCbuild/ @python/windows-team
# Windows installer packages
Tools/msi/ @python/windows-team
Tools/nuget/ @python/windows-team
# Windows Launcher
PC/launcher.c @python/windows-team @vsajip
# ----------------------------------------------------------------------------
# Interpreter Core
# ----------------------------------------------------------------------------
# AST
Lib/_ast_unparse.py @isidentical @JelleZijlstra @eclips4 @tomasr8
Lib/ast.py @isidentical @JelleZijlstra @eclips4 @tomasr8
Lib/test/test_ast/ @eclips4 @tomasr8
Parser/asdl.py @isidentical @JelleZijlstra @eclips4 @tomasr8
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4 @tomasr8
Python/ast.c @isidentical @JelleZijlstra @eclips4 @tomasr8
Python/ast_preprocess.c @isidentical @eclips4 @tomasr8
# Built-in types
Objects/call.c @markshannon
Objects/codeobject.c @markshannon
Objects/dict* @methane @markshannon
Objects/frameobject.c @markshannon
# Core
**/*context* @1st1
**/*genobject* @markshannon
Objects/object.c @ZeroIntensity
**/*hamt* @1st1
**/*jit* @brandtbucher @savannahostrowski
Python/perf_jit_trampoline.c # Exclude the owners of "**/*jit*", above.
Objects/set* @rhettinger
Objects/type* @markshannon
Objects/dict* @methane @markshannon
Objects/typevarobject.c @JelleZijlstra
Objects/unionobject.c @JelleZijlstra
# Byte code interpreter ('the eval loop')
Python/bytecodes.c @markshannon
Python/ceval* @markshannon
Tools/cases_generator/ @markshannon
# Compiler (AST to byte code)
Python/assemble.c @markshannon @iritkatriel
Objects/type* @markshannon
Objects/codeobject.c @markshannon
Objects/frameobject.c @markshannon
Objects/call.c @markshannon
Python/ceval*.c @markshannon
Python/ceval*.h @markshannon
Python/codegen.c @markshannon @iritkatriel
Python/compile.c @markshannon @iritkatriel
Python/assemble.c @markshannon @iritkatriel
Python/flowgraph.c @markshannon @iritkatriel
Python/instruction_sequence.c @iritkatriel
Python/bytecodes.c @markshannon
Python/optimizer*.c @markshannon
Python/optimizer_analysis.c @Fidget-Spinner
Python/optimizer_bytecodes.c @Fidget-Spinner
Python/symtable.c @JelleZijlstra @carljm
Lib/_pyrepl/* @pablogsal @lysnikolaou @ambv
Lib/test/test_patma.py @brandtbucher
Lib/test/test_type_*.py @JelleZijlstra
Lib/test/test_capi/test_misc.py @markshannon
Lib/test/test_pyrepl/* @pablogsal @lysnikolaou @ambv
Tools/c-analyzer/ @ericsnowcurrently
# Context variables & HAMT
**/contextvars* @1st1
**/*hamt* @1st1
Include/cpython/context.h @1st1
Include/internal/pycore_context.h @1st1
Lib/test/test_context.py @1st1
Python/context.c @1st1
# dbm
**/*dbm* @corona10 @erlend-aasland @serhiy-storchaka
# Core Modules
**/*bltinmodule* @ericsnowcurrently
# Doc/ tools
Doc/conf.py @AA-Turner @hugovk
Doc/Makefile @AA-Turner @hugovk
Doc/make.bat @AA-Turner @hugovk
Doc/requirements.txt @AA-Turner @hugovk
Doc/_static/** @AA-Turner @hugovk
Doc/tools/** @AA-Turner @hugovk
# runtime state/lifecycle
**/*pylifecycle* @ericsnowcurrently
**/*pystate* @ericsnowcurrently
**/*preconfig* @ericsnowcurrently
**/*initconfig* @ericsnowcurrently
**/*pathconfig* @ericsnowcurrently
**/*sysmodule* @ericsnowcurrently
**/*bltinmodule* @ericsnowcurrently
**/*gil* @ericsnowcurrently
Include/internal/pycore_runtime.h @ericsnowcurrently
Include/internal/pycore_interp.h @ericsnowcurrently
Include/internal/pycore_tstate.h @ericsnowcurrently
Include/internal/pycore_*_state.h @ericsnowcurrently
Include/internal/pycore_*_init.h @ericsnowcurrently
Include/internal/pycore_atexit.h @ericsnowcurrently
Include/internal/pycore_freelist.h @ericsnowcurrently
Include/internal/pycore_global_objects.h @ericsnowcurrently
Include/internal/pycore_obmalloc.h @ericsnowcurrently
Include/internal/pycore_pymem.h @ericsnowcurrently
Include/internal/pycore_stackref.h @Fidget-Spinner
Modules/main.c @ericsnowcurrently
Programs/_bootstrap_python.c @ericsnowcurrently
Programs/python.c @ericsnowcurrently
Tools/build/generate_global_objects.py @ericsnowcurrently
# Initialization
Doc/library/sys_path_init.rst @FFY00
Doc/c-api/init_config.rst @FFY00
# getpath
**/*getpath* @FFY00
# site
**/*site.py @FFY00
Doc/library/site.rst @FFY00
# Exceptions
Lib/test/test_except*.py @iritkatriel
Objects/exceptions.c @iritkatriel
# Getpath
Lib/test/test_getpath.py @FFY00
Modules/getpath* @FFY00
# Hashing & cryptographic primitives
**/*hashlib* @gpshead @tiran @picnixz
**/*hashopenssl* @gpshead @tiran @picnixz
**/*pyhash* @gpshead @tiran @picnixz
Modules/*blake* @gpshead @tiran @picnixz
Modules/*md5* @gpshead @tiran @picnixz
Modules/*sha* @gpshead @tiran @picnixz
Modules/_hacl/** @gpshead @picnixz
**/*hmac* @gpshead @picnixz
# Hashing / ``hash()`` and related
Include/cpython/pyhash.h @gpshead @picnixz
Include/internal/pycore_pyhash.h @gpshead @picnixz
Include/pyhash.h @gpshead @picnixz
Python/pyhash.c @gpshead @picnixz
# libssl
**/*ssl* @gpshead @picnixz
# The import system (including importlib)
# logging
**/*logging* @vsajip
# venv
**/*venv* @vsajip @FFY00
# Launcher
/PC/launcher.c @vsajip
# HTML
/Lib/html/ @ezio-melotti
/Lib/_markupbase.py @ezio-melotti
/Lib/test/test_html*.py @ezio-melotti
/Tools/build/parse_html5_entities.py @ezio-melotti
# Import (including importlib).
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
Python/import.c @brettcannon @ericsnowcurrently @ncoghlan @warsaw @kumaraditya303
/Python/import.c @kumaraditya303
Python/dynload_*.c @ericsnowcurrently
**/*freeze* @ericsnowcurrently
**/*frozen* @ericsnowcurrently
**/*modsupport* @ericsnowcurrently
@ -266,171 +152,19 @@ Python/import.c @brettcannon @ericsnowcurrently @ncoghlan @warsaw
**/*pythonrun* @ericsnowcurrently
**/*runpy* @ericsnowcurrently
**/*singlephase* @ericsnowcurrently
Doc/c-api/module.rst @ericsnowcurrently
Lib/test/test_module/ @ericsnowcurrently
Python/dynload_*.c @ericsnowcurrently
# Initialisation
**/*initconfig* @ericsnowcurrently
**/*pathconfig* @ericsnowcurrently
**/*preconfig* @ericsnowcurrently
Doc/library/sys_path_init.rst @FFY00
Doc/c-api/init_config.rst @FFY00
# Interpreter main program
Modules/main.c @ericsnowcurrently
Programs/_bootstrap_python.c @ericsnowcurrently
Programs/python.c @ericsnowcurrently
# JIT
Include/internal/pycore_jit.h @brandtbucher @savannahostrowski @diegorusso
Python/jit.c @brandtbucher @savannahostrowski @diegorusso
Tools/jit/ @brandtbucher @savannahostrowski @diegorusso
InternalDocs/jit.md @brandtbucher @savannahostrowski @diegorusso @AA-Turner
# Micro-op / μop / Tier 2 Optimiser
Python/optimizer.c @markshannon
Python/optimizer_analysis.c @markshannon @tomasr8 @Fidget-Spinner
Python/optimizer_bytecodes.c @markshannon @tomasr8 @Fidget-Spinner
Python/optimizer_symbols.c @markshannon @tomasr8
# Parser, Lexer, and Grammar
Grammar/python.gram @pablogsal @lysnikolaou
Lib/test/test_peg_generator/ @pablogsal @lysnikolaou
Lib/test/test_tokenize.py @pablogsal @lysnikolaou
Lib/tokenize.py @pablogsal @lysnikolaou
Parser/ @pablogsal @lysnikolaou
Tools/peg_generator/ @pablogsal @lysnikolaou
# Runtime state/lifecycle
**/*gil* @ericsnowcurrently
**/*pylifecycle* @ericsnowcurrently @ZeroIntensity
**/*pystate* @ericsnowcurrently @ZeroIntensity
Include/internal/pycore_*_init.h @ericsnowcurrently
Include/internal/pycore_*_state.h @ericsnowcurrently
Include/internal/pycore_atexit.h @ericsnowcurrently
Include/internal/pycore_freelist.h @ericsnowcurrently
Include/internal/pycore_global_objects.h @ericsnowcurrently
Include/internal/pycore_interp.h @ericsnowcurrently
Include/internal/pycore_obmalloc.h @ericsnowcurrently
Include/internal/pycore_pymem.h @ericsnowcurrently
Include/internal/pycore_runtime.h @ericsnowcurrently
Include/internal/pycore_stackref.h @Fidget-Spinner
Include/internal/pycore_tstate.h @ericsnowcurrently
Tools/build/generate_global_objects.py @ericsnowcurrently
# Remote Debugging
Python/remote_debug.h @pablogsal
Python/remote_debugging.c @pablogsal
Modules/_remote_debugging_module.c @pablogsal @ambv @1st1
# Sub-Interpreters
**/*crossinterp* @ericsnowcurrently
**/*interpreteridobject.* @ericsnowcurrently
Doc/library/concurrent.interpreters.rst @ericsnowcurrently
Lib/concurrent/futures/interpreter.py @ericsnowcurrently
Lib/concurrent/interpreters/ @ericsnowcurrently
Lib/test/support/channels.py @ericsnowcurrently
Lib/test/test__interp*.py @ericsnowcurrently
Lib/test/test_interpreters/ @ericsnowcurrently
Modules/_interp*module.c @ericsnowcurrently
# Template string literals (t-strings)
Lib/test/test_tstring.py @lysnikolaou
Objects/interpolationobject.c @lysnikolaou
Objects/templateobject.c @lysnikolaou
# Tests
Lib/test/test_patma.py @brandtbucher
Lib/test/test_type_*.py @JelleZijlstra
Lib/test/test_capi/test_misc.py @markshannon
# ----------------------------------------------------------------------------
# Standard Library
# ----------------------------------------------------------------------------
# Annotationlib
Doc/library/annotationlib.rst @JelleZijlstra
Lib/annotationlib.py @JelleZijlstra
Lib/test/test_annotationlib.py @JelleZijlstra
# Argparse
Doc/**/argparse*.rst @savannahostrowski
Lib/argparse.py @savannahostrowski
Lib/test/test_argparse.py @savannahostrowski
# Asyncio
Doc/library/asyncio*.rst @1st1 @asvetlov @kumaraditya303 @willingc
InternalDocs/asyncio.md @1st1 @asvetlov @kumaraditya303 @willingc @AA-Turner
Lib/asyncio/ @1st1 @asvetlov @kumaraditya303 @willingc
Lib/test/test_asyncio/ @1st1 @asvetlov @kumaraditya303 @willingc
Modules/_asynciomodule.c @1st1 @asvetlov @kumaraditya303 @willingc
# Bisect
Doc/library/bisect.rst @rhettinger
Lib/bisect.py @rhettinger
Lib/test/test_bisect.py @rhettinger
Modules/_bisectmodule.c @rhettinger
# Calendar
Lib/calendar.py @AA-Turner
Lib/test/test_calendar.py @AA-Turner
# Cryptographic Primitives and Applications
**/*hashlib* @gpshead @picnixz
**/*hashopenssl* @gpshead @picnixz
**/*hmac* @gpshead @picnixz
**/*ssl* @gpshead @picnixz
Modules/_hacl/ @gpshead @picnixz
Modules/*blake* @gpshead @picnixz
Modules/*md5* @gpshead @picnixz
Modules/*sha* @gpshead @picnixz
# Codecs
Modules/cjkcodecs/ @corona10
Tools/unicode/gencjkcodecs.py @corona10
# Collections
Doc/library/collections.abc.rst @rhettinger
Doc/library/collections.rst @rhettinger
Lib/_collections_abc.py @rhettinger
Lib/collections/ @rhettinger
Lib/test/test_collections.py @rhettinger
Modules/_collectionsmodule.c @rhettinger
# Colorize
Lib/_colorize.py @hugovk
Lib/test/test__colorize.py @hugovk
# Config Parser
Lib/configparser.py @jaraco
Lib/test/test_configparser.py @jaraco
# Dataclasses
Doc/library/dataclasses.rst @ericvsmith
Lib/dataclasses.py @ericvsmith
Lib/test/test_dataclasses/ @ericvsmith
Doc/c-api/module.rst @ericsnowcurrently
**/*importlib/resources/* @jaraco @warsaw @FFY00
**/*importlib/metadata/* @jaraco @warsaw
# Dates and times
Doc/**/*time.rst @pganssle @abalkin
Doc/library/zoneinfo.rst @pganssle
Include/datetime.h @pganssle @abalkin
Include/internal/pycore_time.h @pganssle @abalkin
Lib/test/test_zoneinfo/ @pganssle
Lib/zoneinfo/ @pganssle
Lib/*time.py @pganssle @abalkin
Lib/test/datetimetester.py @pganssle @abalkin
Lib/test/test_*time.py @pganssle @abalkin
Modules/*zoneinfo* @pganssle
Modules/*time* @pganssle @abalkin
Python/pytime.c @pganssle @abalkin
# Dbm
Doc/library/dbm.rst @corona10 @erlend-aasland @serhiy-storchaka
Lib/dbm/ @corona10 @erlend-aasland @serhiy-storchaka
Lib/test/test_dbm*.py @corona10 @erlend-aasland @serhiy-storchaka
Modules/*dbm* @corona10 @erlend-aasland @serhiy-storchaka
**/*datetime* @pganssle @abalkin
**/*str*time* @pganssle @abalkin
Doc/library/time.rst @pganssle @abalkin
Lib/test/test_time.py @pganssle @abalkin
Modules/timemodule.c @pganssle @abalkin
Python/pytime.c @pganssle @abalkin
Include/internal/pycore_time.h @pganssle @abalkin
# Email and related
**/*mail* @python/email-team
@ -439,197 +173,178 @@ Modules/*dbm* @corona10 @erlend-aasland @serhiy-storchaka
**/*imap* @python/email-team
**/*poplib* @python/email-team
# Ensurepip
Doc/library/ensurepip.rst @pfmoore @pradyunsg
Lib/ensurepip/ @pfmoore @pradyunsg
Lib/test/test_ensurepip.py @pfmoore @pradyunsg
# Enum
Doc/howto/enum.rst @ethanfurman
Doc/library/enum.rst @ethanfurman
Lib/enum.py @ethanfurman
Lib/test/test_enum.py @ethanfurman
Lib/test/test_json/test_enum.py @ethanfurman
# FTP
Doc/library/ftplib.rst @giampaolo
Lib/ftplib.py @giampaolo
Lib/test/test_ftplib.py @giampaolo
# Functools
Doc/library/functools.rst @rhettinger
Lib/functools.py @rhettinger
Lib/test/test_functools.py @rhettinger
Modules/_functoolsmodule.c @rhettinger
# Exclude .mailmap from being owned by @python/email-team
/.mailmap
# Garbage collector
Modules/gcmodule.c @pablogsal
Doc/library/gc.rst @pablogsal
/Modules/gcmodule.c @pablogsal
/Doc/library/gc.rst @pablogsal
# Gettext
Doc/library/gettext.rst @tomasr8
Lib/gettext.py @tomasr8
Lib/test/test_gettext.py @tomasr8
Tools/i18n/pygettext.py @tomasr8
# Parser
/Parser/ @pablogsal @lysnikolaou
/Tools/peg_generator/ @pablogsal @lysnikolaou
/Lib/test/test_peg_generator/ @pablogsal @lysnikolaou
/Grammar/python.gram @pablogsal @lysnikolaou
/Lib/tokenize.py @pablogsal @lysnikolaou
/Lib/test/test_tokenize.py @pablogsal @lysnikolaou
# Heapq
Doc/library/heapq* @rhettinger
Lib/heapq.py @rhettinger
Lib/test/test_heapq.py @rhettinger
Modules/_heapqmodule.c @rhettinger
# Code generator
/Tools/cases_generator/ @markshannon
# HTML
Doc/library/html* @ezio-melotti
Lib/html/ @ezio-melotti
Lib/_markupbase.py @ezio-melotti
Lib/test/test_html*.py @ezio-melotti
Tools/build/parse_html5_entities.py @ezio-melotti
# AST
Python/ast.c @isidentical @JelleZijlstra @eclips4
Python/ast_preprocess.c @isidentical @eclips4
Parser/asdl.py @isidentical @JelleZijlstra @eclips4
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4
Lib/ast.py @isidentical @JelleZijlstra @eclips4
Lib/_ast_unparse.py @isidentical @JelleZijlstra @eclips4
Lib/test/test_ast/ @eclips4
# IDLE
Doc/library/idle.rst @terryjreedy
Lib/idlelib/ @terryjreedy
Lib/turtledemo/ @terryjreedy
# Mock
/Lib/unittest/mock.py @cjw296
/Lib/test/test_unittest/testmock/* @cjw296
# importlib.metadata
Doc/library/importlib.metadata.rst @jaraco @warsaw
Lib/importlib/metadata/ @jaraco @warsaw
Lib/test/test_importlib/metadata/ @jaraco @warsaw
# importlib.resources
Doc/library/importlib.resources.abc.rst @jaraco @warsaw
Doc/library/importlib.resources.rst @jaraco @warsaw
Lib/importlib/resources/ @jaraco @warsaw @FFY00
Lib/test/test_importlib/resources/ @jaraco @warsaw @FFY00
# Itertools
Doc/library/itertools.rst @rhettinger
Lib/test/test_itertools.py @rhettinger
Modules/itertoolsmodule.c @rhettinger
# Logging
Doc/**/logging* @vsajip
Lib/logging/ @vsajip
Lib/test/test_logging.py @vsajip
# Multiprocessing
Doc/library/multiprocessing*.rst @gpshead
Lib/multiprocessing/ @gpshead
Lib/test/*multiprocessing.py @gpshead
Lib/test/test_multiprocessing*/ @gpshead
Modules/_multiprocessing/ @gpshead
# Pathlib
Doc/library/pathlib.rst @barneygale
Lib/pathlib/ @barneygale
Lib/test/test_pathlib/ @barneygale
# Pdb & Bdb
Doc/library/bdb.rst @gaogaotiantian
Doc/library/pdb.rst @gaogaotiantian
Lib/bdb.py @gaogaotiantian
Lib/pdb.py @gaogaotiantian
Lib/test/test_bdb.py @gaogaotiantian
Lib/test/test_pdb.py @gaogaotiantian
Lib/test/test_remote_pdb.py @gaogaotiantian
# Pydoc
Lib/pydoc.py @AA-Turner
Lib/pydoc_data/ @AA-Turner
Lib/test/test_pydoc/ @AA-Turner
# PyREPL
Lib/_pyrepl/ @pablogsal @lysnikolaou @ambv
Lib/test/test_pyrepl/ @pablogsal @lysnikolaou @ambv
# Random
Doc/library/random.rst @rhettinger
Lib/random.py @rhettinger
Lib/test/test_random.py @rhettinger
Modules/_randommodule.c @rhettinger
# Shutil
Doc/library/shutil.rst @giampaolo
Lib/shutil.py @giampaolo
Lib/test/test_shutil.py @giampaolo
# Site
Lib/site.py @FFY00
Lib/test/test_site.py @FFY00
Doc/library/site.rst @FFY00
# string.templatelib
Doc/library/string.templatelib.rst @lysnikolaou @AA-Turner
Lib/string/templatelib.py @lysnikolaou @AA-Turner
Lib/test/test_string/test_templatelib.py @lysnikolaou @AA-Turner
# Sysconfig
**/*sysconfig* @FFY00
# multiprocessing
**/*multiprocessing* @gpshead
# SQLite 3
Doc/library/sqlite3.rst @berkerpeksag @erlend-aasland
Lib/sqlite3/ @berkerpeksag @erlend-aasland
Lib/test/test_sqlite3/ @berkerpeksag @erlend-aasland
Modules/_sqlite/ @berkerpeksag @erlend-aasland
**/*sqlite* @berkerpeksag @erlend-aasland
# Subprocess
Lib/subprocess.py @gpshead
Lib/test/test_subprocess.py @gpshead
Modules/*subprocess* @gpshead
# subprocess
/Lib/subprocess.py @gpshead
/Lib/test/test_subprocess.py @gpshead
/Modules/*subprocess* @gpshead
# Tarfile
Doc/library/tarfile.rst @ethanfurman
Lib/tarfile.py @ethanfurman
Lib/test/test_tarfile.py @ethanfurman
# debugger
**/*pdb* @gaogaotiantian
**/*bdb* @gaogaotiantian
# TOML
Doc/library/tomllib.rst @encukou @hauntsaninja
Lib/test/test_tomllib/ @encukou @hauntsaninja
Lib/tomllib/ @encukou @hauntsaninja
# Limited C API & stable ABI
Tools/build/stable_abi.py @encukou
Misc/stable_abi.toml @encukou
Doc/data/*.abi @encukou
Doc/c-api/stable.rst @encukou
# Typing
Doc/library/typing.rst @JelleZijlstra @AlexWaygood
Lib/test/test_typing.py @JelleZijlstra @AlexWaygood
Lib/test/typinganndata/ @JelleZijlstra @AlexWaygood
Lib/typing.py @JelleZijlstra @AlexWaygood
Modules/_typingmodule.c @JelleZijlstra @AlexWaygood
# Types
Lib/test/test_types.py @AA-Turner
Lib/types.py @AA-Turner
Modules/_typesmodule.c @AA-Turner
# Unittest
Lib/unittest/mock.py @cjw296
Lib/test/test_unittest/testmock/ @cjw296
# Windows
/PC/ @python/windows-team
/PCbuild/ @python/windows-team
# Urllib
**/*robotparser* @berkerpeksag
# Venv
**/*venv* @vsajip @FFY00
# Windows installer packages
/Tools/msi/ @python/windows-team
/Tools/nuget/ @python/windows-team
# Misc
**/*itertools* @rhettinger
**/*collections* @rhettinger
**/*random* @rhettinger
**/*bisect* @rhettinger
**/*heapq* @rhettinger
**/*functools* @rhettinger
**/*dataclasses* @ericvsmith
**/*ensurepip* @pfmoore @pradyunsg
/Doc/library/idle.rst @terryjreedy
**/*idlelib* @terryjreedy
**/*turtledemo* @terryjreedy
**/*annotationlib* @JelleZijlstra
**/*typing* @JelleZijlstra @AlexWaygood
**/*ftplib @giampaolo
**/*shutil @giampaolo
**/*enum* @ethanfurman
**/*cgi* @ethanfurman
**/*tarfile* @ethanfurman
**/*tomllib* @encukou @hauntsaninja
**/*sysconfig* @FFY00
**/*cjkcodecs* @corona10
# macOS
/Mac/ @python/macos-team
**/*osx_support* @python/macos-team
# pathlib
**/*pathlib* @barneygale
# zipfile.Path
**/*zipfile/_path/* @jaraco
# Argument Clinic
/Tools/clinic/** @erlend-aasland
/Lib/test/test_clinic.py @erlend-aasland
Doc/howto/clinic.rst @erlend-aasland
# Subinterpreters
**/*interpreteridobject.* @ericsnowcurrently
**/*crossinterp* @ericsnowcurrently
Modules/_interp*module.c @ericsnowcurrently
Lib/test/test__interp*.py @ericsnowcurrently
Lib/concurrent/interpreters/ @ericsnowcurrently
Lib/test/support/channels.py @ericsnowcurrently
Doc/library/concurrent.interpreters.rst @ericsnowcurrently
Lib/test/test_interpreters/ @ericsnowcurrently
Lib/concurrent/futures/interpreter.py @ericsnowcurrently
# Android
**/*Android* @mhsmith @freakboy3742
**/*android* @mhsmith @freakboy3742
# Apple
/Apple @freakboy3742
# iOS (but not termios)
**/iOS* @freakboy3742
**/ios* @freakboy3742
**/*_iOS* @freakboy3742
**/*_ios* @freakboy3742
**/*-iOS* @freakboy3742
**/*-ios* @freakboy3742
# WebAssembly
Tools/wasm/config.site-wasm32-emscripten @freakboy3742
/Tools/wasm/README.md @brettcannon @freakboy3742
/Tools/wasm/wasi-env @brettcannon
/Tools/wasm/wasi_build.py @brettcannon
/Tools/wasm/emscripten @freakboy3742
/Tools/wasm/wasi @brettcannon
# SBOM
/Misc/externals.spdx.json @sethmlarson
/Misc/sbom.spdx.json @sethmlarson
/Tools/build/generate_sbom.py @sethmlarson
# Config Parser
Lib/configparser.py @jaraco
Lib/test/test_configparser.py @jaraco
# Doc sections
Doc/reference/ @willingc @AA-Turner
# Weakref
**/*weakref* @kumaraditya303
# Zipfile.Path
Lib/test/test_zipfile/_path/ @jaraco
Lib/zipfile/_path/ @jaraco
# Colorize
Lib/_colorize.py @hugovk
Lib/test/test__colorize.py @hugovk
# Zstandard
Lib/compression/zstd/ @AA-Turner @emmatyping
Lib/test/test_zstd.py @AA-Turner @emmatyping
Modules/_zstd/ @AA-Turner @emmatyping
# Fuzzing
Modules/_xxtestfuzz/ @ammaraskar
# ----------------------------------------------------------------------------
# t-strings
**/*interpolationobject* @lysnikolaou
**/*templateobject* @lysnikolaou
**/*templatelib* @lysnikolaou
**/*tstring* @lysnikolaou
# Exclusions from .github/CODEOWNERS should go at the very end
# because the final matching pattern will take precedence.
# Exclude .mailmap from being owned by @python/email-team
.mailmap
# Exclude Argument Clinic directories
Modules/**/clinic/
Objects/**/clinic/
PC/**/clinic/
Python/**/clinic/
# Remote debugging
Python/remote_debug.h @pablogsal
Python/remote_debugging.c @pablogsal
Modules/_remote_debugging_module.c @pablogsal @ambv @1st1

View file

@ -4,7 +4,7 @@ Contributing to Python
Build Status
------------
- `Buildbot status overview <https://buildbot.python.org/#/release_status>`_
- `Buildbot status overview <https://buildbot.python.org/all/#/release_status>`_
- `GitHub Actions status <https://github.com/python/cpython/actions/workflows/build.yml>`_
@ -28,23 +28,23 @@ Please be aware that our workflow does deviate slightly from the typical GitHub
project. Details on how to properly submit a pull request are covered in
`Lifecycle of a Pull Request <https://devguide.python.org/getting-started/pull-request-lifecycle.html>`_.
We utilize various bots and status checks to help with this, so do follow the
comments they leave and their "Details" links, respectively.
comments they leave and their "Details" links, respectively. The key points of
our workflow that are not covered by a bot or status check are:
The final key part of our workflow is that all discussions that are not
directly related to the code in the pull request should happen on
`GitHub Issues <https://github.com/python/cpython/issues>`__, generally in the
pull request's parent issue.
- All discussions that are not directly related to the code in the pull request
should happen on `GitHub Issues <https://github.com/python/cpython/issues>`_.
- Upon your first non-trivial pull request (which includes documentation changes),
feel free to add yourself to ``Misc/ACKS``
Setting Expectations
--------------------
Due to the fact that this project is run by volunteers,
unfortunately we cannot make any guarantees as to if
Due to the fact that this project is entirely volunteer-run (i.e. no one is paid
to work on Python full-time), we unfortunately can make no guarantees as to if
or when a core developer will get around to reviewing your pull request.
If no core developer has done a review or responded to changes made because of a
"changes requested" review within a month, you can ask for someone to
review your pull request via a post in the `Core Development Discourse
category <https://discuss.python.org/c/core-dev/23>`__.
"changes requested" review, please feel free to email python-dev to ask if
someone could take a look at your pull request.
Code of Conduct

View file

@ -40,7 +40,6 @@ body:
- "3.12"
- "3.13"
- "3.14"
- "3.15"
- "CPython main branch"
validations:
required: true

View file

@ -5,6 +5,3 @@ contact_links:
- name: "Proposing new features"
about: "Submit major feature proposal (e.g. syntax changes) to an ideas forum first."
url: "https://discuss.python.org/c/ideas/6"
- name: "Python Install Manager issues"
about: "Report issues with the Python Install Manager (for Windows)"
url: "https://github.com/python/pymanager/issues"

View file

@ -33,7 +33,6 @@ body:
- "3.12"
- "3.13"
- "3.14"
- "3.15"
- "CPython main branch"
validations:
required: true

View file

@ -12,11 +12,6 @@ updates:
update-types:
- "version-update:semver-minor"
- "version-update:semver-patch"
cooldown:
# https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
# Cooldowns protect against supply chain attacks by avoiding the
# highest-risk window immediately after new releases.
default-days: 14
- package-ecosystem: "pip"
directory: "/Tools/"
schedule:
@ -24,5 +19,3 @@ updates:
labels:
- "skip issue"
- "skip news"
cooldown:
default-days: 14

View file

@ -49,6 +49,53 @@ jobs:
if: fromJSON(needs.build-context.outputs.run-docs)
uses: ./.github/workflows/reusable-docs.yml
check-abi:
name: 'Check if the ABI has changed'
runs-on: ubuntu-22.04 # 24.04 causes spurious errors
needs: build-context
if: needs.build-context.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo ./.github/workflows/posix-deps-apt.sh
sudo apt-get install -yq abigail-tools
- name: Build CPython
env:
CFLAGS: -g3 -O0
run: |
# Build Python with the libpython dynamic library
./configure --enable-shared
make -j4
- name: Check for changes in the ABI
id: check
run: |
if ! make check-abidump; then
echo "Generated ABI file is not up to date."
echo "Please add the release manager of this branch as a reviewer of this PR."
echo ""
echo "The up to date ABI file should be attached to this build as an artifact."
echo ""
echo "To learn more about this check: https://devguide.python.org/getting-started/setup-building/index.html#regenerate-the-abi-dump"
echo ""
exit 1
fi
- name: Generate updated ABI files
if: ${{ failure() && steps.check.conclusion == 'failure' }}
run: |
make regen-abidump
- uses: actions/upload-artifact@v4
name: Publish updated ABI files
if: ${{ failure() && steps.check.conclusion == 'failure' }}
with:
name: abi-data
path: ./Doc/data/*.abi
check-autoconf-regen:
name: 'Check if Autoconf files are up to date'
# Don't use ubuntu-latest but a specific version to make the job
@ -142,9 +189,6 @@ jobs:
- name: Check for unsupported C global variables
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
run: make check-c-globals
- name: Check for undocumented C APIs
run: make check-c-api-docs
build-windows:
name: >-
@ -243,7 +287,7 @@ jobs:
free-threading: ${{ matrix.free-threading }}
os: ${{ matrix.os }}
build-ubuntu-ssltests-openssl:
build-ubuntu-ssltests:
name: 'Ubuntu SSL tests with OpenSSL'
runs-on: ${{ matrix.os }}
timeout-minutes: 60
@ -299,72 +343,6 @@ jobs:
- name: SSL tests
run: ./python Lib/test/ssltests.py
build-ubuntu-ssltests-awslc:
name: 'Ubuntu SSL tests with AWS-LC'
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: build-context
if: needs.build-context.outputs.run-tests == 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
awslc_ver: [1.55.0]
env:
AWSLC_VER: ${{ matrix.awslc_ver}}
MULTISSL_DIR: ${{ github.workspace }}/multissl
OPENSSL_DIR: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}/lib
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Runner image version
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Configure SSL lib env vars
run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}/lib" >> "$GITHUB_ENV"
- name: 'Restore AWS-LC build'
id: cache-aws-lc
uses: actions/cache@v4
with:
path: ./multissl/aws-lc/${{ matrix.awslc_ver }}
key: ${{ matrix.os }}-multissl-aws-lc-${{ matrix.awslc_ver }}
- name: Install AWS-LC
if: steps.cache-aws-lc.outputs.cache-hit != 'true'
run: |
python3 Tools/ssl/multissltests.py \
--steps=library \
--base-directory "$MULTISSL_DIR" \
--awslc ${{ matrix.awslc_ver }} \
--system Linux
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: Configure CPython
run: |
./configure CFLAGS="-fdiagnostics-format=json" \
--config-cache \
--enable-slower-safety \
--with-pydebug \
--with-openssl="$OPENSSL_DIR" \
--with-builtin-hashlib-hashes=blake2 \
--with-ssl-default-suites=openssl
- name: Build CPython
run: make -j
- name: Display build info
run: make pythoninfo
- name: Verify python is linked to AWS-LC
run: ./python -c 'import ssl; print(ssl.OPENSSL_VERSION)' | grep AWS-LC
- name: SSL tests
run: ./python Lib/test/ssltests.py
build-android:
name: Android (${{ matrix.arch }})
needs: build-context
@ -689,8 +667,7 @@ jobs:
- build-windows-msi
- build-macos
- build-ubuntu
- build-ubuntu-ssltests-awslc
- build-ubuntu-ssltests-openssl
- build-ubuntu-ssltests
- build-android
- build-ios
- build-wasi
@ -707,8 +684,7 @@ jobs:
with:
allowed-failures: >-
build-windows-msi,
build-ubuntu-ssltests-awslc,
build-ubuntu-ssltests-openssl,
build-ubuntu-ssltests,
test-hypothesis,
cifuzz,
allowed-skips: >-
@ -726,8 +702,7 @@ jobs:
check-generated-files,
build-macos,
build-ubuntu,
build-ubuntu-ssltests-awslc,
build-ubuntu-ssltests-openssl,
build-ubuntu-ssltests,
build-android,
build-ios,
build-wasi,

View file

@ -5,8 +5,6 @@ on:
- '**jit**'
- 'Python/bytecodes.c'
- 'Python/optimizer*.c'
- 'Python/executor_cases.c.h'
- 'Python/optimizer_cases.c.h'
- '!Python/perf_jit_trampoline.c'
- '!**/*.md'
- '!**/*.ini'
@ -15,8 +13,6 @@ on:
- '**jit**'
- 'Python/bytecodes.c'
- 'Python/optimizer*.c'
- 'Python/executor_cases.c.h'
- 'Python/optimizer_cases.c.h'
- '!Python/perf_jit_trampoline.c'
- '!**/*.md'
- '!**/*.ini'
@ -68,7 +64,7 @@ jobs:
- true
- false
llvm:
- 21
- 19
include:
- target: i686-pc-windows-msvc/msvc
architecture: Win32
@ -129,61 +125,33 @@ jobs:
make all --jobs 4
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
jit-with-disabled-gil:
name: Free-Threaded (Debug)
needs: interpreter
runs-on: ubuntu-24.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
llvm:
- 21
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build with JIT enabled and GIL disabled
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
./configure --enable-experimental-jit --with-pydebug --disable-gil
make all --jobs 4
- name: Run tests
run: |
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
continue-on-error: true
no-opt-jit:
name: JIT without optimizations (Debug)
needs: interpreter
runs-on: ubuntu-24.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
llvm:
- 21
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build with JIT
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
./configure --enable-experimental-jit --with-pydebug
make all --jobs 4
- name: Run tests without optimizations
run: |
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
# XXX: GH-133171
# jit-with-disabled-gil:
# name: Free-Threaded (Debug)
# needs: interpreter
# runs-on: ubuntu-24.04
# timeout-minutes: 90
# strategy:
# fail-fast: false
# matrix:
# llvm:
# - 19
# steps:
# - uses: actions/checkout@v4
# with:
# persist-credentials: false
# - uses: actions/setup-python@v5
# with:
# python-version: '3.11'
# - name: Build with JIT enabled and GIL disabled
# run: |
# sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
# export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
# ./configure --enable-experimental-jit --with-pydebug --disable-gil
# make all --jobs 4
# - name: Run tests
# run: |
# ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
tail-call-jit:
name: JIT with tail calling interpreter
needs: interpreter
@ -193,7 +161,7 @@ jobs:
fail-fast: false
matrix:
llvm:
- 21
- 19
steps:
- uses: actions/checkout@v4
with:

View file

@ -16,7 +16,6 @@ on:
- "Tools/build/check_extension_modules.py"
- "Tools/build/check_warnings.py"
- "Tools/build/compute-changes.py"
- "Tools/build/consts_getter.py"
- "Tools/build/deepfreeze.py"
- "Tools/build/generate-build-details.py"
- "Tools/build/generate_sbom.py"

View file

@ -5,7 +5,6 @@ apt-get -yq install \
build-essential \
pkg-config \
ccache \
cmake \
gdb \
lcov \
libb2-dev \
@ -26,10 +25,3 @@ apt-get -yq install \
uuid-dev \
xvfb \
zlib1g-dev
# Workaround missing libmpdec-dev on ubuntu 24.04:
# https://launchpad.net/~ondrej/+archive/ubuntu/php
# https://deb.sury.org/
sudo add-apt-repository ppa:ondrej/php
apt-get update
apt-get -yq install libmpdec-dev

31
.github/workflows/project-updater.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Update GH projects
on:
issues:
types:
- opened
- labeled
permissions:
contents: read
jobs:
add-to-project:
name: Add issues to projects
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
# if an issue has any of these labels, it will be added
# to the corresponding project
- { project: 2, label: "release-blocker, deferred-blocker" }
- { project: 32, label: sprint }
steps:
- uses: actions/add-to-project@v1.0.0
with:
project-url: https://github.com/orgs/python/projects/${{ matrix.project }}
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: ${{ matrix.label }}

View file

@ -35,9 +35,9 @@ jobs:
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
- name: Install Homebrew dependencies
run: |
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@9 make
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8 make
# Because alternate versions are not symlinked into place by default:
brew link --overwrite tcl-tk@9
brew link --overwrite tcl-tk@8
- name: Configure CPython
run: |
MACOSX_DEPLOYMENT_TARGET=10.15 \

View file

@ -9,11 +9,11 @@ env:
jobs:
build-wasi-reusable:
name: 'build and test'
runs-on: ubuntu-24.04-arm
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
WASMTIME_VERSION: 38.0.3
WASI_SDK_VERSION: 29
WASMTIME_VERSION: 22.0.0
WASI_SDK_VERSION: 24
WASI_SDK_PATH: /opt/wasi-sdk
CROSS_BUILD_PYTHON: cross-build/build
CROSS_BUILD_WASI: cross-build/wasm32-wasip1
@ -36,7 +36,7 @@ jobs:
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
run: |
mkdir "${WASI_SDK_PATH}" && \
curl -s -S --location "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-arm64-linux.tar.gz" | \
curl -s -S --location "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz" | \
tar --strip-components 1 --directory "${WASI_SDK_PATH}" --extract --gunzip
- name: "Add ccache to PATH"
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"

5
.gitignore vendored
View file

@ -130,7 +130,6 @@ Tools/unicode/data/
/autom4te.cache
/build/
/builddir/
/compile_commands.json
/config.cache
/config.log
/config.status
@ -173,7 +172,3 @@ Python/frozen_modules/MANIFEST
# People's custom https://docs.anthropic.com/en/docs/claude-code/memory configs.
/.claude/
CLAUDE.local.md
#### main branch only stuff below this line, things to backport go above. ####
# main branch only: ABI files are not checked/maintained.
Doc/data/python*.abi

View file

@ -1 +0,0 @@
https://www.python.org/funding.json

View file

@ -29,7 +29,6 @@
ANDROID_DIR.name == "Android" and (PYTHON_DIR / "pyconfig.h.in").exists()
)
ENV_SCRIPT = ANDROID_DIR / "android-env.sh"
TESTBED_DIR = ANDROID_DIR / "testbed"
CROSS_BUILD_DIR = PYTHON_DIR / "cross-build"
@ -130,11 +129,12 @@ def android_env(host):
sysconfig_filename = next(sysconfig_files).name
host = re.fullmatch(r"_sysconfigdata__android_(.+).py", sysconfig_filename)[1]
env_script = ANDROID_DIR / "android-env.sh"
env_output = subprocess.run(
f"set -eu; "
f"HOST={host}; "
f"PREFIX={prefix}; "
f". {ENV_SCRIPT}; "
f". {env_script}; "
f"export",
check=True, shell=True, capture_output=True, encoding='utf-8',
).stdout
@ -151,7 +151,7 @@ def android_env(host):
env[key] = value
if not env:
raise ValueError(f"Found no variables in {ENV_SCRIPT.name} output:\n"
raise ValueError(f"Found no variables in {env_script.name} output:\n"
+ env_output)
return env
@ -281,30 +281,15 @@ def clean_all(context):
def setup_ci():
if "GITHUB_ACTIONS" in os.environ:
# Enable emulator hardware acceleration
# (https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/).
if platform.system() == "Linux":
run(
["sudo", "tee", "/etc/udev/rules.d/99-kvm4all.rules"],
input='KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"\n',
text=True,
)
run(["sudo", "udevadm", "control", "--reload-rules"])
run(["sudo", "udevadm", "trigger", "--name-match=kvm"])
# Free up disk space by deleting unused versions of the NDK
# (https://github.com/freakboy3742/pyspamsum/pull/108).
for line in ENV_SCRIPT.read_text().splitlines():
if match := re.fullmatch(r"ndk_version=(.+)", line):
ndk_version = match[1]
break
else:
raise ValueError(f"Failed to find NDK version in {ENV_SCRIPT.name}")
for item in (android_home / "ndk").iterdir():
if item.name[0].isdigit() and item.name != ndk_version:
delete_glob(item)
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
if "GITHUB_ACTIONS" in os.environ and platform.system() == "Linux":
run(
["sudo", "tee", "/etc/udev/rules.d/99-kvm4all.rules"],
input='KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"\n',
text=True,
)
run(["sudo", "udevadm", "control", "--reload-rules"])
run(["sudo", "udevadm", "trigger", "--name-match=kvm"])
def setup_sdk():

View file

@ -79,7 +79,7 @@ android {
val androidEnvFile = file("../../android-env.sh").absoluteFile
namespace = "org.python.testbed"
compileSdk = 35
compileSdk = 34
defaultConfig {
applicationId = "org.python.testbed"
@ -92,7 +92,7 @@ android {
}
throw GradleException("Failed to find API level in $androidEnvFile")
}
targetSdk = 35
targetSdk = 34
versionCode = 1
versionName = "1.0"

View file

@ -32,9 +32,8 @@ Contributors to the Python documentation
----------------------------------------
Many people have contributed to the Python language, the Python standard
library, and the Python documentation. See the `CPython
GitHub repository <https://github.com/python/cpython/graphs/contributors>`__
for a partial list of contributors.
library, and the Python documentation. See :source:`Misc/ACKS` in the Python
source distribution for a partial list of contributors.
It is only with the input and contributions of the Python community
that Python has such wonderful documentation -- Thank You!

View file

@ -43,8 +43,8 @@ tracker <https://github.com/python/python-docs-theme>`_.
`Helping with Documentation <https://devguide.python.org/docquality/#helping-with-documentation>`_
Comprehensive guide for individuals that are interested in contributing to Python documentation.
`Documentation Translations <https://devguide.python.org/documentation/translations/translating/#translation-coordinators>`_
A list of GitHub pages for documentation translation and their coordination teams.
`Documentation Translations <https://devguide.python.org/documentation/translating/>`_
A list of GitHub pages for documentation translation and their primary contacts.
.. _using-the-tracker:

View file

@ -237,11 +237,9 @@ the Python object to the required type.
For signed integer formats, :exc:`OverflowError` is raised if the value
is out of range for the C type.
For unsigned integer formats, the
For unsigned integer formats, no range checking is done --- the
most significant bits are silently truncated when the receiving field is too
small to receive the value, and :exc:`DeprecationWarning` is emitted when
the value is larger than the maximal value for the C type or less than
the minimal value for the corresponding signed integer type of the same size.
small to receive the value.
``b`` (:class:`int`) [unsigned char]
Convert a nonnegative Python integer to an unsigned tiny integer, stored in a C
@ -250,25 +248,27 @@ the minimal value for the corresponding signed integer type of the same size.
``B`` (:class:`int`) [unsigned char]
Convert a Python integer to a tiny integer without overflow checking, stored in a C
:c:expr:`unsigned char`.
Convert a Python integer to a C :c:expr:`unsigned char`.
``h`` (:class:`int`) [short int]
Convert a Python integer to a C :c:expr:`short int`.
``H`` (:class:`int`) [unsigned short int]
Convert a Python integer to a C :c:expr:`unsigned short int`.
Convert a Python integer to a C :c:expr:`unsigned short int`, without overflow
checking.
``i`` (:class:`int`) [int]
Convert a Python integer to a plain C :c:expr:`int`.
``I`` (:class:`int`) [unsigned int]
Convert a Python integer to a C :c:expr:`unsigned int`.
Convert a Python integer to a C :c:expr:`unsigned int`, without overflow
checking.
``l`` (:class:`int`) [long int]
Convert a Python integer to a C :c:expr:`long int`.
``k`` (:class:`int`) [unsigned long]
Convert a Python integer to a C :c:expr:`unsigned long`.
Convert a Python integer to a C :c:expr:`unsigned long` without
overflow checking.
.. versionchanged:: 3.14
Use :meth:`~object.__index__` if available.
@ -277,7 +277,8 @@ the minimal value for the corresponding signed integer type of the same size.
Convert a Python integer to a C :c:expr:`long long`.
``K`` (:class:`int`) [unsigned long long]
Convert a Python integer to a C :c:expr:`unsigned long long`.
Convert a Python integer to a C :c:expr:`unsigned long long`
without overflow checking.
.. versionchanged:: 3.14
Use :meth:`~object.__index__` if available.
@ -305,14 +306,6 @@ the minimal value for the corresponding signed integer type of the same size.
``D`` (:class:`complex`) [Py_complex]
Convert a Python complex number to a C :c:type:`Py_complex` structure.
.. deprecated:: 3.15
For unsigned integer formats ``B``, ``H``, ``I``, ``k`` and ``K``,
:exc:`DeprecationWarning` is emitted when the value is larger than
the maximal value for the C type or less than the minimal value for
the corresponding signed integer type of the same size.
Other objects
-------------

View file

@ -47,10 +47,6 @@ called with a non-bytes parameter.
*len* on success, and ``NULL`` on failure. If *v* is ``NULL``, the contents of
the bytes object are uninitialized.
.. deprecated:: 3.15
``PyBytes_FromStringAndSize(NULL, len)`` is :term:`soft deprecated`,
use the :c:type:`PyBytesWriter` API instead.
.. c:function:: PyObject* PyBytes_FromFormat(const char *format, ...)
@ -224,10 +220,6 @@ called with a non-bytes parameter.
*\*bytes* is set to ``NULL``, :exc:`MemoryError` is set, and ``-1`` is
returned.
.. deprecated:: 3.15
The function is :term:`soft deprecated`,
use the :c:type:`PyBytesWriter` API instead.
.. c:function:: PyObject *PyBytes_Repr(PyObject *bytes, int smartquotes)
@ -262,170 +254,3 @@ called with a non-bytes parameter.
.. versionchanged:: 3.9
*unicode* and *recode_encoding* are now unused.
.. _pybyteswriter:
PyBytesWriter
-------------
The :c:type:`PyBytesWriter` API can be used to create a Python :class:`bytes`
object.
.. versionadded:: 3.15
.. c:type:: PyBytesWriter
A bytes writer instance.
The API is **not thread safe**: a writer should only be used by a single
thread at the same time.
The instance must be destroyed by :c:func:`PyBytesWriter_Finish` on
success, or :c:func:`PyBytesWriter_Discard` on error.
Create, Finish, Discard
^^^^^^^^^^^^^^^^^^^^^^^
.. c:function:: PyBytesWriter* PyBytesWriter_Create(Py_ssize_t size)
Create a :c:type:`PyBytesWriter` to write *size* bytes.
If *size* is greater than zero, allocate *size* bytes, and set the
writer size to *size*. The caller is responsible to write *size*
bytes using :c:func:`PyBytesWriter_GetData`.
This function does not overallocate.
On error, set an exception and return ``NULL``.
*size* must be positive or zero.
.. c:function:: PyObject* PyBytesWriter_Finish(PyBytesWriter *writer)
Finish a :c:type:`PyBytesWriter` created by
:c:func:`PyBytesWriter_Create`.
On success, return a Python :class:`bytes` object.
On error, set an exception and return ``NULL``.
The writer instance is invalid after the call in any case.
No API can be called on the writer after :c:func:`PyBytesWriter_Finish`.
.. c:function:: PyObject* PyBytesWriter_FinishWithSize(PyBytesWriter *writer, Py_ssize_t size)
Similar to :c:func:`PyBytesWriter_Finish`, but resize the writer
to *size* bytes before creating the :class:`bytes` object.
.. c:function:: PyObject* PyBytesWriter_FinishWithPointer(PyBytesWriter *writer, void *buf)
Similar to :c:func:`PyBytesWriter_Finish`, but resize the writer
using *buf* pointer before creating the :class:`bytes` object.
Set an exception and return ``NULL`` if *buf* pointer is outside the
internal buffer bounds.
Function pseudo-code::
Py_ssize_t size = (char*)buf - (char*)PyBytesWriter_GetData(writer);
return PyBytesWriter_FinishWithSize(writer, size);
.. c:function:: void PyBytesWriter_Discard(PyBytesWriter *writer)
Discard a :c:type:`PyBytesWriter` created by :c:func:`PyBytesWriter_Create`.
Do nothing if *writer* is ``NULL``.
The writer instance is invalid after the call.
No API can be called on the writer after :c:func:`PyBytesWriter_Discard`.
High-level API
^^^^^^^^^^^^^^
.. c:function:: int PyBytesWriter_WriteBytes(PyBytesWriter *writer, const void *bytes, Py_ssize_t size)
Grow the *writer* internal buffer by *size* bytes,
write *size* bytes of *bytes* at the *writer* end,
and add *size* to the *writer* size.
If *size* is equal to ``-1``, call ``strlen(bytes)`` to get the
string length.
On success, return ``0``.
On error, set an exception and return ``-1``.
.. c:function:: int PyBytesWriter_Format(PyBytesWriter *writer, const char *format, ...)
Similar to :c:func:`PyBytes_FromFormat`, but write the output directly at
the writer end. Grow the writer internal buffer on demand. Then add the
written size to the writer size.
On success, return ``0``.
On error, set an exception and return ``-1``.
Getters
^^^^^^^
.. c:function:: Py_ssize_t PyBytesWriter_GetSize(PyBytesWriter *writer)
Get the writer size.
.. c:function:: void* PyBytesWriter_GetData(PyBytesWriter *writer)
Get the writer data: start of the internal buffer.
The pointer is valid until :c:func:`PyBytesWriter_Finish` or
:c:func:`PyBytesWriter_Discard` is called on *writer*.
Low-level API
^^^^^^^^^^^^^
.. c:function:: int PyBytesWriter_Resize(PyBytesWriter *writer, Py_ssize_t size)
Resize the writer to *size* bytes. It can be used to enlarge or to
shrink the writer.
This function typically overallocates to achieve amortized performance when
resizing multiple times.
Newly allocated bytes are left uninitialized.
On success, return ``0``.
On error, set an exception and return ``-1``.
*size* must be positive or zero.
.. c:function:: int PyBytesWriter_Grow(PyBytesWriter *writer, Py_ssize_t grow)
Resize the writer by adding *grow* bytes to the current writer size.
This function typically overallocates to achieve amortized performance when
resizing multiple times.
Newly allocated bytes are left uninitialized.
On success, return ``0``.
On error, set an exception and return ``-1``.
*size* can be negative to shrink the writer.
.. c:function:: void* PyBytesWriter_GrowAndUpdatePointer(PyBytesWriter *writer, Py_ssize_t size, void *buf)
Similar to :c:func:`PyBytesWriter_Grow`, but update also the *buf*
pointer.
The *buf* pointer is moved if the internal buffer is moved in memory.
The *buf* relative position within the internal buffer is left
unchanged.
On error, set an exception and return ``NULL``.
*buf* must not be ``NULL``.
Function pseudo-code::
Py_ssize_t pos = (char*)buf - (char*)PyBytesWriter_GetData(writer);
if (PyBytesWriter_Grow(writer, size) < 0) {
return NULL;
}
return (char*)PyBytesWriter_GetData(writer) + pos;

View file

@ -3,25 +3,93 @@
.. _complexobjects:
Complex Number Objects
======================
----------------------
.. index:: pair: object; complex number
Python's complex number objects are implemented as two distinct types when
viewed from the C API: one is the Python object exposed to Python programs, and
the other is a C structure which represents the actual complex number value.
The API provides functions for working with both.
Complex Numbers as C Structures
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note that the functions which accept these structures as parameters and return
them as results do so *by value* rather than dereferencing them through
pointers. This is consistent throughout the API.
.. c:type:: Py_complex
The C structure which corresponds to the value portion of a Python complex
number object. Most of the functions for dealing with complex number objects
use structures of this type as input or output values, as appropriate.
.. c:member:: double real
double imag
The structure is defined as::
typedef struct {
double real;
double imag;
} Py_complex;
.. c:function:: Py_complex _Py_c_sum(Py_complex left, Py_complex right)
Return the sum of two complex numbers, using the C :c:type:`Py_complex`
representation.
.. c:function:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)
Return the difference between two complex numbers, using the C
:c:type:`Py_complex` representation.
.. c:function:: Py_complex _Py_c_neg(Py_complex num)
Return the negation of the complex number *num*, using the C
:c:type:`Py_complex` representation.
.. c:function:: Py_complex _Py_c_prod(Py_complex left, Py_complex right)
Return the product of two complex numbers, using the C :c:type:`Py_complex`
representation.
.. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)
Return the quotient of two complex numbers, using the C :c:type:`Py_complex`
representation.
If *divisor* is null, this method returns zero and sets
:c:data:`errno` to :c:macro:`!EDOM`.
.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex`
representation.
If *num* is null and *exp* is not a positive real number,
this method returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`.
Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows.
Complex Numbers as Python Objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. c:type:: PyComplexObject
This subtype of :c:type:`PyObject` represents a Python complex number object.
.. c:member:: Py_complex cval
The complex number value, using the C :c:type:`Py_complex` representation.
.. deprecated-removed:: 3.15 3.20
Use :c:func:`PyComplex_AsCComplex` and
:c:func:`PyComplex_FromCComplex` to convert a
Python complex number to/from the C :c:type:`Py_complex`
representation.
.. c:var:: PyTypeObject PyComplex_Type
@ -41,6 +109,12 @@ Complex Number Objects
:c:type:`PyComplexObject`. This function always succeeds.
.. c:function:: PyObject* PyComplex_FromCComplex(Py_complex v)
Create a new Python complex number object from a C :c:type:`Py_complex` value.
Return ``NULL`` with an exception set on error.
.. c:function:: PyObject* PyComplex_FromDoubles(double real, double imag)
Return a new :c:type:`PyComplexObject` object from *real* and *imag*.
@ -79,29 +153,6 @@ Complex Number Objects
.. versionchanged:: 3.13
Use :meth:`~object.__complex__` if available.
.. c:type:: Py_complex
This C structure defines an export format for a Python complex
number object.
.. c:member:: double real
double imag
The structure is defined as::
typedef struct {
double real;
double imag;
} Py_complex;
.. c:function:: PyObject* PyComplex_FromCComplex(Py_complex v)
Create a new Python complex number object from a C :c:type:`Py_complex` value.
Return ``NULL`` with an exception set on error.
.. c:function:: Py_complex PyComplex_AsCComplex(PyObject *op)
Return the :c:type:`Py_complex` value of the complex number *op*.
@ -118,82 +169,3 @@ Complex Number Objects
.. versionchanged:: 3.8
Use :meth:`~object.__index__` if available.
Complex Numbers as C Structures
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The API also provides functions for working with complex numbers, using the
:c:type:`Py_complex` representation. Note that the functions which accept
these structures as parameters and return them as results do so *by value*
rather than dereferencing them through pointers.
Please note, that these functions are :term:`soft deprecated` since Python
3.15. Avoid using this API in a new code to do complex arithmetic: either use
the `Number Protocol <number>`_ API or use native complex types, like
:c:expr:`double complex`.
.. c:function:: Py_complex _Py_c_sum(Py_complex left, Py_complex right)
Return the sum of two complex numbers, using the C :c:type:`Py_complex`
representation.
.. deprecated:: 3.15
.. c:function:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)
Return the difference between two complex numbers, using the C
:c:type:`Py_complex` representation.
.. deprecated:: 3.15
.. c:function:: Py_complex _Py_c_neg(Py_complex num)
Return the negation of the complex number *num*, using the C
:c:type:`Py_complex` representation.
.. deprecated:: 3.15
.. c:function:: Py_complex _Py_c_prod(Py_complex left, Py_complex right)
Return the product of two complex numbers, using the C :c:type:`Py_complex`
representation.
.. deprecated:: 3.15
.. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)
Return the quotient of two complex numbers, using the C :c:type:`Py_complex`
representation.
If *divisor* is null, this method returns zero and sets
:c:data:`errno` to :c:macro:`!EDOM`.
.. deprecated:: 3.15
.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex`
representation.
If *num* is null and *exp* is not a positive real number,
this method returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`.
Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows.
.. deprecated:: 3.15
.. c:function:: double _Py_c_abs(Py_complex num)
Return the absolute value of the complex number *num*.
Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows.
.. deprecated:: 3.15

View file

@ -105,7 +105,7 @@ The following functions provide locale-independent string to number conversions.
If ``s`` represents a value that is too large to store in a float
(for example, ``"1e500"`` is such a string on many platforms) then
if ``overflow_exception`` is ``NULL`` return :c:macro:`!INFINITY` (with
if ``overflow_exception`` is ``NULL`` return ``Py_INFINITY`` (with
an appropriate sign) and don't set any exception. Otherwise,
``overflow_exception`` must point to a Python exception object;
raise that exception and return ``-1.0``. In both cases, set

View file

@ -8,8 +8,7 @@ Defining extension modules
A C extension for CPython is a shared library (for example, a ``.so`` file
on Linux, ``.pyd`` DLL on Windows), which is loadable into the Python process
(for example, it is compiled with compatible compiler settings), and which
exports an :dfn:`export hook` function (or an
old-style :ref:`initialization function <extension-pyinit>`).
exports an :ref:`initialization function <extension-export-hook>`.
To be importable by default (that is, by
:py:class:`importlib.machinery.ExtensionFileLoader`),
@ -24,127 +23,25 @@ and must be named after the module name plus an extension listed in
One suitable tool is Setuptools, whose documentation can be found at
https://setuptools.pypa.io/en/latest/setuptools.html.
.. _extension-export-hook:
Normally, the initialization function returns a module definition initialized
using :c:func:`PyModuleDef_Init`.
This allows splitting the creation process into several phases:
Extension export hook
.....................
.. versionadded:: next
Support for the :samp:`PyModExport_{<name>}` export hook was added in Python
3.15. The older way of defining modules is still available: consult either
the :ref:`extension-pyinit` section or earlier versions of this
documentation if you plan to support earlier Python versions.
The export hook must be an exported function with the following signature:
.. c:function:: PyModuleDef_Slot *PyModExport_modulename(void)
For modules with ASCII-only names, the :ref:`export hook <extension-export-hook>`
must be named :samp:`PyModExport_{<name>}`,
with ``<name>`` replaced by the module's name.
For non-ASCII module names, the export hook must instead be named
:samp:`PyModExportU_{<name>}` (note the ``U``), with ``<name>`` encoded using
Python's *punycode* encoding with hyphens replaced by underscores. In Python:
.. code-block:: python
def hook_name(name):
try:
suffix = b'_' + name.encode('ascii')
except UnicodeEncodeError:
suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')
return b'PyModExport' + suffix
The export hook returns an array of :c:type:`PyModuleDef_Slot` entries,
terminated by an entry with a slot ID of ``0``.
These slots describe how the module should be created and initialized.
This array must remain valid and constant until interpreter shutdown.
Typically, it should use ``static`` storage.
Prefer using the :c:macro:`Py_mod_create` and :c:macro:`Py_mod_exec` slots
for any dynamic behavior.
The export hook may return ``NULL`` with an exception set to signal failure.
It is recommended to define the export hook function using a helper macro:
.. c:macro:: PyMODEXPORT_FUNC
Declare an extension module export hook.
This macro:
* specifies the :c:expr:`PyModuleDef_Slot*` return type,
* adds any special linkage declarations required by the platform, and
* for C++, declares the function as ``extern "C"``.
For example, a module called ``spam`` would be defined like this::
PyABIInfo_VAR(abi_info);
static PyModuleDef_Slot spam_slots[] = {
{Py_mod_abi, &abi_info},
{Py_mod_name, "spam"},
{Py_mod_init, spam_init_function},
...
{0, NULL},
};
PyMODEXPORT_FUNC
PyModExport_spam(void)
{
return spam_slots;
}
The export hook is typically the only non-\ ``static``
item defined in the module's C source.
The hook should be kept short -- ideally, one line as above.
If you do need to use Python C API in this function, it is recommended to call
``PyABIInfo_Check(&abi_info, "modulename")`` first to raise an exception,
rather than crash, in common cases of ABI mismatch.
.. note::
It is possible to export multiple modules from a single shared library by
defining multiple export hooks.
However, importing them requires a custom importer or suitably named
copies/links of the extension file, because Python's import machinery only
finds the function corresponding to the filename.
See the `Multiple modules in one library <https://peps.python.org/pep-0489/#multiple-modules-in-one-library>`__
section in :pep:`489` for details.
.. _multi-phase-initialization:
Multi-phase initialization
..........................
The process of creating an extension module follows several phases:
- Python finds and calls the export hook to get information on how to
create the module.
- Before any substantial code is executed, Python can determine which
capabilities the module supports, and it can adjust the environment or
refuse loading an incompatible extension.
Slots like :c:data:`Py_mod_abi`, :c:data:`Py_mod_gil` and
:c:data:`Py_mod_multiple_interpreters` influence this step.
- By default, Python itself then creates the module object -- that is, it does
the equivalent of calling :py:meth:`~object.__new__` when creating an object.
This step can be overridden using the :c:data:`Py_mod_create` slot.
- Python sets initial module attributes like :attr:`~module.__package__` and
:attr:`~module.__loader__`, and inserts the module object into
:py:attr:`sys.modules`.
- Afterwards, the module object is initialized in an extension-specific way
-- the equivalent of :py:meth:`~object.__init__` when creating an object,
or of executing top-level code in a Python-language module.
The behavior is specified using the :c:data:`Py_mod_exec` slot.
- By default, Python itself creates the module object -- that is, it does
the equivalent of :py:meth:`object.__new__` for classes.
It also sets initial attributes like :attr:`~module.__package__` and
:attr:`~module.__loader__`.
- Afterwards, the module object is initialized using extension-specific
code -- the equivalent of :py:meth:`~object.__init__` on classes.
This is called *multi-phase initialization* to distinguish it from the legacy
(but still supported) :ref:`single-phase initialization <single-phase-initialization>`,
where an initialization function returns a fully constructed module.
(but still supported) *single-phase initialization* scheme,
where the initialization function returns a fully constructed module.
See the :ref:`single-phase-initialization section below <single-phase-initialization>`
for details.
.. versionchanged:: 3.5
@ -156,7 +53,7 @@ Multiple module instances
By default, extension modules are not singletons.
For example, if the :py:attr:`sys.modules` entry is removed and the module
is re-imported, a new module object is created and, typically, populated with
is re-imported, a new module object is created, and typically populated with
fresh method and type objects.
The old module is subject to normal garbage collection.
This mirrors the behavior of pure-Python modules.
@ -186,34 +83,36 @@ A module may also be limited to the main interpreter using
the :c:data:`Py_mod_multiple_interpreters` slot.
.. _extension-pyinit:
.. _extension-export-hook:
``PyInit`` function
...................
Initialization function
.......................
.. deprecated:: next
This functionality is :term:`soft deprecated`.
It will not get new features, but there are no plans to remove it.
Instead of :c:func:`PyModExport_modulename`, an extension module can define
an older-style :dfn:`initialization function` with the signature:
The initialization function defined by an extension module has the
following signature:
.. c:function:: PyObject* PyInit_modulename(void)
Its name should be :samp:`PyInit_{<name>}`, with ``<name>`` replaced by the
name of the module.
For non-ASCII module names, use :samp:`PyInitU_{<name>}` instead, with
``<name>`` encoded in the same way as for the
:ref:`export hook <extension-export-hook>` (that is, using Punycode
with underscores).
If a module exports both :samp:`PyInit_{<name>}` and
:samp:`PyModExport_{<name>}`, the :samp:`PyInit_{<name>}` function
is ignored.
For modules with ASCII-only names, the function must instead be named
:samp:`PyInit_{<name>}`, with ``<name>`` replaced by the name of the module.
When using :ref:`multi-phase-initialization`, non-ASCII module names
are allowed. In this case, the initialization function name is
:samp:`PyInitU_{<name>}`, with ``<name>`` encoded using Python's
*punycode* encoding with hyphens replaced by underscores. In Python:
Like with :c:macro:`PyMODEXPORT_FUNC`, it is recommended to define the
initialization function using a helper macro:
.. code-block:: python
def initfunc_name(name):
try:
suffix = b'_' + name.encode('ascii')
except UnicodeEncodeError:
suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')
return b'PyInit' + suffix
It is recommended to define the initialization function using a helper macro:
.. c:macro:: PyMODINIT_FUNC
@ -224,34 +123,6 @@ initialization function using a helper macro:
* adds any special linkage declarations required by the platform, and
* for C++, declares the function as ``extern "C"``.
Normally, the initialization function (``PyInit_modulename``) returns
a :c:type:`PyModuleDef` instance with non-``NULL``
:c:member:`~PyModuleDef.m_slots`. This allows Python to use
:ref:`multi-phase initialization <multi-phase-initialization>`.
Before it is returned, the ``PyModuleDef`` instance must be initialized
using the following function:
.. c:function:: PyObject* PyModuleDef_Init(PyModuleDef *def)
Ensure a module definition is a properly initialized Python object that
correctly reports its type and a reference count.
Return *def* cast to ``PyObject*``, or ``NULL`` if an error occurred.
Calling this function is required before returning a :c:type:`PyModuleDef`
from a module initialization function.
It should not be used in other contexts.
Note that Python assumes that ``PyModuleDef`` structures are statically
allocated.
This function may return either a new reference or a borrowed one;
this reference must not be released.
.. versionadded:: 3.5
For example, a module called ``spam`` would be defined like this::
static struct PyModuleDef spam_module = {
@ -266,23 +137,59 @@ For example, a module called ``spam`` would be defined like this::
return PyModuleDef_Init(&spam_module);
}
It is possible to export multiple modules from a single shared library by
defining multiple initialization functions. However, importing them requires
using symbolic links or a custom importer, because by default only the
function corresponding to the filename is found.
See the `Multiple modules in one library <https://peps.python.org/pep-0489/#multiple-modules-in-one-library>`__
section in :pep:`489` for details.
The initialization function is typically the only non-\ ``static``
item defined in the module's C source.
.. _multi-phase-initialization:
Multi-phase initialization
..........................
Normally, the :ref:`initialization function <extension-export-hook>`
(``PyInit_modulename``) returns a :c:type:`PyModuleDef` instance with
non-``NULL`` :c:member:`~PyModuleDef.m_slots`.
Before it is returned, the ``PyModuleDef`` instance must be initialized
using the following function:
.. c:function:: PyObject* PyModuleDef_Init(PyModuleDef *def)
Ensure a module definition is a properly initialized Python object that
correctly reports its type and a reference count.
Return *def* cast to ``PyObject*``, or ``NULL`` if an error occurred.
Calling this function is required for :ref:`multi-phase-initialization`.
It should not be used in other contexts.
Note that Python assumes that ``PyModuleDef`` structures are statically
allocated.
This function may return either a new reference or a borrowed one;
this reference must not be released.
.. versionadded:: 3.5
.. _single-phase-initialization:
Legacy single-phase initialization
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
..................................
.. deprecated:: next
Single-phase initialization is :term:`soft deprecated`.
It is a legacy mechanism to initialize extension
.. attention::
Single-phase initialization is a legacy mechanism to initialize extension
modules, with known drawbacks and design flaws. Extension module authors
are encouraged to use multi-phase initialization instead.
However, there are no plans to remove support for it.
In single-phase initialization, the old-style
:ref:`initializaton function <extension-pyinit>` (``PyInit_modulename``)
In single-phase initialization, the
:ref:`initialization function <extension-export-hook>` (``PyInit_modulename``)
should create, populate and return a module object.
This is typically done using :c:func:`PyModule_Create` and functions like
:c:func:`PyModule_AddObjectRef`.
@ -335,8 +242,6 @@ in the following ways:
* Single-phase modules support module lookup functions like
:c:func:`PyState_FindModule`.
* The module's :c:member:`PyModuleDef.m_slots` must be NULL.
.. [#testsinglephase] ``_testsinglephase`` is an internal module used
in CPython's self-test suite; your installation may or may not
include it.

View file

@ -83,11 +83,8 @@ Floating-Point Objects
This macro expands a to constant expression of type :c:expr:`double`, that
represents the positive infinity.
It is equivalent to the :c:macro:`!INFINITY` macro from the C11 standard
``<math.h>`` header.
.. deprecated:: 3.15
The macro is :term:`soft deprecated`.
On most platforms, this is equivalent to the :c:macro:`!INFINITY` macro from
the C11 standard ``<math.h>`` header.
.. c:macro:: Py_NAN
@ -116,8 +113,6 @@ Floating-Point Objects
High precision (long double) definition of :data:`~math.e` constant.
.. deprecated-removed:: 3.15 3.20
.. c:macro:: Py_MATH_PI
@ -128,8 +123,6 @@ Floating-Point Objects
High precision (long double) definition of :data:`~math.pi` constant.
.. deprecated-removed:: 3.15 3.20
.. c:macro:: Py_MATH_TAU

View file

@ -184,9 +184,6 @@ There are a few functions specific to Python functions.
.. versionadded:: 3.12
- ``PyFunction_PYFUNC_EVENT_MODIFY_QUALNAME``
.. versionadded:: 3.15
.. c:type:: int (*PyFunction_WatchCallback)(PyFunction_WatchEvent event, PyFunctionObject *func, PyObject *new_value)
@ -209,7 +206,7 @@ There are a few functions specific to Python functions.
runtime behavior depending on optimization decisions, it does not change
the semantics of the Python code being executed.
If *event* is ``PyFunction_EVENT_DESTROY``, taking a reference in the
If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the
callback to the about-to-be-destroyed function will resurrect it, preventing
it from being freed at this time. When the resurrected object is destroyed
later, any watcher callbacks active at that time will be called again.

View file

@ -16,6 +16,19 @@ Importing Modules
This is a wrapper around :c:func:`PyImport_Import()` which takes a
:c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`.
.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
This function is a deprecated alias of :c:func:`PyImport_ImportModule`.
.. versionchanged:: 3.3
This function used to fail immediately when the import lock was held
by another thread. In Python 3.3 though, the locking scheme switched
to per-module locks for most purposes, so this function's special
behaviour isn't needed anymore.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyImport_ImportModule` instead.
.. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
@ -340,24 +353,3 @@ Importing Modules
strings instead of Python :class:`str` objects.
.. versionadded:: 3.14
.. c:function:: PyObject* PyImport_CreateModuleFromInitfunc(PyObject *spec, PyObject* (*initfunc)(void))
This function is a building block that enables embedders to implement
the :py:meth:`~importlib.abc.Loader.create_module` step of custom
static extension importers (e.g. of statically-linked extensions).
*spec* must be a :class:`~importlib.machinery.ModuleSpec` object.
*initfunc* must be an :ref:`initialization function <extension-export-hook>`,
the same as for :c:func:`PyImport_AppendInittab`.
On success, create and return a module object.
This module will not be initialized; call :c:func:`PyModule_Exec`
to initialize it.
(Custom importers should do this in their
:py:meth:`~importlib.abc.Loader.exec_module` method.)
On error, return NULL with an exception set.
.. versionadded:: 3.15

View file

@ -41,6 +41,7 @@ The following functions can be safely called before Python is initialized:
* :c:func:`PyObject_SetArenaAllocator`
* :c:func:`Py_SetProgramName`
* :c:func:`Py_SetPythonHome`
* :c:func:`PySys_ResetWarnOptions`
* the configuration functions covered in :ref:`init-config`
* Informative functions:
@ -76,7 +77,10 @@ The following functions can be safely called before Python is initialized:
Despite their apparent similarity to some of the functions listed above,
the following functions **should not be called** before the interpreter has
been initialized: :c:func:`Py_EncodeLocale`, :c:func:`PyEval_InitThreads`, and
been initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`,
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
:c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`,
:c:func:`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and
:c:func:`Py_RunMain`.
@ -141,6 +145,9 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
:c:member:`PyConfig.pathconfig_warnings` should be used instead, see
:ref:`Python Initialization Configuration <init-config>`.
Suppress error messages when calculating the module search path in
:c:func:`Py_GetPath`.
Private flag used by ``_freeze_module`` and ``frozenmain`` programs.
.. deprecated-removed:: 3.12 3.15
@ -565,6 +572,7 @@ Process-wide parameters
.. index::
single: Py_Initialize()
single: main()
single: Py_GetPath()
This API is kept for backward compatibility: setting
:c:member:`PyConfig.program_name` should be used instead, see :ref:`Python
@ -574,7 +582,7 @@ Process-wide parameters
the first time, if it is called at all. It tells the interpreter the value
of the ``argv[0]`` argument to the :c:func:`main` function of the program
(converted to wide characters).
This is used by some other functions below to find
This is used by :c:func:`Py_GetPath` and some other functions below to find
the Python run-time libraries relative to the interpreter executable. The
default value is ``'python'``. The argument should point to a
zero-terminated wide character string in static storage whose contents will not
@ -587,6 +595,146 @@ Process-wide parameters
.. deprecated-removed:: 3.11 3.15
.. c:function:: wchar_t* Py_GetProgramName()
Return the program name set with :c:member:`PyConfig.program_name`, or the default.
The returned string points into static storage; the caller should not modify its
value.
This function should not be called before :c:func:`Py_Initialize`, otherwise
it returns ``NULL``.
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
(:data:`sys.executable`) instead.
.. c:function:: wchar_t* Py_GetPrefix()
Return the *prefix* for installed platform-independent files. This is derived
through a number of complicated rules from the program name set with
:c:member:`PyConfig.program_name` and some environment variables; for example, if the
program name is ``'/usr/local/bin/python'``, the prefix is ``'/usr/local'``. The
returned string points into static storage; the caller should not modify its
value. This corresponds to the :makevar:`prefix` variable in the top-level
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
script at build time. The value is available to Python code as ``sys.base_prefix``.
It is only useful on Unix. See also the next function.
This function should not be called before :c:func:`Py_Initialize`, otherwise
it returns ``NULL``.
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyConfig_Get("base_prefix") <PyConfig_Get>`
(:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get("prefix")
<PyConfig_Get>` (:data:`sys.prefix`) if :ref:`virtual environments
<venv-def>` need to be handled.
.. c:function:: wchar_t* Py_GetExecPrefix()
Return the *exec-prefix* for installed platform-*dependent* files. This is
derived through a number of complicated rules from the program name set with
:c:member:`PyConfig.program_name` and some environment variables; for example, if the
program name is ``'/usr/local/bin/python'``, the exec-prefix is
``'/usr/local'``. The returned string points into static storage; the caller
should not modify its value. This corresponds to the :makevar:`exec_prefix`
variable in the top-level :file:`Makefile` and the ``--exec-prefix``
argument to the :program:`configure` script at build time. The value is
available to Python code as ``sys.base_exec_prefix``. It is only useful on
Unix.
Background: The exec-prefix differs from the prefix when platform dependent
files (such as executables and shared libraries) are installed in a different
directory tree. In a typical installation, platform dependent files may be
installed in the :file:`/usr/local/plat` subtree while platform independent may
be installed in :file:`/usr/local`.
Generally speaking, a platform is a combination of hardware and software
families, e.g. Sparc machines running the Solaris 2.x operating system are
considered the same platform, but Intel machines running Solaris 2.x are another
platform, and Intel machines running Linux are yet another platform. Different
major revisions of the same operating system generally also form different
platforms. Non-Unix operating systems are a different story; the installation
strategies on those systems are so different that the prefix and exec-prefix are
meaningless, and set to the empty string. Note that compiled Python bytecode
files are platform independent (but not independent from the Python version by
which they were compiled!).
System administrators will know how to configure the :program:`mount` or
:program:`automount` programs to share :file:`/usr/local` between platforms
while having :file:`/usr/local/plat` be a different filesystem for each
platform.
This function should not be called before :c:func:`Py_Initialize`, otherwise
it returns ``NULL``.
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyConfig_Get("base_exec_prefix") <PyConfig_Get>`
(:data:`sys.base_exec_prefix`) instead. Use
:c:func:`PyConfig_Get("exec_prefix") <PyConfig_Get>`
(:data:`sys.exec_prefix`) if :ref:`virtual environments <venv-def>` need
to be handled.
.. c:function:: wchar_t* Py_GetProgramFullPath()
.. index::
single: executable (in module sys)
Return the full program name of the Python executable; this is computed as a
side-effect of deriving the default module search path from the program name
(set by :c:member:`PyConfig.program_name`). The returned string points into
static storage; the caller should not modify its value. The value is available
to Python code as ``sys.executable``.
This function should not be called before :c:func:`Py_Initialize`, otherwise
it returns ``NULL``.
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
(:data:`sys.executable`) instead.
.. c:function:: wchar_t* Py_GetPath()
.. index::
triple: module; search; path
single: path (in module sys)
Return the default module search path; this is computed from the program name
(set by :c:member:`PyConfig.program_name`) and some environment variables.
The returned string consists of a series of directory names separated by a
platform dependent delimiter character. The delimiter character is ``':'``
on Unix and macOS, ``';'`` on Windows. The returned string points into
static storage; the caller should not modify its value. The list
:data:`sys.path` is initialized with this value on interpreter startup; it
can be (and usually is) modified later to change the search path for loading
modules.
This function should not be called before :c:func:`Py_Initialize`, otherwise
it returns ``NULL``.
.. XXX should give the exact rules
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyConfig_Get("module_search_paths") <PyConfig_Get>`
(:data:`sys.path`) instead.
.. c:function:: const char* Py_GetVersion()
Return the version of this Python interpreter. This is a string that looks
@ -757,6 +905,23 @@ Process-wide parameters
.. deprecated-removed:: 3.11 3.15
.. c:function:: wchar_t* Py_GetPythonHome()
Return the default "home", that is, the value set by
:c:member:`PyConfig.home`, or the value of the :envvar:`PYTHONHOME`
environment variable if it is set.
This function should not be called before :c:func:`Py_Initialize`, otherwise
it returns ``NULL``.
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyConfig_Get("home") <PyConfig_Get>` or the
:envvar:`PYTHONHOME` environment variable instead.
.. _threads:
Thread State and the Global Interpreter Lock
@ -1390,7 +1555,17 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
See :c:func:`PyUnstable_ThreadState_ResetStackProtection` for undoing this operation.
.. versionadded:: 3.15
.. versionadded:: 3.14.1
.. warning::
This function was added in a bugfix release, and
extensions that use it will be incompatible with Python 3.14.0.
Most packaging tools for Python are not able to handle this
incompatibility automatically, and will need explicit configuration.
When using PyPA standards (wheels and source distributions),
specify ``Requires-Python: != 3.14.0.*`` in
`core metadata <https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python>`_.
.. c:function:: void PyUnstable_ThreadState_ResetStackProtection(PyThreadState *tstate)
@ -1400,7 +1575,17 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
See :c:func:`PyUnstable_ThreadState_SetStackProtection` for an explanation.
.. versionadded:: 3.15
.. versionadded:: 3.14.1
.. warning::
This function was added in a bugfix release, and
extensions that use it will be incompatible with Python 3.14.0.
Most packaging tools for Python are not able to handle this
incompatibility automatically, and will need explicit configuration.
When using PyPA standards (wheels and source distributions),
specify ``Requires-Python: != 3.14.0.*`` in
`core metadata <https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python>`_.
.. c:function:: PyInterpreterState* PyInterpreterState_Get(void)
@ -1717,8 +1902,7 @@ function. You can create and destroy them using the following functions:
Only C-level static and global variables are shared between these
module objects.
* For modules using legacy
:ref:`single-phase initialization <single-phase-initialization>`,
* For modules using single-phase initialization,
e.g. :c:func:`PyModule_Create`, the first time a particular extension
is imported, it is initialized normally, and a (shallow) copy of its
module's dictionary is squirreled away.
@ -2087,11 +2271,6 @@ Reference tracing
is set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer
that was provided when :c:func:`PyRefTracer_SetTracer` was called.
If a new tracing function is registered replacing the current a call to the
trace function will be made with the object set to **NULL** and **event** set to
:c:data:`PyRefTracer_TRACKER_REMOVED`. This will happen just before the new
function is registered.
.. versionadded:: 3.13
.. c:var:: int PyRefTracer_CREATE
@ -2104,13 +2283,6 @@ Reference tracing
The value for the *event* parameter to :c:type:`PyRefTracer` functions when a Python
object has been destroyed.
.. c:var:: int PyRefTracer_TRACKER_REMOVED
The value for the *event* parameter to :c:type:`PyRefTracer` functions when the
current tracer is about to be replaced by a new one.
.. versionadded:: 3.14
.. c:function:: int PyRefTracer_SetTracer(PyRefTracer tracer, void *data)
Register a reference tracer function. The function will be called when a new
@ -2126,10 +2298,6 @@ Reference tracing
There must be an :term:`attached thread state` when calling this function.
If another tracer function was already registered, the old function will be
called with **event** set to :c:data:`PyRefTracer_TRACKER_REMOVED` just before
the new function is registered.
.. versionadded:: 3.13
.. c:function:: PyRefTracer PyRefTracer_GetTracer(void** data)
@ -2197,7 +2365,7 @@ use a thread key and functions to associate a :c:expr:`void*` value per
thread.
A :term:`thread state` does *not* need to be :term:`attached <attached thread state>`
when calling these functions; they supply their own locking.
when calling these functions; they suppl their own locking.
Note that :file:`Python.h` does not include the declaration of the TLS APIs,
you need to include :file:`pythread.h` to use thread-local storage.

View file

@ -975,7 +975,9 @@ PyPreConfig
Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option
and the :envvar:`PYTHONUTF8` environment variable.
Default: ``1``.
Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``.
Default: ``-1`` in Python config and ``0`` in isolated config.
.. _c-preinit:
@ -1278,11 +1280,6 @@ PyConfig
Default: ``0``.
.. deprecated-removed:: 3.15 3.17
The :option:`-b` and :option:`!-bb` options will become no-op in 3.17.
:c:member:`~PyConfig.bytes_warning` member will be removed in 3.17.
.. c:member:: int warn_default_encoding
If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper`
@ -2114,7 +2111,7 @@ initialization::
/* Specify sys.path explicitly */
/* If you want to modify the default set of paths, finish
initialization first and then use PySys_GetAttrString("path") */
initialization first and then use PySys_GetObject("path") */
config.module_search_paths_set = 1;
status = PyWideStringList_Append(&config.module_search_paths,
L"/path/to/stdlib");
@ -2263,7 +2260,6 @@ If a ``._pth`` file is present:
* Set :c:member:`~PyConfig.isolated` to ``1``.
* Set :c:member:`~PyConfig.use_environment` to ``0``.
* Set :c:member:`~PyConfig.site_import` to ``0``.
* Set :c:member:`~PyConfig.user_site_directory` to ``0`` (since 3.15).
* Set :c:member:`~PyConfig.safe_path` to ``1``.
If :c:member:`~PyConfig.home` is not set and a ``pyvenv.cfg`` file is present in
@ -2284,12 +2280,6 @@ The ``__PYVENV_LAUNCHER__`` environment variable is used to set
therefore affected by :option:`-S`.
.. versionchanged:: 3.15
:c:member:`~PyConfig.user_site_directory` is now set to ``0`` when a
``._pth`` file is present.
Py_GetArgcArgv()
================

View file

@ -825,11 +825,20 @@ found along :envvar:`PATH`.) The user can override this behavior by setting the
environment variable :envvar:`PYTHONHOME`, or insert additional directories in
front of the standard path by setting :envvar:`PYTHONPATH`.
.. index::
single: Py_GetPath (C function)
single: Py_GetPrefix (C function)
single: Py_GetExecPrefix (C function)
single: Py_GetProgramFullPath (C function)
The embedding application can steer the search by setting
:c:member:`PyConfig.program_name` *before* calling
:c:func:`Py_InitializeFromConfig`. Note that
:envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` is still
inserted in front of the standard path.
inserted in front of the standard path. An application that requires total
control has to provide its own implementation of :c:func:`Py_GetPath`,
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and
:c:func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`).
.. index:: single: Py_IsInitialized (C function)
@ -863,17 +872,14 @@ frequently used builds will be described in the remainder of this section.
Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined produces
what is generally meant by :ref:`a debug build of Python <debug-build>`.
On Unix, :c:macro:`!Py_DEBUG` can be enabled by adding :option:`--with-pydebug`
to the :file:`./configure` command. This will also disable compiler optimization.
On Windows, selecting a debug build (e.g., by passing the :option:`-d` option to
:file:`PCbuild/build.bat`) automatically enables :c:macro:`!Py_DEBUG`.
Additionally, the presence of the not-Python-specific :c:macro:`!_DEBUG` macro,
when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
:c:macro:`!Py_DEBUG` is enabled in the Unix build by adding
:option:`--with-pydebug` to the :file:`./configure` command.
It is also implied by the presence of the
not-Python-specific :c:macro:`!_DEBUG` macro. When :c:macro:`!Py_DEBUG` is enabled
in the Unix build, compiler optimization is disabled.
In addition to the reference count debugging described below, extra checks are
performed. See :ref:`Python Debug Build <debug-build>` for more details.
performed, see :ref:`Python Debug Build <debug-build>`.
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).

View file

@ -54,6 +54,6 @@ There are two functions specifically for working with iterators.
- ``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*.
- ``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*.
- ``PYGEN_ERROR`` if iterator has raised an exception. *presult* is set to ``NULL``.
- ``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to ``NULL``.
.. versionadded:: 3.10

View file

@ -43,7 +43,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
.. impl-detail::
CPython keeps an array of integer objects for all integers
between ``-5`` and ``1024``. When you create an int in that range
between ``-5`` and ``256``. When you create an int in that range
you actually just get back a reference to the existing object.

View file

@ -3,10 +3,11 @@
.. _moduleobjects:
Module Objects
==============
--------------
.. index:: pair: object; module
.. c:var:: PyTypeObject PyModule_Type
.. index:: single: ModuleType (in module types)
@ -96,6 +97,13 @@ Module Objects
Note that Python code may rename a module by setting its :py:attr:`~module.__name__`
attribute.
.. c:function:: void* PyModule_GetState(PyObject *module)
Return the "state" of the module, that is, a pointer to the block of memory
allocated at module creation time, or ``NULL``. See
:c:member:`PyModuleDef.m_size`.
.. c:function:: PyModuleDef* PyModule_GetDef(PyObject *module)
Return a pointer to the :c:type:`PyModuleDef` struct from which the module was
@ -133,108 +141,214 @@ Module Objects
unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead.
.. _pymoduledef_slot:
.. _pymoduledef:
Module definition
-----------------
Module definitions
------------------
Modules created using the C API are typically defined using an
array of :dfn:`slots`.
The slots provide a "description" of how a module should be created.
The functions in the previous section work on any module object, including
modules imported from Python code.
.. versionchanged:: next
Modules defined using the C API typically use a *module definition*,
:c:type:`PyModuleDef` -- a statically allocated, constant “description" of
how a module should be created.
Previously, a :c:type:`PyModuleDef` struct was necessary to define modules.
The older way of defining modules is still available: consult either the
:ref:`pymoduledef` section or earlier versions of this documentation
if you plan to support earlier Python versions.
The definition is usually used to define an extension's “main” module object
(see :ref:`extension-modules` for details).
It is also used to
:ref:`create extension modules dynamically <moduledef-dynamic>`.
The slots array is usually used to define an extension module's “main”
module object (see :ref:`extension-modules` for details).
It can also be used to
:ref:`create extension modules dynamically <module-from-slots>`.
Unlike :c:func:`PyModule_New`, the definition allows management of
*module state* -- a piece of memory that is allocated and cleared together
with the module object.
Unlike the module's Python attributes, Python code cannot replace or delete
data stored in module state.
Unless specified otherwise, the same slot ID may not be repeated
in an array of slots.
.. c:type:: PyModuleDef
The module definition struct, which holds all information needed to create
a module object.
This structure must be statically allocated (or be otherwise guaranteed
to be valid while any modules created from it exist).
Usually, there is only one variable of this type for each extension module.
.. c:member:: PyModuleDef_Base m_base
Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`.
.. c:member:: const char *m_name
Name for the new module.
.. c:member:: const char *m_doc
Docstring for the module; usually a docstring variable created with
:c:macro:`PyDoc_STRVAR` is used.
.. c:member:: Py_ssize_t m_size
Module state may be kept in a per-module memory area that can be
retrieved with :c:func:`PyModule_GetState`, rather than in static globals.
This makes modules safe for use in multiple sub-interpreters.
This memory area is allocated based on *m_size* on module creation,
and freed when the module object is deallocated, after the
:c:member:`~PyModuleDef.m_free` function has been called, if present.
Setting it to a non-negative value means that the module can be
re-initialized and specifies the additional amount of memory it requires
for its state.
Setting ``m_size`` to ``-1`` means that the module does not support
sub-interpreters, because it has global state.
Negative ``m_size`` is only allowed when using
:ref:`legacy single-phase initialization <single-phase-initialization>`
or when :ref:`creating modules dynamically <moduledef-dynamic>`.
See :PEP:`3121` for more details.
.. c:member:: PyMethodDef* m_methods
A pointer to a table of module-level functions, described by
:c:type:`PyMethodDef` values. Can be ``NULL`` if no functions are present.
.. c:member:: PyModuleDef_Slot* m_slots
An array of slot definitions for multi-phase initialization, terminated by
a ``{0, NULL}`` entry.
When using legacy single-phase initialization, *m_slots* must be ``NULL``.
.. versionchanged:: 3.5
Prior to version 3.5, this member was always set to ``NULL``,
and was defined as:
.. c:member:: inquiry m_reload
.. c:member:: traverseproc m_traverse
A traversal function to call during GC traversal of the module object, or
``NULL`` if not needed.
This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
is ``NULL``.
.. versionchanged:: 3.9
No longer called before the module state is allocated.
.. c:member:: inquiry m_clear
A clear function to call during GC clearing of the module object, or
``NULL`` if not needed.
This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
is ``NULL``.
Like :c:member:`PyTypeObject.tp_clear`, this function is not *always*
called before a module is deallocated. For example, when reference
counting is enough to determine that an object is no longer used,
the cyclic garbage collector is not involved and
:c:member:`~PyModuleDef.m_free` is called directly.
.. versionchanged:: 3.9
No longer called before the module state is allocated.
.. c:member:: freefunc m_free
A function to call during deallocation of the module object, or ``NULL``
if not needed.
This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
is ``NULL``.
.. versionchanged:: 3.9
No longer called before the module state is allocated.
Module slots
............
.. c:type:: PyModuleDef_Slot
.. c:member:: int slot
A slot ID, chosen from the available ``Py_mod_*`` values explained below.
An ID of 0 marks the end of a :c:type:`!PyModuleDef_Slot` array.
A slot ID, chosen from the available values explained below.
.. c:member:: void* value
Value of the slot, whose meaning depends on the slot ID.
The value may not be NULL.
To leave a slot out, omit the :c:type:`PyModuleDef_Slot` entry entirely.
.. versionadded:: 3.5
The available slot types are:
.. c:macro:: Py_mod_create
Specifies a function that is called to create the module object itself.
The *value* pointer of this slot must point to a function of the signature:
.. c:function:: PyObject* create_module(PyObject *spec, PyModuleDef *def)
:no-index-entry:
:no-contents-entry:
The function receives a :py:class:`~importlib.machinery.ModuleSpec`
instance, as defined in :PEP:`451`, and the module definition.
It should return a new module object, or set an error
and return ``NULL``.
This function should be kept minimal. In particular, it should not
call arbitrary Python code, as trying to import the same module again may
result in an infinite loop.
Multiple ``Py_mod_create`` slots may not be specified in one module
definition.
If ``Py_mod_create`` is not specified, the import machinery will create
a normal module object using :c:func:`PyModule_New`. The name is taken from
*spec*, not the definition, to allow extension modules to dynamically adjust
to their place in the module hierarchy and be imported under different
names through symlinks, all while sharing a single module definition.
There is no requirement for the returned object to be an instance of
:c:type:`PyModule_Type`. Any type can be used, as long as it supports
setting and getting import-related attributes.
However, only ``PyModule_Type`` instances may be returned if the
``PyModuleDef`` has non-``NULL`` ``m_traverse``, ``m_clear``,
``m_free``; non-zero ``m_size``; or slots other than ``Py_mod_create``.
.. versionadded:: 3.5
.. c:macro:: Py_mod_exec
Metadata slots
..............
Specifies a function that is called to *execute* the module.
This is equivalent to executing the code of a Python module: typically,
this function adds classes and constants to the module.
The signature of the function is:
.. c:macro:: Py_mod_name
.. c:function:: int exec_module(PyObject* module)
:no-index-entry:
:no-contents-entry:
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for the name of the new module,
as a NUL-terminated UTF8-encoded ``const char *``.
If multiple ``Py_mod_exec`` slots are specified, they are processed in the
order they appear in the *m_slots* array.
Note that modules are typically created using a
:py:class:`~importlib.machinery.ModuleSpec`, and when they are, the
name from the spec will be used instead of :c:data:`!Py_mod_name`.
However, it is still recommended to include this slot for introspection
and debugging purposes.
.. versionadded:: next
Use :c:member:`PyModuleDef.m_name` instead to support previous versions.
.. c:macro:: Py_mod_doc
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for the docstring of the new
module, as a NUL-terminated UTF8-encoded ``const char *``.
Usually it is set to a variable created with :c:macro:`PyDoc_STRVAR`.
.. versionadded:: next
Use :c:member:`PyModuleDef.m_doc` instead to support previous versions.
Feature slots
.............
.. c:macro:: Py_mod_abi
:c:type:`Slot ID <PyModuleDef_Slot.slot>` whose value points to
a :c:struct:`PyABIInfo` structure describing the ABI that
the extension is using.
A suitable :c:struct:`!PyABIInfo` variable can be defined using the
:c:macro:`PyABIInfo_VAR` macro, as in:
.. code-block:: c
PyABIInfo_VAR(abi_info);
static PyModuleDef_Slot mymodule_slots[] = {
{Py_mod_abi, &abi_info},
...
};
When creating a module, Python checks the value of this slot
using :c:func:`PyABIInfo_Check`.
.. versionadded:: 3.15
.. versionadded:: 3.5
.. c:macro:: Py_mod_multiple_interpreters
:c:type:`Slot ID <PyModuleDef_Slot.slot>` whose value is one of:
Specifies one of the following values:
.. c:namespace:: NULL
@ -257,6 +371,9 @@ Feature slots
This slot determines whether or not importing this module
in a subinterpreter will fail.
Multiple ``Py_mod_multiple_interpreters`` slots may not be specified
in one module definition.
If ``Py_mod_multiple_interpreters`` is not specified, the import
machinery defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``.
@ -264,7 +381,7 @@ Feature slots
.. c:macro:: Py_mod_gil
:c:type:`Slot ID <PyModuleDef_Slot.slot>` whose value is one of:
Specifies one of the following values:
.. c:namespace:: NULL
@ -282,482 +399,23 @@ Feature slots
this module will cause the GIL to be automatically enabled. See
:ref:`whatsnew313-free-threaded-cpython` for more detail.
Multiple ``Py_mod_gil`` slots may not be specified in one module definition.
If ``Py_mod_gil`` is not specified, the import machinery defaults to
``Py_MOD_GIL_USED``.
.. versionadded:: 3.13
Creation and initialization slots
.................................
.. c:macro:: Py_mod_create
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for a function that creates
the module object itself.
The function must have the signature:
.. c:function:: PyObject* create_module(PyObject *spec, PyModuleDef *def)
:no-index-entry:
:no-contents-entry:
The function will be called with:
- *spec*: a ``ModuleSpec``-like object, meaning that any attributes defined
for :py:class:`importlib.machinery.ModuleSpec` have matching semantics.
However, any of the attributes may be missing.
- *def*: ``NULL``, or the module definition if the module is created from one.
The function should return a new module object, or set an error
and return ``NULL``.
This function should be kept minimal. In particular, it should not
call arbitrary Python code, as trying to import the same module again may
result in an infinite loop.
If ``Py_mod_create`` is not specified, the import machinery will create
a normal module object using :c:func:`PyModule_New`. The name is taken from
*spec*, not the definition, to allow extension modules to dynamically adjust
to their place in the module hierarchy and be imported under different
names through symlinks, all while sharing a single module definition.
There is no requirement for the returned object to be an instance of
:c:type:`PyModule_Type`.
However, some slots may only be used with
:c:type:`!PyModule_Type` instances; in particular:
- :c:macro:`Py_mod_exec`,
- :ref:`module state slots <ext-module-state-slots>` (``Py_mod_state_*``),
- :c:macro:`Py_mod_token`.
.. versionadded:: 3.5
.. versionchanged:: next
The *slots* argument may be a ``ModuleSpec``-like object, rather than
a true :py:class:`~importlib.machinery.ModuleSpec` instance.
Note that previous versions of CPython did not enforce this.
The *def* argument may now be ``NULL``, since modules are not necessarily
made from definitions.
.. c:macro:: Py_mod_exec
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for a function that will
:dfn:`execute`, or initialize, the module.
This function does the equivalent to executing the code of a Python module:
typically, it adds classes and constants to the module.
The signature of the function is:
.. c:function:: int exec_module(PyObject* module)
:no-index-entry:
:no-contents-entry:
See the :ref:`capi-module-support-functions` section for some useful
functions to call.
For backwards compatibility, the :c:type:`PyModuleDef.m_slots` array may
contain multiple :c:macro:`!Py_mod_exec` slots; these are processed in the
order they appear in the array.
Elsewhere (that is, in arguments to :c:func:`PyModule_FromSlotsAndSpec`
and in return values of :samp:`PyModExport_{<name>}`), repeating the slot
is not allowed.
.. versionadded:: 3.5
.. versionchanged:: next
Repeated ``Py_mod_exec`` slots are disallowed, except in
:c:type:`PyModuleDef.m_slots`.
.. c:macro:: Py_mod_methods
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for a table of module-level
functions, as an array of :c:type:`PyMethodDef` values suitable as the
*functions* argument to :c:func:`PyModule_AddFunctions`.
Like other slot IDs, a slots array may only contain one
:c:macro:`!Py_mod_methods` entry.
To add functions from multiple :c:type:`PyMethodDef` arrays, call
:c:func:`PyModule_AddFunctions` in the :c:macro:`Py_mod_exec` function.
The table must be statically allocated (or otherwise guaranteed to outlive
the module object).
.. versionadded:: next
Use :c:member:`PyModuleDef.m_methods` instead to support previous versions.
.. _ext-module-state:
Module state
------------
Extension modules can have *module state* -- a
piece of memory that is allocated on module creation,
and freed when the module object is deallocated.
The module state is specified using :ref:`dedicated slots <ext-module-state-slots>`.
A typical use of module state is storing an exception type -- or indeed *any*
type object defined by the module --
Unlike the module's Python attributes, Python code cannot replace or delete
data stored in module state.
Keeping per-module information in attributes and module state, rather than in
static globals, makes module objects *isolated* and safer for use in
multiple sub-interpreters.
It also helps Python do an orderly clean-up when it shuts down.
Extensions that keep references to Python objects as part of module state must
implement :c:macro:`Py_mod_state_traverse` and :c:macro:`Py_mod_state_clear`
functions to avoid reference leaks.
To retrieve the state from a given module, use the following functions:
.. c:function:: void* PyModule_GetState(PyObject *module)
Return the "state" of the module, that is, a pointer to the block of memory
allocated at module creation time, or ``NULL``. See
:c:macro:`Py_mod_state_size`.
On error, return ``NULL`` with an exception set.
Use :c:func:`PyErr_Occurred` to tell this case apart from missing
module state.
.. c:function:: int PyModule_GetStateSize(PyObject *, Py_ssize_t *result)
Set *\*result* to the size of the module's state, as specified using
:c:macro:`Py_mod_state_size` (or :c:member:`PyModuleDef.m_size`),
and return 0.
On error, set *\*result* to -1, and return -1 with an exception set.
.. versionadded:: next
.. _ext-module-state-slots:
Slots for defining module state
...............................
The following :c:member:`PyModuleDef_Slot.slot` IDs are available for
defining the module state.
.. c:macro:: Py_mod_state_size
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for the size of the module state,
in bytes.
Setting the value to a non-negative value means that the module can be
re-initialized and specifies the additional amount of memory it requires
for its state.
See :PEP:`3121` for more details.
Use :c:func:`PyModule_GetStateSize` to retrieve the size of a given module.
.. versionadded:: next
Use :c:member:`PyModuleDef.m_size` instead to support previous versions.
.. c:macro:: Py_mod_state_traverse
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for a traversal function to call
during GC traversal of the module object.
The signature of the function, and meanings of the arguments,
is similar as for :c:member:`PyTypeObject.tp_traverse`:
.. c:function:: int traverse_module_state(PyObject *module, visitproc visit, void *arg)
:no-index-entry:
:no-contents-entry:
This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if the state size
(:c:data:`Py_mod_state_size`) is greater than 0 and the module state
(as returned by :c:func:`PyModule_GetState`) is ``NULL``.
.. versionadded:: next
Use :c:member:`PyModuleDef.m_size` instead to support previous versions.
.. c:macro:: Py_mod_state_clear
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for a clear function to call
during GC clearing of the module object.
The signature of the function is:
.. c:function:: int clear_module_state(PyObject* module)
:no-index-entry:
:no-contents-entry:
This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if the state size
(:c:data:`Py_mod_state_size`) is greater than 0 and the module state
(as returned by :c:func:`PyModule_GetState`) is ``NULL``.
Like :c:member:`PyTypeObject.tp_clear`, this function is not *always*
called before a module is deallocated. For example, when reference
counting is enough to determine that an object is no longer used,
the cyclic garbage collector is not involved and
the :c:macro:`Py_mod_state_free` function is called directly.
.. versionadded:: next
Use :c:member:`PyModuleDef.m_clear` instead to support previous versions.
.. c:macro:: Py_mod_state_free
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for a function to call during
deallocation of the module object.
The signature of the function is:
.. c:function:: int free_module_state(PyObject* module)
:no-index-entry:
:no-contents-entry:
This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if the state size
(:c:data:`Py_mod_state_size`) is greater than 0 and the module state
(as returned by :c:func:`PyModule_GetState`) is ``NULL``.
.. versionadded:: next
Use :c:member:`PyModuleDef.m_free` instead to support previous versions.
.. _ext-module-token:
Module token
............
Each module may have an associated *token*: a pointer-sized value intended to
identify of the module state's memory layout.
This means that if you have a module object, but you are not sure if it
“belongs” to your extension, you can check using code like this:
.. code-block:: c
PyObject *module = <the module in question>
void *module_token;
if (PyModule_GetToken(module, &module_token) < 0) {
return NULL;
}
if (module_token != your_token) {
PyErr_SetString(PyExc_ValueError, "unexpected module")
return NULL;
}
// This module's state has the expected memory layout; it's safe to cast
struct my_state state = (struct my_state*)PyModule_GetState(module)
A module's token -- and the *your_token* value to use in the above code -- is:
- For modules created with :c:type:`PyModuleDef`: the address of that
:c:type:`PyModuleDef`;
- For modules defined with the :c:macro:`Py_mod_token` slot: the value
of that slot;
- For modules created from an ``PyModExport_*``
:ref:`export hook <extension-export-hook>`: the slots array that the export
hook returned (unless overriden with :c:macro:`Py_mod_token`).
.. c:macro:: Py_mod_token
:c:type:`Slot ID <PyModuleDef_Slot.slot>` for the module token.
If you use this slot to set the module token (rather than rely on the
default), you must ensure that:
* The pointer outlives the class, so it's not reused for something else
while the class exists.
* It "belongs" to the extension module where the class lives, so it will not
clash with other extensions.
* If the token points to a :c:type:`PyModuleDef` struct, the module should
behave as if it was created from that :c:type:`PyModuleDef`.
In particular, the module state must have matching layout and semantics.
Modules created from :c:type:`PyModuleDef` allways use the address of
the :c:type:`PyModuleDef` as the token.
This means that :c:macro:`!Py_mod_token` cannot be used in
:c:member:`PyModuleDef.m_slots`.
.. versionadded:: next
.. c:function:: int PyModule_GetToken(PyObject *module, void** result)
Set *\*result* to the module's token and return 0.
On error, set *\*result* to NULL, and return -1 with an exception set.
.. versionadded:: next
See also :c:func:`PyType_GetModuleByToken`.
.. _module-from-slots:
.. _moduledef-dynamic:
Creating extension modules dynamically
--------------------------------------
The following functions may be used to create an extension module dynamically,
rather than from an extension's :ref:`export hook <extension-export-hook>`.
.. c:function:: PyObject *PyModule_FromSlotsAndSpec(const PyModuleDef_Slot *slots, PyObject *spec)
Create a new module object, given an array of :ref:`slots <pymoduledef_slot>`
and the :py:class:`~importlib.machinery.ModuleSpec` *spec*.
The *slots* argument must point to an array of :c:type:`PyModuleDef_Slot`
structures, terminated by an entry slot with slot ID of 0
(typically written as ``{0}`` or ``{0, NULL}`` in C).
The *slots* argument may not be ``NULL``.
The *spec* argument may be any ``ModuleSpec``-like object, as described
in :c:macro:`Py_mod_create` documentation.
Currently, the *spec* must have a ``name`` attribute.
On success, return the new module.
On error, return ``NULL`` with an exception set.
Note that this does not process the module's execution slot
(:c:data:`Py_mod_exec`).
Both :c:func:`!PyModule_FromSlotsAndSpec` and :c:func:`PyModule_Exec`
must be called to fully initialize a module.
(See also :ref:`multi-phase-initialization`.)
The *slots* array only needs to be valid for the duration of the
:c:func:`!PyModule_FromSlotsAndSpec` call.
In particular, it may be heap-allocated.
.. versionadded:: next
.. c:function:: int PyModule_Exec(PyObject *module)
Execute the :c:data:`Py_mod_exec` slot(s) of the given *module*.
On success, return 0.
On error, return -1 with an exception set.
For clarity: If *module* has no slots, for example if it uses
:ref:`legacy single-phase initialization <single-phase-initialization>`,
this function does nothing and returns 0.
.. versionadded:: next
.. _pymoduledef:
Module definition struct
------------------------
Traditionally, extension modules were defined using a *module definition*
as the “description" of how a module should be created.
Rather than using an array of :ref:`slots <pymoduledef_slot>` directly,
the definition has dedicated members for most common functionality,
and allows additional slots as an extension mechanism.
This way of defining modules is still available and there are no plans to
remove it.
.. c:type:: PyModuleDef
The module definition struct, which holds information needed to create
a module object.
This structure must be statically allocated (or be otherwise guaranteed
to be valid while any modules created from it exist).
Usually, there is only one variable of this type for each extension module
defined this way.
.. c:member:: PyModuleDef_Base m_base
Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`:
.. c:namespace:: NULL
.. c:type:: PyModuleDef_Base
The type of :c:member:`!PyModuleDef.m_base`.
.. c:macro:: PyModuleDef_HEAD_INIT
The required initial value for :c:member:`!PyModuleDef.m_base`.
.. c:member:: const char *m_name
Corresponds to the :c:macro:`Py_mod_name` slot.
.. c:member:: const char *m_doc
These members correspond to the :c:macro:`Py_mod_doc` slot.
Setting this to NULL is equivalent to omitting the slot.
.. c:member:: Py_ssize_t m_size
Corresponds to the :c:macro:`Py_mod_state_size` slot.
Setting this to zero is equivalent to omitting the slot.
When using :ref:`legacy single-phase initialization <single-phase-initialization>`
or when creating modules dynamically using :c:func:`PyModule_Create`
or :c:func:`PyModule_Create2`, :c:member:`!m_size` may be set to -1.
This indicates that the module does not support sub-interpreters,
because it has global state.
.. c:member:: PyMethodDef *m_methods
Corresponds to the :c:macro:`Py_mod_methods` slot.
Setting this to NULL is equivalent to omitting the slot.
.. c:member:: PyModuleDef_Slot* m_slots
An array of additional slots, terminated by a ``{0, NULL}`` entry.
This array may not contain slots corresponding to :c:type:`PyModuleDef`
members.
For example, you cannot use :c:macro:`Py_mod_name` in :c:member:`!m_slots`;
the module name must be given as :c:member:`PyModuleDef.m_name`.
.. versionchanged:: 3.5
Prior to version 3.5, this member was always set to ``NULL``,
and was defined as:
.. c:member:: inquiry m_reload
.. c:member:: traverseproc m_traverse
inquiry m_clear
freefunc m_free
These members correspond to the :c:macro:`Py_mod_state_traverse`,
:c:macro:`Py_mod_state_clear`, and :c:macro:`Py_mod_state_free` slots,
respectively.
Setting these members to NULL is equivalent to omitting the
corresponding slots.
.. versionchanged:: 3.9
:c:member:`m_traverse`, :c:member:`m_clear` and :c:member:`m_free`
functions are longer called before the module state is allocated.
.. _moduledef-dynamic:
The following API can be used to create modules from a :c:type:`!PyModuleDef`
struct:
The following functions may be used to create a module outside of an
extension's :ref:`initialization function <extension-export-hook>`.
They are also used in
:ref:`single-phase initialization <single-phase-initialization>`.
.. c:function:: PyObject* PyModule_Create(PyModuleDef *def)
@ -834,13 +492,12 @@ struct:
useful for versioning. This may change in the future.
.. _capi-module-support-functions:
Support functions
-----------------
The following functions are provided to help initialize a module object.
They are intended for a module's execution slot (:c:data:`Py_mod_exec`),
The following functions are provided to help initialize a module
state.
They are intended for a module's execution slots (:c:data:`Py_mod_exec`),
the initialization function for legacy :ref:`single-phase initialization <single-phase-initialization>`,
or code that creates modules dynamically.

View file

@ -85,35 +85,6 @@ Object Protocol
instead of the :func:`repr`.
.. c:function:: void PyUnstable_Object_Dump(PyObject *op)
Dump an object *op* to ``stderr``. This should only be used for debugging.
The output is intended to try dumping objects even after memory corruption:
* Information is written starting with fields that are the least likely to
crash when accessed.
* This function can be called without an :term:`attached thread state`, but
it's not recommended to do so: it can cause deadlocks.
* An object that does not belong to the current interpreter may be dumped,
but this may also cause crashes or unintended behavior.
* Implement a heuristic to detect if the object memory has been freed. Don't
display the object contents in this case, only its memory address.
* The output format may change at any time.
Example of output:
.. code-block:: output
object address : 0x7f80124702c0
object refcount : 2
object type : 0x9902e0
object type name: str
object repr : 'abcdef'
.. versionadded:: next
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, PyObject *attr_name)
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise.
@ -226,13 +197,6 @@ Object Protocol
in favour of using :c:func:`PyObject_DelAttr`, but there are currently no
plans to remove it.
The function must not be called with a ``NULL`` *v* and an exception set.
This case can arise from forgetting ``NULL`` checks and would delete the
attribute.
.. versionchanged:: 3.15
Must not be called with NULL value if an exception is set.
.. c:function:: int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v)
@ -243,10 +207,6 @@ Object Protocol
If *v* is ``NULL``, the attribute is deleted, but this feature is
deprecated in favour of using :c:func:`PyObject_DelAttrString`.
The function must not be called with a ``NULL`` *v* and an exception set.
This case can arise from forgetting ``NULL`` checks and would delete the
attribute.
The number of different attribute names passed to this function
should be kept small, usually by using a statically allocated string
as *attr_name*.
@ -255,10 +215,6 @@ Object Protocol
For more details, see :c:func:`PyUnicode_InternFromString`, which may be
used internally to create a key object.
.. versionchanged:: 3.15
Must not be called with NULL value if an exception is set.
.. c:function:: int PyObject_GenericSetAttr(PyObject *o, PyObject *name, PyObject *value)
Generic attribute setter and deleter function that is meant

View file

@ -5,12 +5,11 @@
Support for Perf Maps
----------------------
On supported platforms (Linux and macOS), the runtime can take
On supported platforms (as of this writing, only Linux), the runtime can take
advantage of *perf map files* to make Python functions visible to an external
profiling tool (such as `perf <https://perf.wiki.kernel.org/index.php/Main_Page>`_ or
`samply <https://github.com/mstange/samply/>`_). A running process may create a
file in the ``/tmp`` directory, which contains entries that can map a section
of executable code to a name. This interface is described in the
profiling tool (such as `perf <https://perf.wiki.kernel.org/index.php/Main_Page>`_).
A running process may create a file in the ``/tmp`` directory, which contains entries
that can map a section of executable code to a name. This interface is described in the
`documentation of the Linux Perf tool <https://git.kernel.org/pub/scm/linux/
kernel/git/torvalds/linux.git/tree/tools/perf/Documentation/jit-interface.txt>`_.

View file

@ -147,7 +147,7 @@ subtypes but not for instances of :class:`frozenset` or its subtypes.
Return ``1`` if found and removed, ``0`` if not found (no action taken), and ``-1`` if an
error is encountered. Does not raise :exc:`KeyError` for missing keys. Raise a
:exc:`TypeError` if the *key* is unhashable. Unlike the Python :meth:`~set.discard`
:exc:`TypeError` if the *key* is unhashable. Unlike the Python :meth:`~frozenset.discard`
method, this function does not automatically convert unhashable sets into
temporary frozensets. Raise :exc:`SystemError` if *set* is not an
instance of :class:`set` or its subtype.

View file

@ -2,9 +2,9 @@
.. _stable:
***********************
C API and ABI Stability
***********************
***************
C API Stability
***************
Unless documented otherwise, Python's C API is covered by the Backwards
Compatibility Policy, :pep:`387`.
@ -199,162 +199,6 @@ This is the case with Windows and macOS releases from ``python.org`` and many
third-party distributors.
ABI Checking
============
.. versionadded:: 3.15
Python includes a rudimentary check for ABI compatibility.
This check is not comprehensive.
It only guards against common cases of incompatible modules being
installed for the wrong interpreter.
It also does not take :ref:`platform incompatibilities <stable-abi-platform>`
into account.
It can only be done after an extension is successfully loaded.
Despite these limitations, it is recommended that extension modules use this
mechanism, so that detectable incompatibilities raise exceptions rather than
crash.
Most modules can use this check via the :c:data:`Py_mod_abi`
slot and the :c:macro:`PyABIInfo_VAR` macro, for example like this:
.. code-block:: c
PyABIInfo_VAR(abi_info);
static PyModuleDef_Slot mymodule_slots[] = {
{Py_mod_abi, &abi_info},
...
};
The full API is described below for advanced use cases.
.. c:function:: int PyABIInfo_Check(PyABIInfo *info, const char *module_name)
Verify that the given *info* is compatible with the currently running
interpreter.
Return 0 on success. On failure, raise an exception and return -1.
If the ABI is incompatible, the raised exception will be :py:exc:`ImportError`.
The *module_name* argument can be ``NULL``, or point to a NUL-terminated
UTF-8-encoded string used for error messages.
Note that if *info* describes the ABI that the current code uses (as defined
by :c:macro:`PyABIInfo_VAR`, for example), using any other Python C API
may lead to crashes.
In particular, it is not safe to examine the raised exception.
.. versionadded:: 3.15
.. c:macro:: PyABIInfo_VAR(NAME)
Define a static :c:struct:`PyABIInfo` variable with the given *NAME* that
describes the ABI that the current code will use.
This macro expands to:
.. code-block:: c
static PyABIInfo NAME = {
1, 0,
PyABIInfo_DEFAULT_FLAGS,
PY_VERSION_HEX,
PyABIInfo_DEFAULT_ABI_VERSION
}
.. versionadded:: 3.15
.. c:type:: PyABIInfo
.. c:member:: uint8_t abiinfo_major_version
The major version of :c:struct:`PyABIInfo`. Can be set to:
* ``0`` to skip all checking, or
* ``1`` to specify this version of :c:struct:`!PyABIInfo`.
.. c:member:: uint8_t abiinfo_minor_version
The minor version of :c:struct:`PyABIInfo`.
Must be set to ``0``; larger values are reserved for backwards-compatible
future versions of :c:struct:`!PyABIInfo`.
.. c:member:: uint16_t flags
.. c:namespace:: NULL
This field is usually set to the following macro:
.. c:macro:: PyABIInfo_DEFAULT_FLAGS
Default flags, based on current values of macros such as
:c:macro:`Py_LIMITED_API` and :c:macro:`Py_GIL_DISABLED`.
Alternately, the field can be set to the following flags, combined
by bitwise OR.
Unused bits must be set to zero.
ABI variant -- one of:
.. c:macro:: PyABIInfo_STABLE
Specifies that the stable ABI is used.
.. c:macro:: PyABIInfo_INTERNAL
Specifies ABI specific to a particular build of CPython.
Internal use only.
Free-threading compatibility -- one of:
.. c:macro:: PyABIInfo_FREETHREADED
Specifies ABI compatible with free-threading builds of CPython.
(That is, ones compiled with :option:`--disable-gil`; with ``t``
in :py:data:`sys.abiflags`)
.. c:macro:: PyABIInfo_GIL
Specifies ABI compatible with non-free-threading builds of CPython
(ones compiled *without* :option:`--disable-gil`).
.. c:member:: uint32_t build_version
The version of the Python headers used to build the code, in the format
used by :c:macro:`PY_VERSION_HEX`.
This can be set to ``0`` to skip any checks related to this field.
This option is meant mainly for projects that do not use the CPython
headers directly, and do not emulate a specific version of them.
.. c:member:: uint32_t abi_version
The ABI version.
For the Stable ABI, this field should be the value of
:c:macro:`Py_LIMITED_API`
(except if :c:macro:`Py_LIMITED_API` is ``3``; use
:c:expr:`Py_PACK_VERSION(3, 2)` in that case).
Otherwise, it should be set to :c:macro:`PY_VERSION_HEX`.
It can also be set to ``0`` to skip any checks related to this field.
.. c:namespace:: NULL
.. c:macro:: PyABIInfo_DEFAULT_ABI_VERSION
The value that should be used for this field, based on current
values of macros such as :c:macro:`Py_LIMITED_API`,
:c:macro:`PY_VERSION_HEX` and :c:macro:`Py_GIL_DISABLED`.
.. versionadded:: 3.15
.. _limited-api-list:
Contents of Limited API

View file

@ -280,8 +280,6 @@ Implementing functions and methods
Name of the method.
A ``NULL`` *ml_name* marks the end of a :c:type:`!PyMethodDef` array.
.. c:member:: PyCFunction ml_meth
Pointer to the C implementation.

View file

@ -276,57 +276,10 @@ These are utility functions that make functionality from the :mod:`sys` module
accessible to C code. They all work with the current interpreter thread's
:mod:`sys` module's dict, which is contained in the internal thread state structure.
.. c:function:: PyObject *PySys_GetAttr(PyObject *name)
Get the attribute *name* of the :mod:`sys` module.
Return a :term:`strong reference`.
Raise :exc:`RuntimeError` and return ``NULL`` if it does not exist or
if the :mod:`sys` module cannot be found.
If the non-existing object should not be treated as a failure, you can use
:c:func:`PySys_GetOptionalAttr` instead.
.. versionadded:: 3.15
.. c:function:: PyObject *PySys_GetAttrString(const char *name)
This is the same as :c:func:`PySys_GetAttr`, but *name* is
specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
rather than a :c:expr:`PyObject*`.
If the non-existing object should not be treated as a failure, you can use
:c:func:`PySys_GetOptionalAttrString` instead.
.. versionadded:: 3.15
.. c:function:: int PySys_GetOptionalAttr(PyObject *name, PyObject **result)
Variant of :c:func:`PySys_GetAttr` which doesn't raise
exception if the object does not exist.
* Set *\*result* to a new :term:`strong reference` to the object and
return ``1`` if the object exists.
* Set *\*result* to ``NULL`` and return ``0`` without setting an exception
if the object does not exist.
* Set an exception, set *\*result* to ``NULL``, and return ``-1``,
if an error occurred.
.. versionadded:: 3.15
.. c:function:: int PySys_GetOptionalAttrString(const char *name, PyObject **result)
This is the same as :c:func:`PySys_GetOptionalAttr`, but *name* is
specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
rather than a :c:expr:`PyObject*`.
.. versionadded:: 3.15
.. c:function:: PyObject *PySys_GetObject(const char *name)
Similar to :c:func:`PySys_GetAttrString`, but return a :term:`borrowed
reference` and return ``NULL`` *without* setting exception on failure.
Preserves exception that was set before the call.
Return the object *name* from the :mod:`sys` module or ``NULL`` if it does
not exist, without setting an exception.
.. c:function:: int PySys_SetObject(const char *name, PyObject *v)
@ -334,6 +287,14 @@ accessible to C code. They all work with the current interpreter thread's
case *name* is deleted from the sys module. Returns ``0`` on success, ``-1``
on error.
.. c:function:: void PySys_ResetWarnOptions()
Reset :data:`sys.warnoptions` to an empty list. This function may be
called prior to :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
.. c:function:: void PySys_WriteStdout(const char *format, ...)
Write the output string described by *format* to :data:`sys.stdout`. No

View file

@ -37,19 +37,6 @@ Tuple Objects
or ``NULL`` with an exception set on failure.
.. c:function:: PyObject* PyTuple_FromArray(PyObject *const *array, Py_ssize_t size)
Create a tuple of *size* items and copy references from *array* to the new
tuple.
*array* can be NULL if *size* is ``0``.
On success, return a new reference.
On error, set an exception and return ``NULL``.
.. versionadded:: 3.15
.. c:function:: PyObject* PyTuple_Pack(Py_ssize_t n, ...)
Return a new tuple object of size *n*,

View file

@ -283,8 +283,8 @@ Type Objects
``Py_TYPE(self)`` may be a *subclass* of the intended class, and subclasses
are not necessarily defined in the same module as their superclass.
See :c:type:`PyCMethod` to get the class that defines the method.
See :c:func:`PyType_GetModuleByToken` for cases when :c:type:`!PyCMethod`
cannot be used.
See :c:func:`PyType_GetModuleByDef` for cases when :c:type:`!PyCMethod` cannot
be used.
.. versionadded:: 3.9
@ -304,10 +304,10 @@ Type Objects
.. versionadded:: 3.9
.. c:function:: PyObject* PyType_GetModuleByToken(PyTypeObject *type, const void *mod_token)
.. c:function:: PyObject* PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def)
Find the first superclass whose module has the given
:ref:`module token <ext-module-token>`, and return that module.
Find the first superclass whose module was created from
the given :c:type:`PyModuleDef` *def*, and return that module.
If no module is found, raises a :py:class:`TypeError` and returns ``NULL``.
@ -317,23 +317,6 @@ Type Objects
and other places where a method's defining class cannot be passed using the
:c:type:`PyCMethod` calling convention.
.. versionadded:: next
.. c:function:: PyObject* PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def)
Find the first superclass whose module was created from the given
:c:type:`PyModuleDef` *def*, or whose :ref:`module token <ext-module-token>`
is equal to *def*, and return that module.
Note that modules created from a :c:type:`PyModuleDef` always have their
token set to the :c:type:`PyModuleDef`'s address.
In other words, this function is equivalent to
:c:func:`PyType_GetModuleByToken`, except that it:
- returns a borrowed reference, and
- has a non-``void*`` argument type (which is a cosmetic difference in C).
The returned reference is :term:`borrowed <borrowed reference>` from *type*,
and will be valid as long as you hold a reference to *type*.
Do not release it with :c:func:`Py_DECREF` or similar.
@ -341,10 +324,10 @@ Type Objects
.. versionadded:: 3.11
.. c:function:: int PyType_GetBaseByToken(PyTypeObject *type, void *tp_token, PyTypeObject **result)
.. c:function:: int PyType_GetBaseByToken(PyTypeObject *type, void *token, PyTypeObject **result)
Find the first superclass in *type*'s :term:`method resolution order` whose
:c:macro:`Py_tp_token` token is equal to *tp_token*.
:c:macro:`Py_tp_token` token is equal to the given one.
* If found, set *\*result* to a new :term:`strong reference`
to it and return ``1``.
@ -355,7 +338,7 @@ Type Objects
The *result* argument may be ``NULL``, in which case *\*result* is not set.
Use this if you need only the return value.
The *tp_token* argument may not be ``NULL``.
The *token* argument may not be ``NULL``.
.. versionadded:: 3.14

View file

@ -1278,7 +1278,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
This bit indicates that instances of the class have a :attr:`~object.__dict__`
attribute, and that the space for the dictionary is managed by the VM.
If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` must also be set.
If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set.
The type traverse function must call :c:func:`PyObject_VisitManagedDict`
and its clear function must call :c:func:`PyObject_ClearManagedDict`.
@ -1296,8 +1296,6 @@ and :c:data:`PyType_Type` effectively act as defaults.)
This bit indicates that instances of the class should be weakly
referenceable.
If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` must also be set.
.. versionadded:: 3.12
**Inheritance:**
@ -1306,19 +1304,6 @@ and :c:data:`PyType_Type` effectively act as defaults.)
:c:member:`~PyTypeObject.tp_weaklistoffset` field is set in a superclass.
.. c:macro:: Py_TPFLAGS_PREHEADER
These bits indicate that the VM will manage some fields by storing them
before the object. Currently, this macro is equivalent to
:c:expr:`Py_TPFLAGS_MANAGED_DICT | Py_TPFLAGS_MANAGED_WEAKREF`.
This macro value relies on the implementation of the VM, so its value is not
stable and may change in a future version. Prefer using individual
flags instead.
.. versionadded:: 3.12
.. c:macro:: Py_TPFLAGS_ITEMS_AT_END
Only usable with variable-size types, i.e. ones with non-zero

View file

@ -191,22 +191,6 @@ access to internal read-only data of Unicode objects:
.. versionadded:: 3.2
.. c:function:: Py_hash_t PyUnstable_Unicode_GET_CACHED_HASH(PyObject *str)
If the hash of *str*, as returned by :c:func:`PyObject_Hash`, has been
cached and is immediately available, return it.
Otherwise, return ``-1`` *without* setting an exception.
If *str* is not a string (that is, if ``PyUnicode_Check(obj)``
is false), the behavior is undefined.
This function never fails with an exception.
Note that there are no guarantees on when an object's hash is cached,
and the (non-)existence of a cached hash does not imply that the string has
any other properties.
Unicode Character Properties
""""""""""""""""""""""""""""

View file

@ -79,6 +79,30 @@ as much as it can.
.. versionadded:: 3.13
.. c:function:: PyObject* PyWeakref_GetObject(PyObject *ref)
Return a :term:`borrowed reference` to the referenced object from a weak
reference, *ref*. If the referent is no longer live, returns ``Py_None``.
.. note::
This function returns a :term:`borrowed reference` to the referenced object.
This means that you should always call :c:func:`Py_INCREF` on the object
except when it cannot be destroyed before the last usage of the borrowed
reference.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyWeakref_GetRef` instead.
.. c:function:: PyObject* PyWeakref_GET_OBJECT(PyObject *ref)
Similar to :c:func:`PyWeakref_GetObject`, but does no error checking.
.. deprecated-removed:: 3.13 3.15
Use :c:func:`PyWeakref_GetRef` instead.
.. c:function:: int PyWeakref_IsDead(PyObject *ref)
Test if the weak reference *ref* is dead. Returns 1 if the reference is

31645
Doc/data/python3.14.abi Normal file

File diff suppressed because it is too large Load diff

View file

@ -1117,6 +1117,9 @@ PyImport_ImportModuleLevelObject:PyObject*:locals:0:???
PyImport_ImportModuleLevelObject:PyObject*:fromlist:0:???
PyImport_ImportModuleLevelObject:int:level::
PyImport_ImportModuleNoBlock:PyObject*::+1:
PyImport_ImportModuleNoBlock:const char*:name::
PyImport_ReloadModule:PyObject*::+1:
PyImport_ReloadModule:PyObject*:m:0:
@ -1472,9 +1475,6 @@ PyModule_Create2:PyObject*::+1:
PyModule_Create2:PyModuleDef*:def::
PyModule_Create2:int:module_api_version::
PyModule_Exec:int:::
PyModule_ExecDef:PyObject*:module:0:
PyModule_ExecDef:int:::
PyModule_ExecDef:PyObject*:module:0:
PyModule_ExecDef:PyModuleDef*:def::
@ -1488,10 +1488,6 @@ PyModule_FromDefAndSpec2:PyModuleDef*:def::
PyModule_FromDefAndSpec2:PyObject*:spec:0:
PyModule_FromDefAndSpec2:int:module_api_version::
PyModule_FromSlotsAndSpec:PyObject*::+1:
PyModule_FromSlotsAndSpec:const PyModuleDef_Slot *:slots::
PyModule_FromSlotsAndSpec:PyObject*:spec:0:
PyModule_GetDef:PyModuleDef*::0:
PyModule_GetDef:PyObject*:module:0:
@ -1513,14 +1509,6 @@ PyModule_GetNameObject:PyObject*:module:0:
PyModule_GetState:void*:::
PyModule_GetState:PyObject*:module:0:
PyModule_GetStateSize:int:::
PyModule_GetStateSize:PyObject*:module:0:
PyModule_GetToken:Py_ssize_t**:result::
PyModule_GetToken:int:::
PyModule_GetToken:PyObject*:module:0:
PyModule_GetToken:void**:result::
PyModule_New:PyObject*::+1:
PyModule_New:char*:name::
@ -2427,10 +2415,6 @@ PyType_GetFlags:PyTypeObject*:type:0:
PyType_GetName:PyObject*::+1:
PyType_GetName:PyTypeObject*:type:0:
PyType_GetModuleByToken:PyObject*::+1:
PyType_GetModuleByToken:PyTypeObject*:type:0:
PyType_GetModuleByToken:PyModuleDef*:def::
PyType_GetModuleByDef:PyObject*::0:
PyType_GetModuleByDef:PyTypeObject*:type:0:
PyType_GetModuleByDef:PyModuleDef*:def::
@ -2969,6 +2953,12 @@ PyWeakref_CheckProxy:PyObject*:ob:0:
PyWeakref_CheckRef:int:::
PyWeakref_CheckRef:PyObject*:ob:0:
PyWeakref_GET_OBJECT:PyObject*::0:
PyWeakref_GET_OBJECT:PyObject*:ref:0:
PyWeakref_GetObject:PyObject*::0:
PyWeakref_GetObject:PyObject*:ref:0:
PyWeakref_GetRef:int:::
PyWeakref_GetRef:PyObject*:ref:0:
PyWeakref_GetRef:PyObject**:pobj:+1:
@ -3048,8 +3038,18 @@ Py_GetCompiler:const char*:::
Py_GetCopyright:const char*:::
Py_GetExecPrefix:wchar_t*:::
Py_GetPath:wchar_t*:::
Py_GetPlatform:const char*:::
Py_GetPrefix:wchar_t*:::
Py_GetProgramFullPath:wchar_t*:::
Py_GetProgramName:wchar_t*:::
Py_GetVersion:const char*:::
Py_INCREF:void:::

View file

@ -8,15 +8,6 @@ macro,METH_O,3.2,,
macro,METH_STATIC,3.2,,
macro,METH_VARARGS,3.2,,
macro,PY_VECTORCALL_ARGUMENTS_OFFSET,3.12,,
type,PyABIInfo,3.15,,full-abi
func,PyABIInfo_Check,3.15,,
macro,PyABIInfo_DEFAULT_ABI_VERSION,3.15,,
macro,PyABIInfo_DEFAULT_FLAGS,3.15,,
macro,PyABIInfo_FREETHREADED,3.15,,
macro,PyABIInfo_FREETHREADING_AGNOSTIC,3.15,,
macro,PyABIInfo_GIL,3.15,,
macro,PyABIInfo_STABLE,3.15,,
macro,PyABIInfo_VAR,3.15,,
func,PyAIter_Check,3.10,,
func,PyArg_Parse,3.2,,
func,PyArg_ParseTuple,3.2,,
@ -160,7 +151,6 @@ func,PyDict_Merge,3.2,,
func,PyDict_MergeFromSeq2,3.2,,
func,PyDict_New,3.2,,
func,PyDict_Next,3.2,,
func,PyDict_SetDefaultRef,3.15,,
func,PyDict_SetItem,3.2,,
func,PyDict_SetItemString,3.2,,
func,PyDict_Size,3.2,,
@ -361,6 +351,7 @@ func,PyImport_ImportFrozenModuleObject,3.7,,
func,PyImport_ImportModule,3.2,,
func,PyImport_ImportModuleLevel,3.2,,
func,PyImport_ImportModuleLevelObject,3.7,,
func,PyImport_ImportModuleNoBlock,3.2,,
func,PyImport_ReloadModule,3.2,,
func,PyIndex_Check,3.8,,
type,PyInterpreterState,3.2,,opaque
@ -426,7 +417,6 @@ func,PyLong_FromUnsignedNativeBytes,3.14,,
func,PyLong_FromVoidPtr,3.2,,
func,PyLong_GetInfo,3.2,,
data,PyLong_Type,3.2,,
macro,PyMODEXPORT_FUNC,3.15,,
data,PyMap_Type,3.2,,
func,PyMapping_Check,3.2,,
func,PyMapping_GetItemString,3.2,,
@ -474,10 +464,8 @@ func,PyModule_AddObjectRef,3.10,,
func,PyModule_AddStringConstant,3.2,,
func,PyModule_AddType,3.10,,
func,PyModule_Create2,3.2,,
func,PyModule_Exec,3.15,,
func,PyModule_ExecDef,3.7,,
func,PyModule_FromDefAndSpec2,3.7,,
func,PyModule_FromSlotsAndSpec,3.15,,
func,PyModule_GetDef,3.2,,
func,PyModule_GetDict,3.2,,
func,PyModule_GetFilename,3.2,,
@ -485,8 +473,6 @@ func,PyModule_GetFilenameObject,3.2,,
func,PyModule_GetName,3.2,,
func,PyModule_GetNameObject,3.7,,
func,PyModule_GetState,3.2,,
func,PyModule_GetStateSize,3.15,,
func,PyModule_GetToken,3.15,,
func,PyModule_New,3.2,,
func,PyModule_NewObject,3.7,,
func,PyModule_SetDocString,3.7,,
@ -672,12 +658,9 @@ func,PySys_Audit,3.13,,
func,PySys_AuditTuple,3.13,,
func,PySys_FormatStderr,3.2,,
func,PySys_FormatStdout,3.2,,
func,PySys_GetAttr,3.15,,
func,PySys_GetAttrString,3.15,,
func,PySys_GetObject,3.2,,
func,PySys_GetOptionalAttr,3.15,,
func,PySys_GetOptionalAttrString,3.15,,
func,PySys_GetXOptions,3.7,,
func,PySys_ResetWarnOptions,3.2,,
func,PySys_SetArgv,3.2,,
func,PySys_SetArgvEx,3.2,,
func,PySys_SetObject,3.2,,
@ -745,7 +728,6 @@ func,PyType_GetFlags,3.2,,
func,PyType_GetFullyQualifiedName,3.13,,
func,PyType_GetModule,3.10,,
func,PyType_GetModuleByDef,3.13,,
func,PyType_GetModuleByToken,3.15,,
func,PyType_GetModuleName,3.13,,
func,PyType_GetModuleState,3.10,,
func,PyType_GetName,3.11,,
@ -787,7 +769,11 @@ func,PyUnicode_Append,3.2,,
func,PyUnicode_AppendAndDel,3.2,,
func,PyUnicode_AsASCIIString,3.2,,
func,PyUnicode_AsCharmapString,3.2,,
func,PyUnicode_AsDecodedObject,3.2,,
func,PyUnicode_AsDecodedUnicode,3.2,,
func,PyUnicode_AsEncodedObject,3.2,,
func,PyUnicode_AsEncodedString,3.2,,
func,PyUnicode_AsEncodedUnicode,3.2,,
func,PyUnicode_AsLatin1String,3.2,,
func,PyUnicode_AsMBCSString,3.7,on Windows,
func,PyUnicode_AsRawUnicodeEscapeString,3.2,,
@ -872,6 +858,7 @@ member,PyVarObject.ob_size,3.2,,
func,PyVectorcall_Call,3.12,,
func,PyVectorcall_NARGS,3.12,,
type,PyWeakReference,3.2,,opaque
func,PyWeakref_GetObject,3.2,,
func,PyWeakref_GetRef,3.13,,
func,PyWeakref_NewProxy,3.2,,
func,PyWeakref_NewRef,3.2,,
@ -912,11 +899,16 @@ func,Py_GetCompiler,3.2,,
func,Py_GetConstant,3.13,,
func,Py_GetConstantBorrowed,3.13,,
func,Py_GetCopyright,3.2,,
func,Py_GetExecPrefix,3.2,,
func,Py_GetPath,3.2,,
func,Py_GetPlatform,3.2,,
func,Py_GetPrefix,3.2,,
func,Py_GetProgramFullPath,3.2,,
func,Py_GetProgramName,3.2,,
func,Py_GetPythonHome,3.2,,
func,Py_GetRecursionLimit,3.2,,
func,Py_GetVersion,3.2,,
data,Py_HasFileSystemDefaultEncoding,3.2,,
func,Py_IS_TYPE,3.15,,
func,Py_IncRef,3.2,,
func,Py_Initialize,3.2,,
func,Py_InitializeEx,3.2,,
@ -938,8 +930,6 @@ func,Py_REFCNT,3.14,,
macro,Py_RELATIVE_OFFSET,3.12,,
func,Py_ReprEnter,3.2,,
func,Py_ReprLeave,3.2,,
func,Py_SET_SIZE,3.15,,
func,Py_SIZE,3.15,,
func,Py_SetProgramName,3.2,,
func,Py_SetPythonHome,3.2,,
func,Py_SetRecursionLimit,3.2,,
@ -983,19 +973,10 @@ macro,Py_bf_getbuffer,3.11,,
macro,Py_bf_releasebuffer,3.11,,
type,Py_buffer,3.11,,full-abi
type,Py_intptr_t,3.2,,
macro,Py_mod_abi,3.15,,
macro,Py_mod_create,3.5,,
macro,Py_mod_doc,3.15,,
macro,Py_mod_exec,3.5,,
macro,Py_mod_gil,3.13,,
macro,Py_mod_methods,3.15,,
macro,Py_mod_multiple_interpreters,3.12,,
macro,Py_mod_name,3.15,,
macro,Py_mod_state_clear,3.15,,
macro,Py_mod_state_free,3.15,,
macro,Py_mod_state_size,3.15,,
macro,Py_mod_state_traverse,3.15,,
macro,Py_mod_token,3.15,,
macro,Py_mp_ass_subscript,3.2,,
macro,Py_mp_length,3.2,,
macro,Py_mp_subscript,3.2,,

View file

@ -1,9 +1,9 @@
Pending removal in Python 3.15
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* The :c:func:`!PyImport_ImportModuleNoBlock`:
* The :c:func:`PyImport_ImportModuleNoBlock`:
Use :c:func:`PyImport_ImportModule` instead.
* :c:func:`!PyWeakref_GetObject` and :c:func:`!PyWeakref_GET_OBJECT`:
* :c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`:
Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project
<https://github.com/python/pythoncapi-compat/>`__ can be used to get
:c:func:`PyWeakref_GetRef` on Python 3.12 and older.
@ -21,27 +21,27 @@ Pending removal in Python 3.15
may return a type other than :class:`bytes`, such as :class:`str`.
* Python initialization functions, deprecated in Python 3.13:
* :c:func:`!Py_GetPath`:
* :c:func:`Py_GetPath`:
Use :c:func:`PyConfig_Get("module_search_paths") <PyConfig_Get>`
(:data:`sys.path`) instead.
* :c:func:`!Py_GetPrefix`:
* :c:func:`Py_GetPrefix`:
Use :c:func:`PyConfig_Get("base_prefix") <PyConfig_Get>`
(:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get("prefix")
<PyConfig_Get>` (:data:`sys.prefix`) if :ref:`virtual environments
<venv-def>` need to be handled.
* :c:func:`!Py_GetExecPrefix`:
* :c:func:`Py_GetExecPrefix`:
Use :c:func:`PyConfig_Get("base_exec_prefix") <PyConfig_Get>`
(:data:`sys.base_exec_prefix`) instead. Use
:c:func:`PyConfig_Get("exec_prefix") <PyConfig_Get>`
(:data:`sys.exec_prefix`) if :ref:`virtual environments <venv-def>` need to
be handled.
* :c:func:`!Py_GetProgramFullPath`:
* :c:func:`Py_GetProgramFullPath`:
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
(:data:`sys.executable`) instead.
* :c:func:`!Py_GetProgramName`:
* :c:func:`Py_GetProgramName`:
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
(:data:`sys.executable`) instead.
* :c:func:`!Py_GetPythonHome`:
* :c:func:`Py_GetPythonHome`:
Use :c:func:`PyConfig_Get("home") <PyConfig_Get>` or the
:envvar:`PYTHONHOME` environment variable instead.
@ -59,7 +59,7 @@ Pending removal in Python 3.15
Set :c:member:`PyConfig.program_name` instead.
* :c:func:`!Py_SetPythonHome()`:
Set :c:member:`PyConfig.home` instead.
* :c:func:`!PySys_ResetWarnOptions`:
* :c:func:`PySys_ResetWarnOptions`:
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
The :c:func:`Py_InitializeFromConfig` API should be used with

View file

@ -1,9 +0,0 @@
Pending removal in Python 3.20
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* The ``cval`` field in :c:type:`PyComplexObject` (:gh:`128813`).
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`
to convert a Python complex number to/from the C :c:type:`Py_complex`
representation.
* Macros :c:macro:`!Py_MATH_PIl` and :c:macro:`!Py_MATH_El`.

View file

@ -9,8 +9,6 @@ Deprecations
.. include:: pending-removal-in-3.19.rst
.. include:: pending-removal-in-3.20.rst
.. include:: pending-removal-in-future.rst
C API deprecations
@ -20,6 +18,4 @@ C API deprecations
.. include:: c-api-pending-removal-in-3.18.rst
.. include:: c-api-pending-removal-in-3.20.rst
.. include:: c-api-pending-removal-in-future.rst

View file

@ -20,7 +20,7 @@ Pending removal in Python 3.15
* :mod:`http.server`:
* The obsolete and rarely used :class:`!CGIHTTPRequestHandler`
* The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler`
has been deprecated since Python 3.13.
No direct replacement exists.
*Anything* is better than CGI to interface
@ -45,13 +45,13 @@ Pending removal in Python 3.15
* :mod:`pathlib`:
* :meth:`!.PurePath.is_reserved`
* :meth:`.PurePath.is_reserved`
has been deprecated since Python 3.13.
Use :func:`os.path.isreserved` to detect reserved paths on Windows.
* :mod:`platform`:
* :func:`!platform.java_ver` has been deprecated since Python 3.13.
* :func:`~platform.java_ver` has been deprecated since Python 3.13.
This function is only useful for Jython support, has a confusing API,
and is largely untested.
@ -92,21 +92,20 @@ Pending removal in Python 3.15
Use ``class TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``
to create a TypedDict with zero field.
* The :func:`!typing.no_type_check_decorator` decorator function
* The :func:`typing.no_type_check_decorator` decorator function
has been deprecated since Python 3.13.
After eight years in the :mod:`typing` module,
it has yet to be supported by any major type checker.
* :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules.
* :mod:`wave`:
* The ``getmark()``, ``setmark()`` and ``getmarkers()`` methods of
* The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`,
and :meth:`~wave.Wave_read.getmarkers` methods of
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes
have been deprecated since Python 3.13.
* :mod:`zipimport`:
* :meth:`!zipimport.zipimporter.load_module` has been deprecated since
* :meth:`~zipimport.zipimporter.load_module` has been deprecated since
Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead.
(:gh:`125746`.)
(Contributed by Jiahao Li in :gh:`125746`.)

View file

@ -63,9 +63,9 @@ Pending removal in Python 3.16
* :mod:`logging`:
* Support for custom logging handlers with the *strm* argument is deprecated
and scheduled for removal in Python 3.16. Define handlers with the *stream*
argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)
Support for custom logging handlers with the *strm* argument is deprecated
and scheduled for removal in Python 3.16. Define handlers with the *stream*
argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)
* :mod:`mimetypes`:

View file

@ -23,12 +23,6 @@ Pending removal in Python 3.17
(Contributed by Shantanu Jain in :gh:`91896`.)
* :mod:`encodings`:
- Passing non-ascii *encoding* names to :func:`encodings.normalize_encoding`
is deprecated and scheduled for removal in Python 3.17.
(Contributed by Stan Ulbrych in :gh:`136702`)
* :mod:`typing`:
- Before Python 3.14, old-style unions were implemented using the private class

View file

@ -6,19 +6,3 @@ Pending removal in Python 3.19
* Implicitly switching to the MSVC-compatible struct layout by setting
:attr:`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_`
on non-Windows platforms.
* :mod:`hashlib`:
- In hash function constructors such as :func:`~hashlib.new` or the
direct hash-named constructors such as :func:`~hashlib.md5` and
:func:`~hashlib.sha256`, their optional initial data parameter could
also be passed a keyword argument named ``data=`` or ``string=`` in
various :mod:`!hashlib` implementations.
Support for the ``string`` keyword argument name is now deprecated
and slated for removal in Python 3.19.
Before Python 3.13, the ``string`` keyword parameter was not correctly
supported depending on the backend implementation of hash functions.
Prefer passing the initial data as a positional argument for maximum
backwards compatibility.

View file

@ -1,26 +0,0 @@
Pending removal in Python 3.20
------------------------------
* The ``__version__`` attribute has been deprecated in these standard library
modules and will be removed in Python 3.20.
Use :py:data:`sys.version_info` instead.
- :mod:`argparse`
- :mod:`csv`
- :mod:`!ctypes.macholib`
- :mod:`decimal` (use :data:`decimal.SPEC_VERSION` instead)
- :mod:`imaplib`
- :mod:`ipaddress`
- :mod:`json`
- :mod:`logging` (``__date__`` also deprecated)
- :mod:`optparse`
- :mod:`pickle`
- :mod:`platform`
- :mod:`re`
- :mod:`socketserver`
- :mod:`tabnanny`
- :mod:`tkinter.font`
- :mod:`tkinter.ttk`
- :mod:`zlib`
(Contributed by Hugo van Kemenade and Stan Ulbrych in :gh:`76007`.)

View file

@ -76,7 +76,7 @@ although there is currently no date scheduled for their removal.
* :mod:`mailbox`: Use of StringIO input and text mode is deprecated, use
BytesIO and binary mode instead.
* :mod:`os`: Calling :func:`os.register_at_fork` in a multi-threaded process.
* :mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process.
* :class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is
deprecated, use an exception instance.
@ -88,6 +88,8 @@ although there is currently no date scheduled for their removal.
underscore.
(Contributed by Serhiy Storchaka in :gh:`91760`.)
* :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules.
* :mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in
Python 3.12; use the *onexc* parameter instead.

View file

@ -560,8 +560,6 @@ For an object to be weakly referenceable, the extension type must set the
field. The legacy :c:member:`~PyTypeObject.tp_weaklistoffset` field should
be left as zero.
If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set.
Concretely, here is how the statically declared type object would look::
static PyTypeObject TrivialType = {

View file

@ -420,12 +420,10 @@ strings representing the files in the current directory. Functions which
operate on this output would generally not break if you added another file or
two to the directory.
Tuples are :term:`immutable`, meaning that once a tuple has been created, you can't
replace any of its elements with a new value. Lists are :term:`mutable`, meaning that
you can always change a list's elements. Only :term:`hashable` objects can
be used as dictionary keys. Most immutable types are hashable, which is why
tuples, but not lists, can be used as keys. Note, however, that a tuple is
only hashable if all of its elements are hashable.
Tuples are immutable, meaning that once a tuple has been created, you can't
replace any of its elements with a new value. Lists are mutable, meaning that
you can always change a list's elements. Only immutable elements can be used as
dictionary keys, and hence only tuples and not lists can be used as keys.
How are lists implemented in CPython?

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -1,7 +1,7 @@
.. _a-conceptual-overview-of-asyncio:
****************************************
A conceptual overview of :mod:`!asyncio`
A Conceptual Overview of :mod:`!asyncio`
****************************************
This :ref:`HOWTO <how-tos>` article seeks to help you build a sturdy mental
@ -37,15 +37,15 @@ In part 1, we'll cover the main, high-level building blocks of :mod:`!asyncio`:
the event loop, coroutine functions, coroutine objects, tasks, and ``await``.
==========
Event loop
Event Loop
==========
Everything in :mod:`!asyncio` happens relative to the event loop.
It's the star of the show, but prefers to work behind the scenes, managing
and coordinating resources.
It's the star of the show.
It's like an orchestra conductor.
It's behind the scenes managing resources.
Some power is explicitly granted to it, but a lot of its ability to get things
done comes from the respect and cooperation of its band members.
done comes from the respect and cooperation of its worker bees.
In more technical terms, the event loop contains a collection of jobs to be run.
Some jobs are added directly by you, and some indirectly by :mod:`!asyncio`.
@ -59,7 +59,7 @@ This process repeats indefinitely, with the event loop cycling endlessly
onwards.
If there are no more jobs pending execution, the event loop is smart enough to
rest and avoid needlessly wasting CPU cycles, and will come back when there's
more work to be done, such as when I/O operations complete or timers expire.
more work to be done.
Effective execution relies on jobs sharing well and cooperating; a greedy job
could hog control and leave the other jobs to starve, rendering the overall
@ -170,10 +170,10 @@ Roughly speaking, :ref:`tasks <asyncio-task-obj>` are coroutines (not coroutine
functions) tied to an event loop.
A task also maintains a list of callback functions whose importance will become
clear in a moment when we discuss :keyword:`await`.
The recommended way to create tasks is via :func:`asyncio.create_task`.
Creating a task automatically schedules it for execution (by adding a
callback to run it in the event loop's to-do list, that is, collection of jobs).
The recommended way to create tasks is via :func:`asyncio.create_task`.
:mod:`!asyncio` automatically associates tasks with the event loop for you.
This automatic association was purposely designed into :mod:`!asyncio` for
@ -253,10 +253,6 @@ different ways::
In a crucial way, the behavior of ``await`` depends on the type of object
being awaited.
^^^^^^^^^^^^^^
Awaiting tasks
^^^^^^^^^^^^^^
Awaiting a task will cede control from the current task or coroutine to
the event loop.
In the process of relinquishing control, a few important things happen.
@ -288,10 +284,6 @@ This is a basic, yet reliable mental model.
In practice, the control handoffs are slightly more complex, but not by much.
In part 2, we'll walk through the details that make this possible.
^^^^^^^^^^^^^^^^^^^
Awaiting coroutines
^^^^^^^^^^^^^^^^^^^
**Unlike tasks, awaiting a coroutine does not hand control back to the event
loop!**
Wrapping a coroutine in a task first, then awaiting that would cede
@ -358,10 +350,8 @@ The design intentionally trades off some conceptual clarity around usage of
``await`` for improved performance.
Each time a task is awaited, control needs to be passed all the way up the
call stack to the event loop.
Then, the event loop needs to manage its internal state and work through
its processing logic to resume the next job.
That might sound minor, but in a large program with many ``await``\ s, that
overhead can add up to a non-negligible performance drag.
That might sound minor, but in a large program with many ``await`` statements and a deep
call stack, that overhead can add up to a meaningful performance drag.
------------------------------------------------
A conceptual overview part 2: the nuts and bolts
@ -377,8 +367,7 @@ and how to make your own asynchronous operators.
The inner workings of coroutines
================================
:mod:`!asyncio` leverages four components of Python to pass
around control.
:mod:`!asyncio` leverages four components to pass around control.
:meth:`coroutine.send(arg) <generator.send>` is the method used to start or
resume a coroutine.
@ -462,9 +451,9 @@ That might sound odd to you. You might be thinking:
That causes the error: ``SyntaxError: yield from not allowed in a coroutine.``
This was intentionally designed for the sake of simplicity -- mandating only
one way of using coroutines.
Despite that, ``yield from`` and ``await`` effectively do the same thing.
Initially ``yield`` was barred as well, but was re-accepted to allow for
async generators.
Despite that, ``yield from`` and ``await`` effectively do the same thing.
=======
Futures

View file

@ -161,8 +161,6 @@ your terminal won't be left in a funny state on exception and you'll be
able to read the exception's message and traceback.
.. _windows-and-pads:
Windows and Pads
================

View file

@ -45,12 +45,9 @@ single-phase initialization.
Multi-Phase Initialization
..........................
Extensions that use :ref:`multi-phase initialization <multi-phase-initialization>`
(functions like :c:func:`PyModuleDef_Init`,
:c:func:`PyModExport_* <PyModExport_modulename>` export hook,
:c:func:`PyModule_FromSlotsAndSpec`) should add a
:c:data:`Py_mod_gil` slot in the module definition.
If your extension supports older versions of CPython,
Extensions that use multi-phase initialization (i.e.,
:c:func:`PyModuleDef_Init`) should add a :c:data:`Py_mod_gil` slot in the
module definition. If your extension supports older versions of CPython,
you should guard the slot with a :c:data:`PY_VERSION_HEX` check.
::
@ -63,12 +60,18 @@ you should guard the slot with a :c:data:`PY_VERSION_HEX` check.
{0, NULL}
};
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
.m_slots = module_slots,
...
};
Single-Phase Initialization
...........................
Extensions that use legacy :ref:`single-phase initialization <single-phase-initialization>`
(that is, :c:func:`PyModule_Create`) should call :c:func:`PyUnstable_Module_SetGIL` to
Extensions that use single-phase initialization (i.e.,
:c:func:`PyModule_Create`) should call :c:func:`PyUnstable_Module_SetGIL` to
indicate that they support running with the GIL disabled. The function is
only defined in the free-threaded build, so you should guard the call with
``#ifdef Py_GIL_DISABLED`` to avoid compilation errors in the regular build.
@ -170,9 +173,9 @@ that return :term:`strong references <strong reference>`.
+-----------------------------------+-----------------------------------+
| :c:func:`PyDict_Next` | none (see :ref:`PyDict_Next`) |
+-----------------------------------+-----------------------------------+
| :c:func:`!PyWeakref_GetObject` | :c:func:`PyWeakref_GetRef` |
| :c:func:`PyWeakref_GetObject` | :c:func:`PyWeakref_GetRef` |
+-----------------------------------+-----------------------------------+
| :c:func:`!PyWeakref_GET_OBJECT` | :c:func:`PyWeakref_GetRef` |
| :c:func:`PyWeakref_GET_OBJECT` | :c:func:`PyWeakref_GetRef` |
+-----------------------------------+-----------------------------------+
| :c:func:`PyImport_AddModule` | :c:func:`PyImport_AddModuleRef` |
+-----------------------------------+-----------------------------------+

View file

@ -372,8 +372,8 @@ have the form::
for expr2 in sequence2
if condition2
for expr3 in sequence3
if condition3
...
if condition3
for exprN in sequenceN
if conditionN )

View file

@ -2,35 +2,34 @@
.. _perf_profiling:
========================================================
Python support for the ``perf map`` compatible profilers
========================================================
==============================================
Python support for the Linux ``perf`` profiler
==============================================
:author: Pablo Galindo
`The Linux perf profiler <https://perf.wiki.kernel.org>`_ and
`samply <https://github.com/mstange/samply>`_ are powerful tools that allow you to
profile and obtain information about the performance of your application.
Both tools have vibrant ecosystems that aid with the analysis of the data they produce.
`The Linux perf profiler <https://perf.wiki.kernel.org>`_
is a very powerful tool that allows you to profile and obtain
information about the performance of your application.
``perf`` also has a very vibrant ecosystem of tools
that aid with the analysis of the data that it produces.
The main problem with using these profilers with Python applications is that
they only get information about native symbols, that is, the names of
The main problem with using the ``perf`` profiler with Python applications is that
``perf`` only gets information about native symbols, that is, the names of
functions and procedures written in C. This means that the names and file names
of Python functions in your code will not appear in the profiler output.
of Python functions in your code will not appear in the output of ``perf``.
Since Python 3.12, the interpreter can run in a special mode that allows Python
functions to appear in the output of compatible profilers. When this mode is
functions to appear in the output of the ``perf`` profiler. When this mode is
enabled, the interpreter will interpose a small piece of code compiled on the
fly before the execution of every Python function and it will teach the profiler the
fly before the execution of every Python function and it will teach ``perf`` the
relationship between this piece of code and the associated Python function using
:doc:`perf map files <../c-api/perfmaps>`.
.. note::
Support for profiling is available on Linux and macOS on select architectures.
Perf is available on Linux, while samply can be used on both Linux and macOS.
samply support on macOS is available starting from Python 3.15.
Check the output of the ``configure`` build step or
Support for the ``perf`` profiler is currently only available for Linux on
select architectures. Check the output of the ``configure`` build step or
check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE``
to see if your system is supported.
@ -93,7 +92,7 @@ Then we can use ``perf report`` to analyze the data:
| | | |
| | | |--51.67%--_PyEval_EvalFrameDefault
| | | | |
| | | | |--11.52%--_PyCompactLong_Add
| | | | |--11.52%--_PyLong_Add
| | | | | |
| | | | | |--2.97%--_PyObject_Malloc
...
@ -143,37 +142,12 @@ Instead, if we run the same experiment with ``perf`` support enabled we get:
| | | |
| | | |--51.81%--_PyEval_EvalFrameDefault
| | | | |
| | | | |--13.77%--_PyCompactLong_Add
| | | | |--13.77%--_PyLong_Add
| | | | | |
| | | | | |--3.26%--_PyObject_Malloc
Using the samply profiler
-------------------------
samply is a modern profiler that can be used as an alternative to perf.
It uses the same perf map files that Python generates, making it compatible
with Python's profiling support. samply is particularly useful on macOS
where perf is not available.
To use samply with Python, first install it following the instructions at
https://github.com/mstange/samply, then run::
$ samply record PYTHONPERFSUPPORT=1 python my_script.py
This will open a web interface where you can analyze the profiling data
interactively. The advantage of samply is that it provides a modern
web-based interface for analyzing profiling data and works on both Linux
and macOS.
On macOS, samply support requires Python 3.15 or later. Also on macOS, samply
can't profile signed Python executables due to restrictions by macOS. You can
profile with Python binaries that you've compiled yourself, or which are
unsigned or locally-signed (such as anything installed by Homebrew). In
order to attach to running processes on macOS, run ``samply setup`` once (and
every time samply is updated) to self-sign the samply binary.
How to enable ``perf`` profiling support
----------------------------------------

View file

@ -120,16 +120,13 @@ This module defines the following constants and functions:
Its value may be used to uniquely identify this particular thread system-wide
(until the thread terminates, after which the value may be recycled by the OS).
.. availability:: Windows, FreeBSD, Linux, macOS, OpenBSD, NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD, Solaris.
.. availability:: Windows, FreeBSD, Linux, macOS, OpenBSD, NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD.
.. versionadded:: 3.8
.. versionchanged:: 3.13
Added support for GNU/kFreeBSD.
.. versionchanged:: 3.15
Added support for Solaris.
.. function:: stack_size([size])

View file

@ -74,7 +74,7 @@ ArgumentParser objects
prefix_chars='-', fromfile_prefix_chars=None, \
argument_default=None, conflict_handler='error', \
add_help=True, allow_abbrev=True, exit_on_error=True, \
*, suggest_on_error=True, color=True)
*, suggest_on_error=False, color=True)
Create a new :class:`ArgumentParser` object. All parameters should be passed
as keyword arguments. Each parameter has its own more detailed description
@ -117,7 +117,7 @@ ArgumentParser objects
error info when an error occurs. (default: ``True``)
* suggest_on_error_ - Enables suggestions for mistyped argument choices
and subparser names (default: ``True``)
and subparser names (default: ``False``)
* color_ - Allow color output (default: ``True``)
@ -134,9 +134,6 @@ ArgumentParser objects
.. versionchanged:: 3.14
*suggest_on_error* and *color* parameters were added.
.. versionchanged:: 3.15
*suggest_on_error* default changed to ``True``.
The following sections describe how each of these are used.
@ -599,11 +596,13 @@ suggest_on_error
^^^^^^^^^^^^^^^^
By default, when a user passes an invalid argument choice or subparser name,
:class:`ArgumentParser` will exit with error info and provide suggestions for
mistyped arguments. The error message will list the permissible argument
choices (if specified) or subparser names, along with a "maybe you meant"
suggestion if a close match is found. Note that this only applies for arguments
when the choices specified are strings::
:class:`ArgumentParser` will exit with error info and list the permissible
argument choices (if specified) or subparser names as part of the error message.
If the user would like to enable suggestions for mistyped argument choices and
subparser names, the feature can be enabled by setting ``suggest_on_error`` to
``True``. Note that this only applies for arguments when the choices specified
are strings::
>>> parser = argparse.ArgumentParser(description='Process some integers.',
suggest_on_error=True)
@ -613,14 +612,16 @@ when the choices specified are strings::
>>> parser.parse_args(['--action', 'sumn', 1, 2, 3])
tester.py: error: argument --action: invalid choice: 'sumn', maybe you meant 'sum'? (choose from 'sum', 'max')
You can disable suggestions by setting ``suggest_on_error`` to ``False``::
If you're writing code that needs to be compatible with older Python versions
and want to opportunistically use ``suggest_on_error`` when it's available, you
can set it as an attribute after initializing the parser instead of using the
keyword argument::
>>> parser = argparse.ArgumentParser(description='Process some integers.',
suggest_on_error=False)
>>> parser = argparse.ArgumentParser(description='Process some integers.')
>>> parser.suggest_on_error = True
.. versionadded:: 3.14
.. versionchanged:: 3.15
Changed default value of ``suggest_on_error`` from ``False`` to ``True``.
color
^^^^^
@ -1322,12 +1323,8 @@ attribute is determined by the ``dest`` keyword argument of
For optional argument actions, the value of ``dest`` is normally inferred from
the option strings. :class:`ArgumentParser` generates the value of ``dest`` by
taking the first double-dash long option string and stripping away the initial
``-`` characters.
If no double-dash long option strings were supplied, ``dest`` will be derived
from the first single-dash long option string by stripping the initial ``-``
character.
If no long option strings were supplied, ``dest`` will be derived from
taking the first long option string and stripping away the initial ``--``
string. If no long option strings were supplied, ``dest`` will be derived from
the first short option string by stripping the initial ``-`` character. Any
internal ``-`` characters will be converted to ``_`` characters to make sure
the string is a valid attribute name. The examples below illustrate this
@ -1335,12 +1332,11 @@ behavior::
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('-f', '--foo-bar', '--foo')
>>> parser.add_argument('-q', '-quz')
>>> parser.add_argument('-x', '-y')
>>> parser.parse_args('-f 1 -q 2 -x 3'.split())
Namespace(foo_bar='1', quz='2', x='3')
>>> parser.parse_args('--foo 1 -quz 2 -y 3'.split())
Namespace(foo_bar='1', quz='2', x='2')
>>> parser.parse_args('-f 1 -x 2'.split())
Namespace(foo_bar='1', x='2')
>>> parser.parse_args('--foo 1 -y 2'.split())
Namespace(foo_bar='1', x='2')
``dest`` allows a custom attribute name to be provided::
@ -1349,9 +1345,6 @@ behavior::
>>> parser.parse_args('--foo XXX'.split())
Namespace(bar='XXX')
.. versionchanged:: next
Single-dash long option now takes precedence over short options.
.. _deprecated:
@ -1445,18 +1438,8 @@ this API may be passed as the ``action`` parameter to
>>> parser.parse_args(['--no-foo'])
Namespace(foo=False)
Single-dash long options are also supported.
For example, negative option ``-nofoo`` is automatically added for
positive option ``-foo``.
But no additional options are added for short options such as ``-f``.
.. versionadded:: 3.9
.. versionchanged:: next
Added support for single-dash options.
Added support for alternate prefix_chars_.
The parse_args() method
-----------------------

View file

@ -252,11 +252,12 @@ Root nodes
>>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), indent=4))
FunctionType(
argtypes=[
Name(id='int'),
Name(id='str')],
Name(id='int', ctx=Load()),
Name(id='str', ctx=Load())],
returns=Subscript(
value=Name(id='List'),
slice=Name(id='int')))
value=Name(id='List', ctx=Load()),
slice=Name(id='int', ctx=Load()),
ctx=Load()))
.. versionadded:: 3.8
@ -311,14 +312,14 @@ Literals
values=[
Constant(value='sin('),
FormattedValue(
value=Name(id='a'),
value=Name(id='a', ctx=Load()),
conversion=-1),
Constant(value=') is '),
FormattedValue(
value=Call(
func=Name(id='sin'),
func=Name(id='sin', ctx=Load()),
args=[
Name(id='a')]),
Name(id='a', ctx=Load())]),
conversion=-1,
format_spec=JoinedStr(
values=[
@ -341,12 +342,12 @@ Literals
body=TemplateStr(
values=[
Interpolation(
value=Name(id='name'),
value=Name(id='name', ctx=Load()),
str='name',
conversion=-1),
Constant(value=' finished '),
Interpolation(
value=Name(id='place'),
value=Name(id='place', ctx=Load()),
str='place',
conversion=-1,
format_spec=JoinedStr(
@ -397,14 +398,16 @@ Literals
elts=[
Constant(value=1),
Constant(value=2),
Constant(value=3)]))
Constant(value=3)],
ctx=Load()))
>>> print(ast.dump(ast.parse('(1, 2, 3)', mode='eval'), indent=4))
Expression(
body=Tuple(
elts=[
Constant(value=1),
Constant(value=2),
Constant(value=3)]))
Constant(value=3)],
ctx=Load()))
.. class:: Set(elts)
@ -442,7 +445,7 @@ Literals
None],
values=[
Constant(value=1),
Name(id='d')]))
Name(id='d', ctx=Load())]))
Variables
@ -468,7 +471,7 @@ Variables
Module(
body=[
Expr(
value=Name(id='a'))])
value=Name(id='a', ctx=Load()))])
>>> print(ast.dump(ast.parse('a = 1'), indent=4))
Module(
@ -506,7 +509,7 @@ Variables
value=Name(id='b', ctx=Store()),
ctx=Store())],
ctx=Store())],
value=Name(id='it'))])
value=Name(id='it', ctx=Load()))])
.. _ast-expressions:
@ -529,7 +532,7 @@ Expressions
Expr(
value=UnaryOp(
op=USub(),
operand=Name(id='a')))])
operand=Name(id='a', ctx=Load())))])
.. class:: UnaryOp(op, operand)
@ -552,7 +555,7 @@ Expressions
Expression(
body=UnaryOp(
op=Not(),
operand=Name(id='x')))
operand=Name(id='x', ctx=Load())))
.. class:: BinOp(left, op, right)
@ -565,9 +568,9 @@ Expressions
>>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))
Expression(
body=BinOp(
left=Name(id='x'),
left=Name(id='x', ctx=Load()),
op=Add(),
right=Name(id='y')))
right=Name(id='y', ctx=Load())))
.. class:: Add
@ -603,8 +606,8 @@ Expressions
body=BoolOp(
op=Or(),
values=[
Name(id='x'),
Name(id='y')]))
Name(id='x', ctx=Load()),
Name(id='y', ctx=Load())]))
.. class:: And
@ -629,7 +632,7 @@ Expressions
LtE(),
Lt()],
comparators=[
Name(id='a'),
Name(id='a', ctx=Load()),
Constant(value=10)]))
@ -663,17 +666,18 @@ Expressions
>>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), indent=4))
Expression(
body=Call(
func=Name(id='func'),
func=Name(id='func', ctx=Load()),
args=[
Name(id='a'),
Name(id='a', ctx=Load()),
Starred(
value=Name(id='d'))],
value=Name(id='d', ctx=Load()),
ctx=Load())],
keywords=[
keyword(
arg='b',
value=Name(id='c')),
value=Name(id='c', ctx=Load())),
keyword(
value=Name(id='e'))]))
value=Name(id='e', ctx=Load()))]))
.. class:: keyword(arg, value)
@ -692,9 +696,9 @@ Expressions
>>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))
Expression(
body=IfExp(
test=Name(id='b'),
body=Name(id='a'),
orelse=Name(id='c')))
test=Name(id='b', ctx=Load()),
body=Name(id='a', ctx=Load()),
orelse=Name(id='c', ctx=Load())))
.. class:: Attribute(value, attr, ctx)
@ -709,8 +713,9 @@ Expressions
>>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))
Expression(
body=Attribute(
value=Name(id='snake'),
attr='colour'))
value=Name(id='snake', ctx=Load()),
attr='colour',
ctx=Load()))
.. class:: NamedExpr(target, value)
@ -746,13 +751,15 @@ Subscripting
>>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))
Expression(
body=Subscript(
value=Name(id='l'),
value=Name(id='l', ctx=Load()),
slice=Tuple(
elts=[
Slice(
lower=Constant(value=1),
upper=Constant(value=2)),
Constant(value=3)])))
Constant(value=3)],
ctx=Load()),
ctx=Load()))
.. class:: Slice(lower, upper, step)
@ -766,10 +773,11 @@ Subscripting
>>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))
Expression(
body=Subscript(
value=Name(id='l'),
value=Name(id='l', ctx=Load()),
slice=Slice(
lower=Constant(value=1),
upper=Constant(value=2))))
upper=Constant(value=2)),
ctx=Load()))
Comprehensions
@ -794,11 +802,11 @@ Comprehensions
... ))
Expression(
body=ListComp(
elt=Name(id='x'),
elt=Name(id='x', ctx=Load()),
generators=[
comprehension(
target=Name(id='x', ctx=Store()),
iter=Name(id='numbers'),
iter=Name(id='numbers', ctx=Load()),
is_async=0)]))
>>> print(ast.dump(
... ast.parse('{x: x**2 for x in numbers}', mode='eval'),
@ -806,15 +814,15 @@ Comprehensions
... ))
Expression(
body=DictComp(
key=Name(id='x'),
key=Name(id='x', ctx=Load()),
value=BinOp(
left=Name(id='x'),
left=Name(id='x', ctx=Load()),
op=Pow(),
right=Constant(value=2)),
generators=[
comprehension(
target=Name(id='x', ctx=Store()),
iter=Name(id='numbers'),
iter=Name(id='numbers', ctx=Load()),
is_async=0)]))
>>> print(ast.dump(
... ast.parse('{x for x in numbers}', mode='eval'),
@ -822,11 +830,11 @@ Comprehensions
... ))
Expression(
body=SetComp(
elt=Name(id='x'),
elt=Name(id='x', ctx=Load()),
generators=[
comprehension(
target=Name(id='x', ctx=Store()),
iter=Name(id='numbers'),
iter=Name(id='numbers', ctx=Load()),
is_async=0)]))
@ -847,17 +855,17 @@ Comprehensions
Expression(
body=ListComp(
elt=Call(
func=Name(id='ord'),
func=Name(id='ord', ctx=Load()),
args=[
Name(id='c')]),
Name(id='c', ctx=Load())]),
generators=[
comprehension(
target=Name(id='line', ctx=Store()),
iter=Name(id='file'),
iter=Name(id='file', ctx=Load()),
is_async=0),
comprehension(
target=Name(id='c', ctx=Store()),
iter=Name(id='line'),
iter=Name(id='line', ctx=Load()),
is_async=0)]))
>>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', mode='eval'),
@ -865,22 +873,22 @@ Comprehensions
Expression(
body=GeneratorExp(
elt=BinOp(
left=Name(id='n'),
left=Name(id='n', ctx=Load()),
op=Pow(),
right=Constant(value=2)),
generators=[
comprehension(
target=Name(id='n', ctx=Store()),
iter=Name(id='it'),
iter=Name(id='it', ctx=Load()),
ifs=[
Compare(
left=Name(id='n'),
left=Name(id='n', ctx=Load()),
ops=[
Gt()],
comparators=[
Constant(value=5)]),
Compare(
left=Name(id='n'),
left=Name(id='n', ctx=Load()),
ops=[
Lt()],
comparators=[
@ -891,11 +899,11 @@ Comprehensions
... indent=4)) # Async comprehension
Expression(
body=ListComp(
elt=Name(id='i'),
elt=Name(id='i', ctx=Load()),
generators=[
comprehension(
target=Name(id='i', ctx=Store()),
iter=Name(id='soc'),
iter=Name(id='soc', ctx=Load()),
is_async=1)]))
@ -937,7 +945,7 @@ Statements
Name(id='a', ctx=Store()),
Name(id='b', ctx=Store())],
ctx=Store())],
value=Name(id='c'))])
value=Name(id='c', ctx=Load()))])
.. class:: AnnAssign(target, annotation, value, simple)
@ -960,7 +968,7 @@ Statements
body=[
AnnAssign(
target=Name(id='c', ctx=Store()),
annotation=Name(id='int'),
annotation=Name(id='int', ctx=Load()),
simple=1)])
>>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with parenthesis
@ -968,7 +976,7 @@ Statements
body=[
AnnAssign(
target=Name(id='a', ctx=Store()),
annotation=Name(id='int'),
annotation=Name(id='int', ctx=Load()),
value=Constant(value=1),
simple=0)])
@ -977,10 +985,10 @@ Statements
body=[
AnnAssign(
target=Attribute(
value=Name(id='a'),
value=Name(id='a', ctx=Load()),
attr='b',
ctx=Store()),
annotation=Name(id='int'),
annotation=Name(id='int', ctx=Load()),
simple=0)])
>>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript annotation
@ -988,10 +996,10 @@ Statements
body=[
AnnAssign(
target=Subscript(
value=Name(id='a'),
value=Name(id='a', ctx=Load()),
slice=Constant(value=1),
ctx=Store()),
annotation=Name(id='int'),
annotation=Name(id='int', ctx=Load()),
simple=0)])
@ -1028,8 +1036,8 @@ Statements
Module(
body=[
Raise(
exc=Name(id='x'),
cause=Name(id='y'))])
exc=Name(id='x', ctx=Load()),
cause=Name(id='y', ctx=Load()))])
.. class:: Assert(test, msg)
@ -1043,8 +1051,8 @@ Statements
Module(
body=[
Assert(
test=Name(id='x'),
msg=Name(id='y'))])
test=Name(id='x', ctx=Load()),
msg=Name(id='y', ctx=Load()))])
.. class:: Delete(targets)
@ -1090,7 +1098,7 @@ Statements
body=[
TypeAlias(
name=Name(id='Alias', ctx=Store()),
value=Name(id='int'))])
value=Name(id='int', ctx=Load()))])
.. versionadded:: 3.12
@ -1183,13 +1191,13 @@ Control flow
Module(
body=[
If(
test=Name(id='x'),
test=Name(id='x', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
If(
test=Name(id='y'),
test=Name(id='y', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis))],
@ -1223,7 +1231,7 @@ Control flow
body=[
For(
target=Name(id='x', ctx=Store()),
iter=Name(id='y'),
iter=Name(id='y', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis))],
@ -1248,7 +1256,7 @@ Control flow
Module(
body=[
While(
test=Name(id='x'),
test=Name(id='x', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis))],
@ -1276,11 +1284,11 @@ Control flow
body=[
For(
target=Name(id='a', ctx=Store()),
iter=Name(id='b'),
iter=Name(id='b', ctx=Load()),
body=[
If(
test=Compare(
left=Name(id='a'),
left=Name(id='a', ctx=Load()),
ops=[
Gt()],
comparators=[
@ -1318,12 +1326,12 @@ Control flow
value=Constant(value=Ellipsis))],
handlers=[
ExceptHandler(
type=Name(id='Exception'),
type=Name(id='Exception', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis))]),
ExceptHandler(
type=Name(id='OtherException'),
type=Name(id='OtherException', ctx=Load()),
name='e',
body=[
Expr(
@ -1358,7 +1366,7 @@ Control flow
value=Constant(value=Ellipsis))],
handlers=[
ExceptHandler(
type=Name(id='Exception'),
type=Name(id='Exception', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis))])])])
@ -1386,12 +1394,12 @@ Control flow
body=[
Expr(
value=BinOp(
left=Name(id='a'),
left=Name(id='a', ctx=Load()),
op=Add(),
right=Constant(value=1)))],
handlers=[
ExceptHandler(
type=Name(id='TypeError'),
type=Name(id='TypeError', ctx=Load()),
body=[
Pass()])])])
@ -1424,18 +1432,18 @@ Control flow
With(
items=[
withitem(
context_expr=Name(id='a'),
context_expr=Name(id='a', ctx=Load()),
optional_vars=Name(id='b', ctx=Store())),
withitem(
context_expr=Name(id='c'),
context_expr=Name(id='c', ctx=Load()),
optional_vars=Name(id='d', ctx=Store()))],
body=[
Expr(
value=Call(
func=Name(id='something'),
func=Name(id='something', ctx=Load()),
args=[
Name(id='b'),
Name(id='d')]))])])
Name(id='b', ctx=Load()),
Name(id='d', ctx=Load())]))])])
Pattern matching
@ -1475,14 +1483,14 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchSequence(
patterns=[
MatchAs(name='x')]),
guard=Compare(
left=Name(id='x'),
left=Name(id='x', ctx=Load()),
ops=[
Gt()],
comparators=[
@ -1492,7 +1500,7 @@ Pattern matching
value=Constant(value=Ellipsis))]),
match_case(
pattern=MatchClass(
cls=Name(id='tuple')),
cls=Name(id='tuple', ctx=Load())),
body=[
Expr(
value=Constant(value=Ellipsis))])])])
@ -1516,7 +1524,7 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchValue(
@ -1543,7 +1551,7 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchSingleton(value=None),
@ -1570,7 +1578,7 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchSequence(
@ -1603,7 +1611,7 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchSequence(
@ -1652,7 +1660,7 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchMapping(
@ -1702,11 +1710,11 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchClass(
cls=Name(id='Point2D'),
cls=Name(id='Point2D', ctx=Load()),
patterns=[
MatchValue(
value=Constant(value=0)),
@ -1717,7 +1725,7 @@ Pattern matching
value=Constant(value=Ellipsis))]),
match_case(
pattern=MatchClass(
cls=Name(id='Point3D'),
cls=Name(id='Point3D', ctx=Load()),
kwd_attrs=[
'x',
'y',
@ -1758,7 +1766,7 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchAs(
@ -1795,7 +1803,7 @@ Pattern matching
Module(
body=[
Match(
subject=Name(id='x'),
subject=Name(id='x', ctx=Load()),
cases=[
match_case(
pattern=MatchOr(
@ -1835,7 +1843,7 @@ Type annotations
body=[
AnnAssign(
target=Name(id='x', ctx=Store()),
annotation=Name(id='bool'),
annotation=Name(id='bool', ctx=Load()),
value=Constant(value=1),
simple=1)],
type_ignores=[
@ -1873,11 +1881,12 @@ aliases.
type_params=[
TypeVar(
name='T',
bound=Name(id='int'),
default_value=Name(id='bool'))],
bound=Name(id='int', ctx=Load()),
default_value=Name(id='bool', ctx=Load()))],
value=Subscript(
value=Name(id='list'),
slice=Name(id='T')))])
value=Name(id='list', ctx=Load()),
slice=Name(id='T', ctx=Load()),
ctx=Load()))])
.. versionadded:: 3.12
@ -1902,14 +1911,17 @@ aliases.
name='P',
default_value=List(
elts=[
Name(id='int'),
Name(id='str')]))],
Name(id='int', ctx=Load()),
Name(id='str', ctx=Load())],
ctx=Load()))],
value=Subscript(
value=Name(id='Callable'),
value=Name(id='Callable', ctx=Load()),
slice=Tuple(
elts=[
Name(id='P'),
Name(id='int')])))])
Name(id='P', ctx=Load()),
Name(id='int', ctx=Load())],
ctx=Load()),
ctx=Load()))])
.. versionadded:: 3.12
@ -1930,13 +1942,18 @@ aliases.
TypeAlias(
name=Name(id='Alias', ctx=Store()),
type_params=[
TypeVarTuple(name='Ts', default_value=Tuple())],
TypeVarTuple(
name='Ts',
default_value=Tuple(ctx=Load()))],
value=Subscript(
value=Name(id='tuple'),
value=Name(id='tuple', ctx=Load()),
slice=Tuple(
elts=[
Starred(
value=Name(id='Ts'))])))])
value=Name(id='Ts', ctx=Load()),
ctx=Load())],
ctx=Load()),
ctx=Load()))])
.. versionadded:: 3.12
@ -2041,8 +2058,8 @@ Function and class definitions
body=[
Pass()],
decorator_list=[
Name(id='decorator1'),
Name(id='decorator2')],
Name(id='decorator1', ctx=Load()),
Name(id='decorator2', ctx=Load())],
returns=Constant(value='return annotation'))])
@ -2072,14 +2089,14 @@ Function and class definitions
body=[
Expr(
value=Yield(
value=Name(id='x')))])
value=Name(id='x', ctx=Load())))])
>>> print(ast.dump(ast.parse('yield from x'), indent=4))
Module(
body=[
Expr(
value=YieldFrom(
value=Name(id='x')))])
value=Name(id='x', ctx=Load())))])
.. class:: Global(names)
@ -2134,17 +2151,17 @@ Function and class definitions
ClassDef(
name='Foo',
bases=[
Name(id='base1'),
Name(id='base2')],
Name(id='base1', ctx=Load()),
Name(id='base2', ctx=Load())],
keywords=[
keyword(
arg='metaclass',
value=Name(id='meta'))],
value=Name(id='meta', ctx=Load()))],
body=[
Pass()],
decorator_list=[
Name(id='decorator1'),
Name(id='decorator2')])])
Name(id='decorator1', ctx=Load()),
Name(id='decorator2', ctx=Load())])])
.. versionchanged:: 3.12
Added ``type_params``.
@ -2181,7 +2198,7 @@ Async and await
Expr(
value=Await(
value=Call(
func=Name(id='other_func'))))])])
func=Name(id='other_func', ctx=Load()))))])])
.. class:: AsyncFor(target, iter, body, orelse, type_comment)
@ -2205,10 +2222,10 @@ Async and await
Apart from the node classes, the :mod:`ast` module defines these utility functions
and classes for traversing abstract syntax trees:
.. function:: parse(source, filename='<unknown>', mode='exec', *, type_comments=False, feature_version=None, optimize=-1, module=None)
.. function:: parse(source, filename='<unknown>', mode='exec', *, type_comments=False, feature_version=None, optimize=-1)
Parse the source into an AST node. Equivalent to ``compile(source,
filename, mode, flags=FLAGS_VALUE, optimize=optimize, module=module)``,
filename, mode, flags=FLAGS_VALUE, optimize=optimize)``,
where ``FLAGS_VALUE`` is ``ast.PyCF_ONLY_AST`` if ``optimize <= 0``
and ``ast.PyCF_OPTIMIZED_AST`` otherwise.
@ -2261,9 +2278,6 @@ and classes for traversing abstract syntax trees:
The minimum supported version for ``feature_version`` is now ``(3, 7)``.
The ``optimize`` argument was added.
.. versionadded:: 3.15
Added the *module* parameter.
.. function:: unparse(ast_obj)
@ -2445,7 +2459,7 @@ and classes for traversing abstract syntax trees:
def visit_Name(self, node):
return Subscript(
value=Name(id='data'),
value=Name(id='data', ctx=Load()),
slice=Constant(value=node.id),
ctx=node.ctx
)
@ -2488,35 +2502,42 @@ and classes for traversing abstract syntax trees:
indents that many spaces per level. If *indent* is a string (such as ``"\t"``),
that string is used to indent each level.
If *show_empty* is false (the default), optional empty lists and
``Load()`` values will be omitted from the output.
If *show_empty* is false (the default), optional empty lists will be
omitted from the output.
Optional ``None`` values are always omitted.
.. doctest::
>>> tree = ast.parse('print(None)', '?', 'eval')
>>> print(ast.dump(tree, indent=4))
Expression(
body=Call(
func=Name(id='print'),
args=[
Constant(value=None)]))
>>> print(ast.dump(tree, indent=4, show_empty=True))
Expression(
body=Call(
func=Name(id='print', ctx=Load()),
args=[
Constant(value=None)],
keywords=[]))
.. versionchanged:: 3.9
Added the *indent* option.
.. versionchanged:: 3.13
Added the *show_empty* option.
.. versionchanged:: 3.15
Omit optional ``Load()`` values by default.
.. doctest::
>>> print(ast.dump(ast.parse("""\
... async def f():
... await other_func()
... """), indent=4, show_empty=True))
Module(
body=[
AsyncFunctionDef(
name='f',
args=arguments(
posonlyargs=[],
args=[],
kwonlyargs=[],
kw_defaults=[],
defaults=[]),
body=[
Expr(
value=Await(
value=Call(
func=Name(id='other_func', ctx=Load()),
args=[],
keywords=[])))],
decorator_list=[],
type_params=[])],
type_ignores=[])
.. _ast-compiler-flags:

View file

@ -1221,8 +1221,8 @@ Task Object
To cancel a running Task use the :meth:`cancel` method. Calling it
will cause the Task to throw a :exc:`CancelledError` exception into
the wrapped coroutine. If a coroutine is awaiting on a future-like
object during cancellation, the awaited object will be cancelled.
the wrapped coroutine. If a coroutine is awaiting on a Future
object during cancellation, the Future object will be cancelled.
:meth:`cancelled` can be used to check if the Task was cancelled.
The method returns ``True`` if the wrapped coroutine did not
@ -1411,10 +1411,6 @@ Task Object
the cancellation, it needs to call :meth:`Task.uncancel` in addition
to catching the exception.
If the Task being cancelled is currently awaiting on a future-like
object, that awaited object will also be cancelled. This cancellation
propagates down the entire chain of awaited objects.
.. versionchanged:: 3.9
Added the *msg* parameter.

View file

@ -192,8 +192,12 @@ The :mod:`bdb` module also defines two classes:
entered.
* ``"return"``: A function or other code block is about to return.
* ``"exception"``: An exception has occurred.
* ``"c_call"``: A C function is about to be called.
* ``"c_return"``: A C function has returned.
* ``"c_exception"``: A C function has raised an exception.
For all the events, specialized functions (see below) are called.
For the Python events, specialized functions (see below) are called. For
the C events, no action is taken.
The *arg* parameter depends on the previous event.
@ -236,7 +240,7 @@ The :mod:`bdb` module also defines two classes:
Normally derived classes don't override the following methods, but they may
if they want to redefine the definition of stopping and breakpoints.
.. method:: is_skipped_module(module_name)
.. method:: is_skipped_line(module_name)
Return ``True`` if *module_name* matches any skip pattern.

View file

@ -251,7 +251,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
3) specifies the number of months per row. *css* is the name for the
cascading style sheet to be used. :const:`None` can be passed if no style
sheet should be used. *encoding* specifies the encoding to be used for the
output (defaulting to ``'utf-8'``).
output (defaulting to the system default encoding).
.. method:: formatmonthname(theyear, themonth, withyear=True)
@ -501,14 +501,6 @@ The :mod:`calendar` module exports the following data attributes:
>>> list(calendar.month_name)
['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
.. caution::
In locales with alternative month names forms, the :data:`!month_name` sequence
may not be suitable when a month name stands by itself and not as part of a date.
For instance, in Greek and in many Slavic and Baltic languages, :data:`!month_name`
will produce the month in genitive case. Use :data:`standalone_month_name` for a form
suitable for standalone use.
.. data:: month_abbr
@ -520,31 +512,6 @@ The :mod:`calendar` module exports the following data attributes:
>>> list(calendar.month_abbr)
['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
.. caution::
In locales with alternative month names forms, the :data:`!month_abbr` sequence
may not be suitable when a month name stands by itself and not as part of a date.
Use :data:`standalone_month_abbr` for a form suitable for standalone use.
.. data:: standalone_month_name
A sequence that represents the months of the year in the current locale
in the standalone form if the locale provides one. Else it is equivalent
to :data:`month_name`.
.. versionadded:: 3.15
.. data:: standalone_month_abbr
A sequence that represents the abbreviated months of the year in the current
locale in the standalone form if the locale provides one. Else it is
equivalent to :data:`month_abbr`.
.. versionadded:: 3.15
.. data:: JANUARY
FEBRUARY
MARCH
@ -710,7 +677,8 @@ The following options are accepted:
.. option:: month
The month of the specified :option:`year` to print the calendar for.
Must be a number between 1 and 12.
Must be a number between 1 and 12,
and may only be used in text mode.
Defaults to printing a calendar for the full year.

View file

@ -29,7 +29,7 @@ build applications which provide an interactive interpreter prompt.
module.
.. class:: InteractiveConsole(locals=None, filename="<console>", *, local_exit=False)
.. class:: InteractiveConsole(locals=None, filename="<console>", local_exit=False)
Closely emulate the behavior of the interactive Python interpreter. This class
builds on :class:`InteractiveInterpreter` and adds prompting using the familiar

View file

@ -68,21 +68,11 @@ The full details for each codec can also be looked up directly:
Looks up the codec info in the Python codec registry and returns a
:class:`CodecInfo` object as defined below.
This function first normalizes the *encoding*: all ASCII letters are
converted to lower case, spaces are replaced with hyphens.
Then encoding is looked up in the registry's cache. If not found, the list of
Encodings are first looked up in the registry's cache. If not found, the list of
registered search functions is scanned. If no :class:`CodecInfo` object is
found, a :exc:`LookupError` is raised. Otherwise, the :class:`CodecInfo` object
is stored in the cache and returned to the caller.
.. versionchanged:: 3.9
Any characters except ASCII letters and digits and a dot are converted to underscore.
.. versionchanged:: 3.15
No characters are converted to underscore anymore.
Spaces are converted to hyphens.
.. class:: CodecInfo(encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None)
Codec details when looking up the codec registry. The constructor
@ -177,11 +167,14 @@ function:
.. function:: register(search_function, /)
Register a codec search function. Search functions are expected to take one
argument, being the encoding name in all lower case letters with spaces
converted to hyphens, and return a :class:`CodecInfo` object.
argument, being the encoding name in all lower case letters with hyphens
and spaces converted to underscores, and return a :class:`CodecInfo` object.
In case a search function cannot find a given encoding, it should return
``None``.
.. versionchanged:: 3.9
Hyphens and spaces are converted to underscore.
.. function:: unregister(search_function, /)
@ -1077,7 +1070,7 @@ or with dictionaries as mapping tables. The following table lists the codecs by
name, together with a few common aliases, and the languages for which the
encoding is likely used. Neither the list of aliases nor the list of languages
is meant to be exhaustive. Notice that spelling alternatives that only differ in
case or use a space or a hyphen instead of an underscore are also valid aliases
case or use a hyphen instead of an underscore are also valid aliases
because they are equivalent when normalized by
:func:`~encodings.normalize_encoding`. For example, ``'utf-8'`` is a valid
alias for the ``'utf_8'`` codec.
@ -1088,7 +1081,7 @@ alias for the ``'utf_8'`` codec.
refer to the source :source:`aliases.py <Lib/encodings/aliases.py>` file.
On Windows, ``cpXXX`` codecs are available for all code pages.
But only codecs listed in the following table are guaranteed to exist on
But only codecs listed in the following table are guarantead to exist on
other platforms.
.. impl-detail::
@ -1344,7 +1337,7 @@ particular, the following variants typically exist:
+-----------------+--------------------------------+--------------------------------+
| utf_8 | U8, UTF, utf8, cp65001 | all languages |
+-----------------+--------------------------------+--------------------------------+
| utf_8_sig | utf8-sig | all languages |
| utf_8_sig | | all languages |
+-----------------+--------------------------------+--------------------------------+
.. versionchanged:: 3.4

View file

@ -367,11 +367,9 @@ Several mathematical operations are provided for combining :class:`Counter`
objects to produce multisets (counters that have counts greater than zero).
Addition and subtraction combine counters by adding or subtracting the counts
of corresponding elements. Intersection and union return the minimum and
maximum of corresponding counts. Symmetric difference returns the difference
between the maximum and minimum of the corresponding counts. Equality and
inclusion compare corresponding counts. Each operation can accept inputs
with signed counts, but the output will exclude results with counts of zero
or below.
maximum of corresponding counts. Equality and inclusion compare
corresponding counts. Each operation can accept inputs with signed
counts, but the output will exclude results with counts of zero or less.
.. doctest::
@ -385,8 +383,6 @@ or below.
Counter({'a': 1, 'b': 1})
>>> c | d # union: max(c[x], d[x])
Counter({'a': 3, 'b': 2})
>>> c ^ d # max(c[x], d[x]) - min(c[x], d[x])
Counter({'a': 2, 'b': 1})
>>> c == d # equality: c[x] == d[x]
False
>>> c <= d # inclusion: c[x] <= d[x]
@ -404,9 +400,6 @@ or subtracting from an empty counter.
.. versionadded:: 3.3
Added support for unary plus, unary minus, and in-place multiset operations.
.. versionadded:: 3.15
Added support for the symmetric difference multiset operation, ``c ^ d``.
.. note::
Counters were primarily designed to work with positive integers to represent
@ -1209,7 +1202,7 @@ If a new entry overwrites an existing entry, the
original insertion position is changed and moved to the end::
class LastUpdatedOrderedDict(OrderedDict):
'Store items in the order that the keys were last updated.'
'Store items in the order the keys were last added'
def __setitem__(self, key, value):
super().__setitem__(key, value)

View file

@ -327,10 +327,10 @@ Functions and classes provided:
.. function:: redirect_stdout(new_target)
Context manager for temporarily redirecting :data:`sys.stdout` to
another :term:`file object`.
another file or file-like object.
This tool adds flexibility to existing functions or classes whose output
is hardwired to :data:`sys.stdout`.
is hardwired to stdout.
For example, the output of :func:`help` normally is sent to *sys.stdout*.
You can capture that output in a string by redirecting the output to an
@ -366,8 +366,8 @@ Functions and classes provided:
.. function:: redirect_stderr(new_target)
Similar to :func:`~contextlib.redirect_stdout` but redirecting the global
:data:`sys.stderr` to another :term:`file object`.
Similar to :func:`~contextlib.redirect_stdout` but redirecting
:data:`sys.stderr` to another file or file-like object.
This context manager is :ref:`reentrant <reentrant-cms>`.

View file

@ -313,7 +313,7 @@ client::
addr = writer.transport.get_extra_info('socket').getpeername()
client_addr_var.set(addr)
# In any code that we call, it is now possible to get the
# In any code that we call is now possible to get
# client's address by calling 'client_addr_var.get()'.
while True:

View file

@ -535,9 +535,6 @@ Other constructors, all class methods:
:c:func:`localtime` function. Raise :exc:`OSError` instead of
:exc:`ValueError` on :c:func:`localtime` failure.
.. versionchanged:: 3.15
Accepts any real number as *timestamp*, not only integer or float.
.. classmethod:: date.fromordinal(ordinal)
@ -1023,10 +1020,6 @@ Other constructors, all class methods:
.. versionchanged:: 3.6
:meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1.
.. versionchanged:: 3.15
Accepts any real number as *timestamp*, not only integer or float.
.. classmethod:: datetime.utcfromtimestamp(timestamp)
Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, with
@ -1067,9 +1060,6 @@ Other constructors, all class methods:
Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead.
.. versionchanged:: 3.15
Accepts any real number as *timestamp*, not only integer or float.
.. classmethod:: datetime.fromordinal(ordinal)
@ -1512,11 +1502,11 @@ Instance methods:
returned by :func:`time.time`.
Naive :class:`.datetime` instances are assumed to represent local
time and this method relies on platform C functions to perform
the conversion. Since :class:`.datetime` supports a wider range of
values than the platform C functions on many platforms, this
method may raise :exc:`OverflowError` or :exc:`OSError` for times
far in the past or far in the future.
time and this method relies on the platform C :c:func:`mktime`
function to perform the conversion. Since :class:`.datetime`
supports wider range of values than :c:func:`mktime` on many
platforms, this method may raise :exc:`OverflowError` or :exc:`OSError`
for times far in the past or far in the future.
For aware :class:`.datetime` instances, the return value is computed
as::
@ -1529,10 +1519,6 @@ Instance methods:
The :meth:`timestamp` method uses the :attr:`.fold` attribute to
disambiguate the times during a repeated interval.
.. versionchanged:: 3.6
This method no longer relies on the platform C :c:func:`mktime`
function to perform conversions.
.. note::
There is no method to obtain the POSIX timestamp directly from a
@ -2393,7 +2379,7 @@ locations where different offsets are used in different days of the year or
where historical changes have been made to civil time.
.. class:: timezone(offset[, name])
.. class:: timezone(offset, name=None)
The *offset* argument must be specified as a :class:`timedelta`
object representing the difference between the local time and UTC. It must
@ -2639,10 +2625,7 @@ differences between platforms in handling of unsupported format specifiers.
``%G``, ``%u`` and ``%V`` were added.
.. versionadded:: 3.12
``%:z`` was added for :meth:`~.datetime.strftime`
.. versionadded:: 3.15
``%:z`` was added for :meth:`~.datetime.strptime`
``%:z`` was added.
Technical Detail
^^^^^^^^^^^^^^^^
@ -2737,18 +2720,12 @@ Notes:
When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method,
the UTC offsets can have a colon as a separator between hours, minutes
and seconds.
For example, both ``'+010000'`` and ``'+01:00:00'`` will be parsed as an offset
of one hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``.
For example, ``'+01:00:00'`` will be parsed as an offset of one hour.
In addition, providing ``'Z'`` is identical to ``'+00:00'``.
``%:z``
When used with :meth:`~.datetime.strftime`, behaves exactly as ``%z``,
except that a colon separator is added between hours, minutes and seconds.
When used with :meth:`~.datetime.strptime`, the UTC offset is *required*
to have a colon as a separator between hours, minutes and seconds.
For example, ``'+01:00:00'`` (but *not* ``'+010000'``) will be parsed as
an offset of one hour. In addition, providing ``'Z'`` is identical to
``'+00:00'``.
Behaves exactly as ``%z``, but has a colon separator added between
hours, minutes and seconds.
``%Z``
In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if

View file

@ -15,16 +15,10 @@
* :mod:`dbm.ndbm`
If none of these modules are installed, the
slow-but-simple implementation in module :mod:`dbm.dumb` will be used. There
slow-but-simple implementation in module :mod:`dbm.dumb` will be used. There
is a `third party interface <https://www.jcea.es/programacion/pybsddb.htm>`_ to
the Oracle Berkeley DB.
.. note::
None of the underlying modules will automatically shrink the disk space used by
the database file. However, :mod:`dbm.sqlite3`, :mod:`dbm.gnu` and :mod:`dbm.dumb`
provide a :meth:`!reorganize` method that can be used for this purpose.
.. exception:: error
A tuple containing the exceptions that can be raised by each of the supported
@ -201,24 +195,12 @@ or any other SQLite browser, including the SQLite CLI.
the :meth:`!setdefault` method requires two arguments.
It also supports a "closing" context manager via the :keyword:`with` keyword.
The following methods are also provided:
The following method is also provided:
.. method:: sqlite3.close()
Close the SQLite database.
.. method:: sqlite3.reorganize()
If you have carried out a lot of deletions and would like to shrink the space
used on disk, this method will reorganize the database; otherwise, deleted file
space will be kept and reused as new (key, value) pairs are added.
.. note::
While reorganizing, as much as two times the size of the original database is required
in free disk space. However, be aware that this factor changes for each :mod:`dbm` submodule.
.. versionadded:: 3.15
:mod:`dbm.gnu` --- GNU database manager
---------------------------------------
@ -333,10 +315,6 @@ functionality like crash tolerance.
reorganization; otherwise, deleted file space will be kept and reused as new
(key, value) pairs are added.
.. note::
While reorganizing, as much as one time the size of the original database is required
in free disk space. However, be aware that this factor changes for each :mod:`dbm` submodule.
.. method:: gdbm.sync()
When the database has been opened in fast mode, this method forces any
@ -483,11 +461,6 @@ The :mod:`!dbm.dumb` module defines the following:
with a sufficiently large/complex entry due to stack depth limitations in
Python's AST compiler.
.. warning::
:mod:`dbm.dumb` does not support concurrent read/write access. (Multiple
simultaneous read accesses are safe.) When a program has the database open
for writing, no other program should have it open for reading or writing.
.. versionchanged:: 3.5
:func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``.
@ -509,18 +482,6 @@ The :mod:`!dbm.dumb` module defines the following:
Close the database.
.. method:: dumbdbm.reorganize()
If you have carried out a lot of deletions and would like to shrink the space
used on disk, this method will reorganize the database; otherwise, deleted file
space will not be reused.
.. note::
While reorganizing, no additional free disk space is required. However, be aware
that this factor changes for each :mod:`dbm` submodule.
.. versionadded:: 3.15
.. method:: dumbdbm.sync()
Synchronize the on-disk directory and data files. This method is called

View file

@ -1569,16 +1569,7 @@ In addition to the three supplied contexts, new contexts can be created with the
Constants
---------
.. data:: SPEC_VERSION
The highest version of the General Decimal Arithmetic
Specification that this implementation complies with.
See https://speleotrove.com/decimal/decarith.html for the specification.
.. versionadded:: 3.15
The following constants are only relevant for the C module. They
The constants in this section are only relevant for the C module. They
are also included in the pure Python version for compatibility.
+---------------------------------+---------------------+-------------------------------+

View file

@ -278,7 +278,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
emu
.. function:: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n', *, color=False)
.. function:: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n')
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
generating the delta lines) in unified diff format.
@ -297,10 +297,6 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
For inputs that do not have trailing newlines, set the *lineterm* argument to
``""`` so that the output will be uniformly newline free.
Set *color* to ``True`` to enable output in color, similar to
:program:`git diff --color`. Even if enabled, it can be
:ref:`controlled using environment variables <using-on-controlling-color>`.
The unified diff format normally has a header for filenames and modification
times. Any or all of these may be specified using strings for *fromfile*,
*tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
@ -323,10 +319,6 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
See :ref:`difflib-interface` for a more detailed example.
.. versionchanged:: 3.15
Added the *color* parameter.
.. function:: diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'', fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\n')
Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a

View file

@ -1968,6 +1968,11 @@ but are replaced by real opcodes or removed before bytecode is generated.
``SETUP_CLEANUP`` or ``SETUP_WITH``.
.. opcode:: LOAD_CONST_IMMORTAL (consti)
Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects.
.. opcode:: JUMP
JUMP_NO_INTERRUPT

View file

@ -1057,15 +1057,12 @@ from text files and modules with doctests:
Convert doctest tests from one or more text files to a
:class:`unittest.TestSuite`.
The returned :class:`unittest.TestSuite` is to be run by the unittest
framework and runs the interactive examples in each file.
Each file is run as a separate unit test, and each example in a file
is run as a :ref:`subtest <subtests>`.
If any example in a file fails, then the synthesized unit test fails.
The traceback for failure or error contains the name of the file
containing the test and a (sometimes approximate) line number.
If all the examples in a file are skipped, then the synthesized unit
test is also marked as skipped.
The returned :class:`unittest.TestSuite` is to be run by the unittest framework
and runs the interactive examples in each file. If an example in any file
fails, then the synthesized unit test fails, and a :exc:`~unittest.TestCase.failureException`
exception is raised showing the name of the file containing the test and a
(sometimes approximate) line number. If all the examples in a file are
skipped, then the synthesized unit test is also marked as skipped.
Pass one or more paths (as strings) to text files to be examined.
@ -1123,23 +1120,18 @@ from text files and modules with doctests:
The global ``__file__`` is added to the globals provided to doctests loaded
from a text file using :func:`DocFileSuite`.
.. versionchanged:: 3.15
Run each example as a :ref:`subtest <subtests>`.
.. function:: DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, setUp=None, tearDown=None, optionflags=0, checker=None)
Convert doctest tests for a module to a :class:`unittest.TestSuite`.
The returned :class:`unittest.TestSuite` is to be run by the unittest
framework and runs each doctest in the module.
Each docstring is run as a separate unit test, and each example in
a docstring is run as a :ref:`subtest <subtests>`.
If any of the doctests fail, then the synthesized unit test fails.
The traceback for failure or error contains the name of the file
containing the test and a (sometimes approximate) line number.
If all the examples in a docstring are skipped, then the
synthesized unit test is also marked as skipped.
The returned :class:`unittest.TestSuite` is to be run by the unittest framework
and runs each doctest in the module.
Each docstring is run as a separate unit test.
If any of the doctests fail, then the synthesized unit test fails,
and a :exc:`unittest.TestCase.failureException` exception is raised
showing the name of the file containing the test and a (sometimes approximate)
line number. If all the examples in a docstring are skipped, then the
Optional argument *module* provides the module to be tested. It can be a module
object or a (possibly dotted) module name. If not specified, the module calling
@ -1164,9 +1156,6 @@ from text files and modules with doctests:
:func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if *module*
contains no docstrings instead of raising :exc:`ValueError`.
.. versionchanged:: 3.15
Run each example as a :ref:`subtest <subtests>`.
Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` out
of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` is a
subclass of :class:`unittest.TestCase`. :class:`!DocTestCase` isn't documented
@ -1529,7 +1518,7 @@ DocTestRunner objects
with strings that should be displayed. It defaults to ``sys.stdout.write``. If
capturing the output is not sufficient, then the display output can be also
customized by subclassing DocTestRunner, and overriding the methods
:meth:`report_skip`, :meth:`report_start`, :meth:`report_success`,
:meth:`report_start`, :meth:`report_success`,
:meth:`report_unexpected_exception`, and :meth:`report_failure`.
The optional keyword argument *checker* specifies the :class:`OutputChecker`
@ -1554,19 +1543,6 @@ DocTestRunner objects
:class:`DocTestRunner` defines the following methods:
.. method:: report_skip(out, test, example)
Report that the given example was skipped. This method is provided to
allow subclasses of :class:`DocTestRunner` to customize their output; it
should not be called directly.
*example* is the example about to be processed. *test* is the test
containing *example*. *out* is the output function that was passed to
:meth:`DocTestRunner.run`.
.. versionadded:: 3.15
.. method:: report_start(out, test, example)
Report that the test runner is about to process the given example. This method

View file

@ -437,9 +437,7 @@ The following exceptions are the exceptions that are usually raised.
* Creating a new Python thread.
* :meth:`Joining <threading.Thread.join>` a running daemon thread.
* :func:`os.fork`,
* acquiring a lock such as :class:`threading.Lock`, when it is known that
the operation would otherwise deadlock.
* :func:`os.fork`.
See also the :func:`sys.is_finalizing` function.
@ -450,11 +448,6 @@ The following exceptions are the exceptions that are usually raised.
:meth:`threading.Thread.join` can now raise this exception.
.. versionchanged:: 3.15
This exception may be raised when acquiring :meth:`threading.Lock`
or :meth:`threading.RLock`.
.. exception:: RecursionError
This exception is derived from :exc:`RuntimeError`. It is raised when the
@ -978,12 +971,6 @@ their subgroups based on the types of the contained exceptions.
raises a :exc:`TypeError` if any contained exception is not an
:exc:`Exception` subclass.
.. impl-detail::
The ``excs`` parameter may be any sequence, but lists and tuples are
specifically processed more efficiently here. For optimal performance,
pass a tuple as ``excs``.
.. attribute:: message
The ``msg`` argument to the constructor. This is a read-only attribute.

View file

@ -237,13 +237,13 @@ handler:
Binary file "/opt/python/python", at +0x32df8a [0x5b27f7d85f8a]
Binary file "/usr/lib/libc.so.6", at +0x3def0 [0x77b73226bef0]
Binary file "/usr/lib/libc.so.6", at +0x17ef9c [0x77b7323acf9c]
Binary file "/opt/python/build/lib.linux-x86_64-3.15/_ctypes.cpython-315d-x86_64-linux-gnu.so", at +0xcdf6 [0x77b7315dddf6]
Binary file "/opt/python/build/lib.linux-x86_64-3.14/_ctypes.cpython-314d-x86_64-linux-gnu.so", at +0xcdf6 [0x77b7315dddf6]
Binary file "/usr/lib/libffi.so.8", at +0x7976 [0x77b73158f976]
Binary file "/usr/lib/libffi.so.8", at +0x413c [0x77b73158c13c]
Binary file "/usr/lib/libffi.so.8", at ffi_call+0x12e [0x77b73158ef0e]
Binary file "/opt/python/build/lib.linux-x86_64-3.15/_ctypes.cpython-315d-x86_64-linux-gnu.so", at +0x15a33 [0x77b7315e6a33]
Binary file "/opt/python/build/lib.linux-x86_64-3.15/_ctypes.cpython-315d-x86_64-linux-gnu.so", at +0x164fa [0x77b7315e74fa]
Binary file "/opt/python/build/lib.linux-x86_64-3.15/_ctypes.cpython-315d-x86_64-linux-gnu.so", at +0xc624 [0x77b7315dd624]
Binary file "/opt/python/build/lib.linux-x86_64-3.14/_ctypes.cpython-314d-x86_64-linux-gnu.so", at +0x15a33 [0x77b7315e6a33]
Binary file "/opt/python/build/lib.linux-x86_64-3.14/_ctypes.cpython-314d-x86_64-linux-gnu.so", at +0x164fa [0x77b7315e74fa]
Binary file "/opt/python/build/lib.linux-x86_64-3.14/_ctypes.cpython-314d-x86_64-linux-gnu.so", at +0xc624 [0x77b7315dd624]
Binary file "/opt/python/python", at _PyObject_MakeTpCall+0xce [0x5b27f7b73883]
Binary file "/opt/python/python", at +0x11bab6 [0x5b27f7b73ab6]
Binary file "/opt/python/python", at PyObject_Vectorcall+0x23 [0x5b27f7b73b04]

View file

@ -107,15 +107,15 @@ The module defines the following functions:
passed to the C :c:func:`fcntl` call. The return value after a successful
call is the contents of the buffer, converted to a :class:`bytes` object.
The length of the returned object will be the same as the length of the
*arg* argument.
*arg* argument. This is limited to 1024 bytes.
If the :c:func:`fcntl` call fails, an :exc:`OSError` is raised.
.. note::
If the type or size of *arg* does not match the type or size
of the operation's argument (for example, if an integer is
If the type or the size of *arg* does not match the type or size
of the argument of the operation (for example, if an integer is
passed when a pointer is expected, or the information returned in
the buffer by the operating system is larger than the size of *arg*),
the buffer by the operating system is larger than 1024 bytes),
this is most likely to result in a segmentation violation or
a more subtle data corruption.
@ -125,9 +125,6 @@ The module defines the following functions:
Add support of arbitrary :term:`bytes-like objects <bytes-like object>`,
not only :class:`bytes`.
.. versionchanged:: 3.15
The size of bytes-like objects is no longer limited to 1024 bytes.
.. function:: ioctl(fd, request, arg=0, mutate_flag=True, /)
@ -164,7 +161,8 @@ The module defines the following functions:
If the type or size of *arg* does not match the type or size
of the operation's argument (for example, if an integer is
passed when a pointer is expected, or the information returned in
the buffer by the operating system is larger than the size of *arg*),
the buffer by the operating system is larger than 1024 bytes,
or the size of the mutable bytes-like object is too small),
this is most likely to result in a segmentation violation or
a more subtle data corruption.
@ -187,10 +185,6 @@ The module defines the following functions:
The GIL is always released during a system call.
System calls failing with EINTR are automatically retried.
.. versionchanged:: 3.15
The size of not mutated bytes-like objects is no longer
limited to 1024 bytes.
.. function:: flock(fd, operation, /)
Perform the lock operation *operation* on file descriptor *fd* (file objects providing

View file

@ -292,9 +292,7 @@ are always available. They are listed here in alphabetical order.
:func:`property`.
.. function:: compile(source, filename, mode, flags=0, \
dont_inherit=False, optimize=-1, \
*, module=None)
.. function:: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
Compile the *source* into a code or AST object. Code objects can be executed
by :func:`exec` or :func:`eval`. *source* can either be a normal string, a
@ -336,10 +334,6 @@ are always available. They are listed here in alphabetical order.
``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false)
or ``2`` (docstrings are removed too).
The optional argument *module* specifies the module name.
It is needed to unambiguous :ref:`filter <warning-filter>` syntax warnings
by module name.
This function raises :exc:`SyntaxError` if the compiled source is invalid,
and :exc:`ValueError` if the source contains null bytes.
@ -377,9 +371,6 @@ are always available. They are listed here in alphabetical order.
``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable
support for top-level ``await``, ``async for``, and ``async with``.
.. versionadded:: 3.15
Added the *module* parameter.
.. class:: complex(number=0, /)
complex(string, /)
@ -1428,10 +1419,38 @@ are always available. They are listed here in alphabetical order.
*errors* is an optional string that specifies how encoding and decoding
errors are to be handled—this cannot be used in binary mode.
A variety of standard error handlers are available,
though any error handling name that has been registered with
A variety of standard error handlers are available
(listed under :ref:`error-handlers`), though any
error handling name that has been registered with
:func:`codecs.register_error` is also valid. The standard names
can be found in :ref:`error-handlers`.
include:
* ``'strict'`` to raise a :exc:`ValueError` exception if there is
an encoding error. The default value of ``None`` has the same
effect.
* ``'ignore'`` ignores errors. Note that ignoring encoding errors
can lead to data loss.
* ``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted
where there is malformed data.
* ``'surrogateescape'`` will represent any incorrect bytes as low
surrogate code units ranging from U+DC80 to U+DCFF.
These surrogate code units will then be turned back into
the same bytes when the ``surrogateescape`` error handler is used
when writing data. This is useful for processing files in an
unknown encoding.
* ``'xmlcharrefreplace'`` is only supported when writing to a file.
Characters not supported by the encoding are replaced with the
appropriate XML character reference :samp:`&#{nnn};`.
* ``'backslashreplace'`` replaces malformed data by Python's backslashed
escape sequences.
* ``'namereplace'`` (also only supported when writing)
replaces unsupported characters with ``\N{...}`` escape sequences.
.. index::
single: universal newlines; open() built-in function

View file

@ -57,10 +57,6 @@ The :mod:`functools` module defines the following functions:
another thread makes an additional call before the initial call has been
completed and cached.
Call-once behavior is not guaranteed because locks are not held during the
function call. Potentially another call with the same arguments could
occur while the first call is still running.
.. versionadded:: 3.9
@ -194,7 +190,7 @@ The :mod:`functools` module defines the following functions:
Note, type specificity applies only to the function's immediate arguments
rather than their contents. The scalar arguments, ``Decimal(42)`` and
``Fraction(42)`` are treated as distinct calls with distinct results.
``Fraction(42)`` are be treated as distinct calls with distinct results.
In contrast, the tuple arguments ``('answer', Decimal(42))`` and
``('answer', Fraction(42))`` are treated as equivalent.
@ -720,9 +716,6 @@ The :mod:`functools` module defines the following functions:
.. versionadded:: 3.8
.. versionchanged:: 3.15
Added support of non-:term:`descriptor` callables.
.. function:: update_wrapper(wrapper, wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)

View file

@ -108,19 +108,10 @@ The :mod:`gc` module provides the following functions:
* ``uncollectable`` is the total number of objects which were found
to be uncollectable (and were therefore moved to the :data:`garbage`
list) inside this generation;
* ``candidates`` is the total number of objects in this generation which were
considered for collection and traversed;
* ``duration`` is the total time in seconds spent in collections for this
generation.
list) inside this generation.
.. versionadded:: 3.4
.. versionchanged:: next
Add ``duration`` and ``candidates``.
.. function:: set_threshold(threshold0, [threshold1, [threshold2]])
@ -149,7 +140,7 @@ The :mod:`gc` module provides the following functions:
*threshold2* is ignored.
See `Garbage collector design <https://devguide.python.org/garbage_collector>`_ for more information.
See `Garbage collector design <https://github.com/python/cpython/blob/3.14/InternalDocs/garbage_collector.md>`_ for more information.
.. versionchanged:: 3.14
*threshold2* is ignored
@ -322,12 +313,6 @@ values but should not rebind them):
"uncollectable": When *phase* is "stop", the number of objects
that could not be collected and were put in :data:`garbage`.
"candidates": When *phase* is "stop", the total number of objects in this
generation which were considered for collection and traversed.
"duration": When *phase* is "stop", the time in seconds spent in the
collection.
Applications can add their own callbacks to this list. The primary
use cases are:
@ -340,9 +325,6 @@ values but should not rebind them):
.. versionadded:: 3.3
.. versionchanged:: next
Add "duration" and "candidates".
The following constants are provided for use with :func:`set_debug`:

View file

@ -28,7 +28,7 @@ Note that additional file formats which can be decompressed by the
The module defines the following items:
.. function:: open(filename, mode='rb', compresslevel=6, encoding=None, errors=None, newline=None)
.. function:: open(filename, mode='rb', compresslevel=9, encoding=None, errors=None, newline=None)
Open a gzip-compressed file in binary or text mode, returning a :term:`file
object`.
@ -61,11 +61,6 @@ The module defines the following items:
.. versionchanged:: 3.6
Accepts a :term:`path-like object`.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9).
It is the default level used by most compression tools and a better
tradeoff between speed and performance.
.. exception:: BadGzipFile
An exception raised for invalid gzip files. It inherits from :exc:`OSError`.
@ -74,7 +69,7 @@ The module defines the following items:
.. versionadded:: 3.8
.. class:: GzipFile(filename=None, mode=None, compresslevel=6, fileobj=None, mtime=None)
.. class:: GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None)
Constructor for the :class:`GzipFile` class, which simulates most of the
methods of a :term:`file object`, with the exception of the :meth:`~io.IOBase.truncate`
@ -188,13 +183,8 @@ The module defines the following items:
Remove the ``filename`` attribute, use the :attr:`~GzipFile.name`
attribute instead.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9).
It is the default level used by most compression tools and a better
tradeoff between speed and performance.
.. function:: compress(data, compresslevel=6, *, mtime=0)
.. function:: compress(data, compresslevel=9, *, mtime=0)
Compress the *data*, returning a :class:`bytes` object containing
the compressed data. *compresslevel* and *mtime* have the same meaning as in
@ -218,10 +208,6 @@ The module defines the following items:
The *mtime* parameter now defaults to 0 for reproducible output.
For the previous behaviour of using the current time,
pass ``None`` to *mtime*.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9).
It is the default level used by most compression tools and a better
tradeoff between speed and performance.
.. function:: decompress(data)

View file

@ -94,13 +94,6 @@ accessible by name via :func:`new`. See :data:`algorithms_available`.
OpenSSL does not provide we fall back to a verified implementation from
the `HACL\* project`_.
.. deprecated-removed:: 3.15 3.19
The undocumented ``string`` keyword parameter in :func:`!_hashlib.new`
and hash-named constructors such as :func:`!_md5.md5` is deprecated.
Prefer passing the initial data as a positional argument for maximum
backwards compatibility.
Usage
-----

View file

@ -1,211 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="89.9 70 450.78 193.82">
<defs>
<g>
<g id="glyph-0-0">
<path d="M 4.578125 -3.1875 C 4.578125 -3.984375 4.53125 -4.78125 4.1875 -5.515625 C 3.734375 -6.484375 2.90625 -6.640625 2.5 -6.640625 C 1.890625 -6.640625 1.171875 -6.375 0.75 -5.453125 C 0.4375 -4.765625 0.390625 -3.984375 0.390625 -3.1875 C 0.390625 -2.4375 0.421875 -1.546875 0.84375 -0.78125 C 1.265625 0.015625 2 0.21875 2.484375 0.21875 C 3.015625 0.21875 3.78125 0.015625 4.21875 -0.9375 C 4.53125 -1.625 4.578125 -2.40625 4.578125 -3.1875 Z M 2.484375 0 C 2.09375 0 1.5 -0.25 1.328125 -1.203125 C 1.21875 -1.796875 1.21875 -2.71875 1.21875 -3.3125 C 1.21875 -3.953125 1.21875 -4.609375 1.296875 -5.140625 C 1.484375 -6.328125 2.234375 -6.421875 2.484375 -6.421875 C 2.8125 -6.421875 3.46875 -6.234375 3.65625 -5.25 C 3.765625 -4.6875 3.765625 -3.9375 3.765625 -3.3125 C 3.765625 -2.5625 3.765625 -1.890625 3.65625 -1.25 C 3.5 -0.296875 2.9375 0 2.484375 0 Z M 2.484375 0 "/>
</g>
<g id="glyph-0-1">
<path d="M 2.9375 -6.375 C 2.9375 -6.625 2.9375 -6.640625 2.703125 -6.640625 C 2.078125 -6 1.203125 -6 0.890625 -6 L 0.890625 -5.6875 C 1.09375 -5.6875 1.671875 -5.6875 2.1875 -5.953125 L 2.1875 -0.78125 C 2.1875 -0.421875 2.15625 -0.3125 1.265625 -0.3125 L 0.953125 -0.3125 L 0.953125 0 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.171875 0 L 4.171875 -0.3125 L 3.859375 -0.3125 C 2.953125 -0.3125 2.9375 -0.421875 2.9375 -0.78125 Z M 2.9375 -6.375 "/>
</g>
<g id="glyph-0-2">
<path d="M 2.890625 -3.515625 C 3.703125 -3.78125 4.28125 -4.46875 4.28125 -5.265625 C 4.28125 -6.078125 3.40625 -6.640625 2.453125 -6.640625 C 1.453125 -6.640625 0.6875 -6.046875 0.6875 -5.28125 C 0.6875 -4.953125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.703125 -4.984375 1.703125 -5.28125 C 1.703125 -5.765625 1.234375 -5.765625 1.09375 -5.765625 C 1.390625 -6.265625 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.375 -6.171875 3.375 -5.28125 C 3.375 -5.15625 3.34375 -4.578125 3.09375 -4.140625 C 2.796875 -3.65625 2.453125 -3.625 2.203125 -3.625 C 2.125 -3.609375 1.890625 -3.59375 1.8125 -3.59375 C 1.734375 -3.578125 1.671875 -3.5625 1.671875 -3.46875 C 1.671875 -3.359375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.53125 -2.6875 3.53125 -1.703125 C 3.53125 -0.34375 2.84375 -0.0625 2.40625 -0.0625 C 1.96875 -0.0625 1.21875 -0.234375 0.875 -0.8125 C 1.21875 -0.765625 1.53125 -0.984375 1.53125 -1.359375 C 1.53125 -1.71875 1.265625 -1.921875 0.984375 -1.921875 C 0.734375 -1.921875 0.421875 -1.78125 0.421875 -1.34375 C 0.421875 -0.4375 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.5625 -0.6875 4.5625 -1.703125 C 4.5625 -2.515625 3.921875 -3.296875 2.890625 -3.515625 Z M 2.890625 -3.515625 "/>
</g>
<g id="glyph-0-3">
<path d="M 4.75 -6.078125 C 4.828125 -6.1875 4.828125 -6.203125 4.828125 -6.421875 L 2.40625 -6.421875 C 1.203125 -6.421875 1.171875 -6.546875 1.140625 -6.734375 L 0.890625 -6.734375 L 0.5625 -4.6875 L 0.8125 -4.6875 C 0.84375 -4.84375 0.921875 -5.46875 1.0625 -5.59375 C 1.125 -5.65625 1.90625 -5.65625 2.03125 -5.65625 L 4.09375 -5.65625 C 3.984375 -5.5 3.203125 -4.40625 2.984375 -4.078125 C 2.078125 -2.734375 1.75 -1.34375 1.75 -0.328125 C 1.75 -0.234375 1.75 0.21875 2.21875 0.21875 C 2.671875 0.21875 2.671875 -0.234375 2.671875 -0.328125 L 2.671875 -0.84375 C 2.671875 -1.390625 2.703125 -1.9375 2.78125 -2.46875 C 2.828125 -2.703125 2.953125 -3.5625 3.40625 -4.171875 Z M 4.75 -6.078125 "/>
</g>
<g id="glyph-0-4">
<path d="M 4.46875 -2 C 4.46875 -3.1875 3.65625 -4.1875 2.578125 -4.1875 C 2.109375 -4.1875 1.671875 -4.03125 1.3125 -3.671875 L 1.3125 -5.625 C 1.515625 -5.5625 1.84375 -5.5 2.15625 -5.5 C 3.390625 -5.5 4.09375 -6.40625 4.09375 -6.53125 C 4.09375 -6.59375 4.0625 -6.640625 3.984375 -6.640625 C 3.984375 -6.640625 3.953125 -6.640625 3.90625 -6.609375 C 3.703125 -6.515625 3.21875 -6.3125 2.546875 -6.3125 C 2.15625 -6.3125 1.6875 -6.390625 1.21875 -6.59375 C 1.140625 -6.625 1.125 -6.625 1.109375 -6.625 C 1 -6.625 1 -6.546875 1 -6.390625 L 1 -3.4375 C 1 -3.265625 1 -3.1875 1.140625 -3.1875 C 1.21875 -3.1875 1.234375 -3.203125 1.28125 -3.265625 C 1.390625 -3.421875 1.75 -3.96875 2.5625 -3.96875 C 3.078125 -3.96875 3.328125 -3.515625 3.40625 -3.328125 C 3.5625 -2.953125 3.59375 -2.578125 3.59375 -2.078125 C 3.59375 -1.71875 3.59375 -1.125 3.34375 -0.703125 C 3.109375 -0.3125 2.734375 -0.0625 2.28125 -0.0625 C 1.5625 -0.0625 0.984375 -0.59375 0.8125 -1.171875 C 0.84375 -1.171875 0.875 -1.15625 0.984375 -1.15625 C 1.3125 -1.15625 1.484375 -1.40625 1.484375 -1.640625 C 1.484375 -1.890625 1.3125 -2.140625 0.984375 -2.140625 C 0.84375 -2.140625 0.5 -2.0625 0.5 -1.609375 C 0.5 -0.75 1.1875 0.21875 2.296875 0.21875 C 3.453125 0.21875 4.46875 -0.734375 4.46875 -2 Z M 4.46875 -2 "/>
</g>
<g id="glyph-0-5">
<path d="M 1.3125 -3.265625 L 1.3125 -3.515625 C 1.3125 -6.03125 2.546875 -6.390625 3.0625 -6.390625 C 3.296875 -6.390625 3.71875 -6.328125 3.9375 -5.984375 C 3.78125 -5.984375 3.390625 -5.984375 3.390625 -5.546875 C 3.390625 -5.234375 3.625 -5.078125 3.84375 -5.078125 C 4 -5.078125 4.3125 -5.171875 4.3125 -5.5625 C 4.3125 -6.15625 3.875 -6.640625 3.046875 -6.640625 C 1.765625 -6.640625 0.421875 -5.359375 0.421875 -3.15625 C 0.421875 -0.484375 1.578125 0.21875 2.5 0.21875 C 3.609375 0.21875 4.5625 -0.71875 4.5625 -2.03125 C 4.5625 -3.296875 3.671875 -4.25 2.5625 -4.25 C 1.890625 -4.25 1.515625 -3.75 1.3125 -3.265625 Z M 2.5 -0.0625 C 1.875 -0.0625 1.578125 -0.65625 1.515625 -0.8125 C 1.328125 -1.28125 1.328125 -2.078125 1.328125 -2.25 C 1.328125 -3.03125 1.65625 -4.03125 2.546875 -4.03125 C 2.71875 -4.03125 3.171875 -4.03125 3.484375 -3.40625 C 3.65625 -3.046875 3.65625 -2.53125 3.65625 -2.046875 C 3.65625 -1.5625 3.65625 -1.0625 3.484375 -0.703125 C 3.1875 -0.109375 2.734375 -0.0625 2.5 -0.0625 Z M 2.5 -0.0625 "/>
</g>
<g id="glyph-0-6">
<path d="M 1.625 -4.5625 C 1.171875 -4.859375 1.125 -5.1875 1.125 -5.359375 C 1.125 -5.96875 1.78125 -6.390625 2.484375 -6.390625 C 3.203125 -6.390625 3.84375 -5.875 3.84375 -5.15625 C 3.84375 -4.578125 3.453125 -4.109375 2.859375 -3.765625 Z M 3.078125 -3.609375 C 3.796875 -3.984375 4.28125 -4.5 4.28125 -5.15625 C 4.28125 -6.078125 3.40625 -6.640625 2.5 -6.640625 C 1.5 -6.640625 0.6875 -5.90625 0.6875 -4.96875 C 0.6875 -4.796875 0.703125 -4.34375 1.125 -3.875 C 1.234375 -3.765625 1.609375 -3.515625 1.859375 -3.34375 C 1.28125 -3.046875 0.421875 -2.5 0.421875 -1.5 C 0.421875 -0.453125 1.4375 0.21875 2.484375 0.21875 C 3.609375 0.21875 4.5625 -0.609375 4.5625 -1.671875 C 4.5625 -2.03125 4.453125 -2.484375 4.0625 -2.90625 C 3.875 -3.109375 3.71875 -3.203125 3.078125 -3.609375 Z M 2.078125 -3.1875 L 3.3125 -2.40625 C 3.59375 -2.21875 4.0625 -1.921875 4.0625 -1.3125 C 4.0625 -0.578125 3.3125 -0.0625 2.5 -0.0625 C 1.640625 -0.0625 0.921875 -0.671875 0.921875 -1.5 C 0.921875 -2.078125 1.234375 -2.71875 2.078125 -3.1875 Z M 2.078125 -3.1875 "/>
</g>
<g id="glyph-0-7">
<path d="M 2.9375 -1.640625 L 2.9375 -0.78125 C 2.9375 -0.421875 2.90625 -0.3125 2.171875 -0.3125 L 1.96875 -0.3125 L 1.96875 0 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.671875 0 L 4.671875 -0.3125 L 4.453125 -0.3125 C 3.71875 -0.3125 3.703125 -0.421875 3.703125 -0.78125 L 3.703125 -1.640625 L 4.6875 -1.640625 L 4.6875 -1.953125 L 3.703125 -1.953125 L 3.703125 -6.484375 C 3.703125 -6.6875 3.703125 -6.75 3.53125 -6.75 C 3.453125 -6.75 3.421875 -6.75 3.34375 -6.625 L 0.28125 -1.953125 L 0.28125 -1.640625 Z M 2.984375 -1.953125 L 0.5625 -1.953125 L 2.984375 -5.671875 Z M 2.984375 -1.953125 "/>
</g>
<g id="glyph-0-8">
<path d="M 3.65625 -3.171875 L 3.65625 -2.84375 C 3.65625 -0.515625 2.625 -0.0625 2.046875 -0.0625 C 1.875 -0.0625 1.328125 -0.078125 1.0625 -0.421875 C 1.5 -0.421875 1.578125 -0.703125 1.578125 -0.875 C 1.578125 -1.1875 1.34375 -1.328125 1.125 -1.328125 C 0.96875 -1.328125 0.671875 -1.25 0.671875 -0.859375 C 0.671875 -0.1875 1.203125 0.21875 2.046875 0.21875 C 3.34375 0.21875 4.5625 -1.140625 4.5625 -3.28125 C 4.5625 -5.96875 3.40625 -6.640625 2.515625 -6.640625 C 1.96875 -6.640625 1.484375 -6.453125 1.0625 -6.015625 C 0.640625 -5.5625 0.421875 -5.140625 0.421875 -4.390625 C 0.421875 -3.15625 1.296875 -2.171875 2.40625 -2.171875 C 3.015625 -2.171875 3.421875 -2.59375 3.65625 -3.171875 Z M 2.421875 -2.40625 C 2.265625 -2.40625 1.796875 -2.40625 1.5 -3.03125 C 1.3125 -3.40625 1.3125 -3.890625 1.3125 -4.390625 C 1.3125 -4.921875 1.3125 -5.390625 1.53125 -5.765625 C 1.796875 -6.265625 2.171875 -6.390625 2.515625 -6.390625 C 2.984375 -6.390625 3.3125 -6.046875 3.484375 -5.609375 C 3.59375 -5.28125 3.640625 -4.65625 3.640625 -4.203125 C 3.640625 -3.375 3.296875 -2.40625 2.421875 -2.40625 Z M 2.421875 -2.40625 "/>
</g>
<g id="glyph-0-9">
<path d="M 1.265625 -0.765625 L 2.328125 -1.796875 C 3.875 -3.171875 4.46875 -3.703125 4.46875 -4.703125 C 4.46875 -5.84375 3.578125 -6.640625 2.359375 -6.640625 C 1.234375 -6.640625 0.5 -5.71875 0.5 -4.828125 C 0.5 -4.28125 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.546875 -4.390625 1.546875 -4.8125 C 1.546875 -5.0625 1.359375 -5.328125 1.015625 -5.328125 C 0.9375 -5.328125 0.921875 -5.328125 0.890625 -5.3125 C 1.109375 -5.96875 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.5625 -5.515625 3.5625 -4.703125 C 3.5625 -3.90625 3.078125 -3.125 2.515625 -2.5 L 0.609375 -0.375 C 0.5 -0.265625 0.5 -0.234375 0.5 0 L 4.203125 0 L 4.46875 -1.734375 L 4.234375 -1.734375 C 4.171875 -1.4375 4.109375 -1 4 -0.84375 C 3.9375 -0.765625 3.28125 -0.765625 3.0625 -0.765625 Z M 1.265625 -0.765625 "/>
</g>
</g>
</defs>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 8.754781 -0.000125 C 8.754781 4.835813 4.832906 8.753781 0.000875 8.753781 C -4.835062 8.753781 -8.753031 4.835813 -8.753031 -0.000125 C -8.753031 -4.836062 -4.835062 -8.754031 0.000875 -8.754031 C 4.832906 -8.754031 8.754781 -4.836062 8.754781 -0.000125 Z M 8.754781 -0.000125 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-0" x="312.806" y="84.163"/>
</g>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -104.635844 -42.519656 C -104.635844 -37.687625 -108.553812 -33.76575 -113.385844 -33.76575 C -118.221781 -33.76575 -122.13975 -37.687625 -122.13975 -42.519656 C -122.13975 -47.355594 -118.221781 -51.273562 -113.385844 -51.273562 C -108.553812 -51.273562 -104.635844 -47.355594 -104.635844 -42.519656 Z M -104.635844 -42.519656 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="199.42" y="126.682"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -8.381937 -3.144656 L -105.006937 -39.375125 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -161.32725 -85.039187 C -161.32725 -80.207156 -165.245219 -76.289187 -170.081156 -76.289187 C -174.917094 -76.289187 -178.835062 -80.207156 -178.835062 -85.039187 C -178.835062 -89.875125 -174.917094 -93.793094 -170.081156 -93.793094 C -165.245219 -93.793094 -161.32725 -89.875125 -161.32725 -85.039187 Z M -161.32725 -85.039187 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-2" x="142.727" y="169.202"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -120.549906 -47.89075 L -162.921 -79.668094 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -189.674906 -127.558719 C -189.674906 -122.726687 -193.592875 -118.808719 -198.428812 -118.808719 C -203.260844 -118.808719 -207.182719 -122.726687 -207.182719 -127.558719 C -207.182719 -132.394656 -203.260844 -136.312625 -198.428812 -136.312625 C -193.592875 -136.312625 -189.674906 -132.394656 -189.674906 -127.558719 Z M -189.674906 -127.558719 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-3" x="114.38" y="211.722"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -175.046 -92.488406 L -193.463969 -120.113406 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -202.026469 -170.082156 C -202.026469 -164.242312 -206.760844 -159.507937 -212.600687 -159.507937 C -218.440531 -159.507937 -223.174906 -164.242312 -223.174906 -170.082156 C -223.174906 -175.922 -218.440531 -180.652469 -212.600687 -180.652469 C -206.760844 -180.652469 -202.026469 -175.922 -202.026469 -170.082156 Z M -202.026469 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="97.717" y="254.241"/>
<use xlink:href="#glyph-0-4" x="102.6983" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -201.256937 -136.054812 L -209.194437 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -173.678812 -170.082156 C -173.678812 -164.242312 -178.413187 -159.507937 -184.253031 -159.507937 C -190.092875 -159.507937 -194.82725 -164.242312 -194.82725 -170.082156 C -194.82725 -175.922 -190.092875 -180.652469 -184.253031 -180.652469 C -178.413187 -180.652469 -173.678812 -175.922 -173.678812 -170.082156 Z M -173.678812 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="126.063" y="254.241"/>
<use xlink:href="#glyph-0-5" x="131.0443" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -195.596781 -136.054812 L -187.659281 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -132.979594 -127.558719 C -132.979594 -122.726687 -136.901469 -118.808719 -141.7335 -118.808719 C -146.569437 -118.808719 -150.487406 -122.726687 -150.487406 -127.558719 C -150.487406 -132.394656 -146.569437 -136.312625 -141.7335 -136.312625 C -136.901469 -136.312625 -132.979594 -132.394656 -132.979594 -127.558719 Z M -132.979594 -127.558719 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-6" x="171.073" y="211.722"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -165.116312 -92.488406 L -146.698344 -120.113406 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -145.335062 -170.082156 C -145.335062 -164.242312 -150.069437 -159.507937 -155.909281 -159.507937 C -161.745219 -159.507937 -166.479594 -164.242312 -166.479594 -170.082156 C -166.479594 -175.922 -161.745219 -180.652469 -155.909281 -180.652469 C -150.069437 -180.652469 -145.335062 -175.922 -145.335062 -170.082156 Z M -145.335062 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="154.409" y="254.241"/>
<use xlink:href="#glyph-0-3" x="159.3903" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -144.565531 -136.054812 L -152.499125 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -116.987406 -170.082156 C -116.987406 -164.242312 -121.721781 -159.507937 -127.561625 -159.507937 C -133.401469 -159.507937 -138.135844 -164.242312 -138.135844 -170.082156 C -138.135844 -175.922 -133.401469 -180.652469 -127.561625 -180.652469 C -121.721781 -180.652469 -116.987406 -175.922 -116.987406 -170.082156 Z M -116.987406 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="182.756" y="254.241"/>
<use xlink:href="#glyph-0-6" x="187.7373" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -138.901469 -136.054812 L -130.967875 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -47.940531 -85.039187 C -47.940531 -80.207156 -51.8585 -76.289187 -56.694437 -76.289187 C -61.526469 -76.289187 -65.448344 -80.207156 -65.448344 -85.039187 C -65.448344 -89.875125 -61.526469 -93.793094 -56.694437 -93.793094 C -51.8585 -93.793094 -47.940531 -89.875125 -47.940531 -85.039187 Z M -47.940531 -85.039187 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-7" x="256.113" y="169.202"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -106.225687 -47.89075 L -63.854594 -79.668094 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -76.288187 -127.558719 C -76.288187 -122.726687 -80.206156 -118.808719 -85.042094 -118.808719 C -89.874125 -118.808719 -93.792094 -122.726687 -93.792094 -127.558719 C -93.792094 -132.394656 -89.874125 -136.312625 -85.042094 -136.312625 C -80.206156 -136.312625 -76.288187 -132.394656 -76.288187 -127.558719 Z M -76.288187 -127.558719 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-8" x="227.766" y="211.722"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -61.659281 -92.488406 L -80.073344 -120.113406 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -88.63975 -170.082156 C -88.63975 -164.242312 -93.374125 -159.507937 -99.213969 -159.507937 C -105.053812 -159.507937 -109.788187 -164.242312 -109.788187 -170.082156 C -109.788187 -175.922 -105.053812 -180.652469 -99.213969 -180.652469 C -93.374125 -180.652469 -88.63975 -175.922 -88.63975 -170.082156 Z M -88.63975 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="211.102" y="254.241"/>
<use xlink:href="#glyph-0-8" x="216.0833" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -87.870219 -136.054812 L -95.807719 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -60.292094 -170.082156 C -60.292094 -164.242312 -65.026469 -159.507937 -70.866312 -159.507937 C -76.706156 -159.507937 -81.440531 -164.242312 -81.440531 -170.082156 C -81.440531 -175.922 -76.706156 -180.652469 -70.866312 -180.652469 C -65.026469 -180.652469 -60.292094 -175.922 -60.292094 -170.082156 Z M -60.292094 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="239.449" y="254.241"/>
<use xlink:href="#glyph-0-0" x="244.4303" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -82.210062 -136.054812 L -74.272562 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -17.772562 -127.558719 C -17.772562 -121.722781 -22.506937 -116.988406 -28.346781 -116.988406 C -34.186625 -116.988406 -38.921 -121.722781 -38.921 -127.558719 C -38.921 -133.398562 -34.186625 -138.132937 -28.346781 -138.132937 C -22.506937 -138.132937 -17.772562 -133.398562 -17.772562 -127.558719 Z M -17.772562 -127.558719 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="281.968" y="211.722"/>
<use xlink:href="#glyph-0-0" x="286.9493" y="211.722"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -51.729594 -92.488406 L -34.323344 -118.597781 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -31.948344 -170.082156 C -31.948344 -164.242312 -36.678812 -159.507937 -42.518656 -159.507937 C -48.3585 -159.507937 -53.092875 -164.242312 -53.092875 -170.082156 C -53.092875 -175.922 -48.3585 -180.652469 -42.518656 -180.652469 C -36.678812 -180.652469 -31.948344 -175.922 -31.948344 -170.082156 Z M -31.948344 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="267.795" y="254.241"/>
<use xlink:href="#glyph-0-1" x="272.7763" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -31.753031 -137.781375 L -39.112406 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M -3.600687 -170.082156 C -3.600687 -164.242312 -8.335062 -159.507937 -14.174906 -159.507937 C -20.01475 -159.507937 -24.745219 -164.242312 -24.745219 -170.082156 C -24.745219 -175.922 -20.01475 -180.652469 -14.174906 -180.652469 C -8.335062 -180.652469 -3.600687 -175.922 -3.600687 -170.082156 Z M -3.600687 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="296.142" y="254.241"/>
<use xlink:href="#glyph-0-9" x="301.1233" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M -24.940531 -137.781375 L -17.581156 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 122.1415 -42.519656 C 122.1415 -37.687625 118.223531 -33.76575 113.387594 -33.76575 C 108.551656 -33.76575 104.633688 -37.687625 104.633688 -42.519656 C 104.633688 -47.355594 108.551656 -51.273562 113.387594 -51.273562 C 118.223531 -51.273562 122.1415 -47.355594 122.1415 -42.519656 Z M 122.1415 -42.519656 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="426.191" y="126.682"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 8.383688 -3.144656 L 105.004781 -39.375125 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 65.446188 -85.039187 C 65.446188 -80.207156 61.528219 -76.289187 56.692281 -76.289187 C 51.86025 -76.289187 47.942281 -80.207156 47.942281 -85.039187 C 47.942281 -89.875125 51.86025 -93.793094 56.692281 -93.793094 C 61.528219 -93.793094 65.446188 -89.875125 65.446188 -85.039187 Z M 65.446188 -85.039187 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-4" x="369.498" y="169.202"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 106.227438 -47.89075 L 63.856344 -79.668094 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 38.918844 -127.558719 C 38.918844 -121.722781 34.188375 -116.988406 28.348531 -116.988406 C 22.508688 -116.988406 17.774313 -121.722781 17.774313 -127.558719 C 17.774313 -133.398562 22.508688 -138.132937 28.348531 -138.132937 C 34.188375 -138.132937 38.918844 -133.398562 38.918844 -127.558719 Z M 38.918844 -127.558719 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="338.661" y="211.722"/>
<use xlink:href="#glyph-0-1" x="343.6423" y="211.722"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 51.727438 -92.488406 L 34.321188 -118.597781 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 24.746969 -170.082156 C 24.746969 -164.242312 20.012594 -159.507937 14.17275 -159.507937 C 8.332906 -159.507937 3.598531 -164.242312 3.598531 -170.082156 C 3.598531 -175.922 8.332906 -180.652469 14.17275 -180.652469 C 20.012594 -180.652469 24.746969 -175.922 24.746969 -170.082156 Z M 24.746969 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="324.488" y="254.241"/>
<use xlink:href="#glyph-0-2" x="329.4693" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 24.942281 -137.781375 L 17.579 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 53.094625 -170.082156 C 53.094625 -164.242312 48.36025 -159.507937 42.520406 -159.507937 C 36.680563 -159.507937 31.946188 -164.242312 31.946188 -170.082156 C 31.946188 -175.922 36.680563 -180.652469 42.520406 -180.652469 C 48.36025 -180.652469 53.094625 -175.922 53.094625 -170.082156 Z M 53.094625 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="352.835" y="254.241"/>
<use xlink:href="#glyph-0-7" x="357.8163" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 31.754781 -137.781375 L 39.114156 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 95.614156 -127.558719 C 95.614156 -121.722781 90.879781 -116.988406 85.039938 -116.988406 C 79.200094 -116.988406 74.465719 -121.722781 74.465719 -127.558719 C 74.465719 -133.398562 79.200094 -138.132937 85.039938 -138.132937 C 90.879781 -138.132937 95.614156 -133.398562 95.614156 -127.558719 Z M 95.614156 -127.558719 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="395.354" y="211.722"/>
<use xlink:href="#glyph-0-9" x="400.3353" y="211.722"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 61.661031 -92.488406 L 79.063375 -118.597781 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 81.442281 -170.082156 C 81.442281 -164.242312 76.707906 -159.507937 70.868063 -159.507937 C 65.028219 -159.507937 60.293844 -164.242312 60.293844 -170.082156 C 60.293844 -175.922 65.028219 -180.652469 70.868063 -180.652469 C 76.707906 -180.652469 81.442281 -175.922 81.442281 -170.082156 Z M 81.442281 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="381.181" y="254.241"/>
<use xlink:href="#glyph-0-4" x="386.1623" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 81.633688 -137.781375 L 74.274313 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 109.786031 -170.082156 C 109.786031 -164.242312 105.051656 -159.507937 99.215719 -159.507937 C 93.375875 -159.507937 88.6415 -164.242312 88.6415 -170.082156 C 88.6415 -175.922 93.375875 -180.652469 99.215719 -180.652469 C 105.051656 -180.652469 109.786031 -175.922 109.786031 -170.082156 Z M 109.786031 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="409.527" y="254.241"/>
<use xlink:href="#glyph-0-5" x="414.5083" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 88.446188 -137.781375 L 95.805563 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 178.832906 -85.039187 C 178.832906 -80.207156 174.914938 -76.289187 170.079 -76.289187 C 165.246969 -76.289187 161.329 -80.207156 161.329 -85.039187 C 161.329 -89.875125 165.246969 -93.793094 170.079 -93.793094 C 174.914938 -93.793094 178.832906 -89.875125 178.832906 -85.039187 Z M 178.832906 -85.039187 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-5" x="482.884" y="169.202"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 120.54775 -47.89075 L 162.918844 -79.668094 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 152.309469 -127.558719 C 152.309469 -121.722781 147.575094 -116.988406 141.73525 -116.988406 C 135.895406 -116.988406 131.161031 -121.722781 131.161031 -127.558719 C 131.161031 -133.398562 135.895406 -138.132937 141.73525 -138.132937 C 147.575094 -138.132937 152.309469 -133.398562 152.309469 -127.558719 Z M 152.309469 -127.558719 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="452.047" y="211.722"/>
<use xlink:href="#glyph-0-2" x="457.0283" y="211.722"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 165.114156 -92.488406 L 147.707906 -118.597781 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 138.133688 -170.082156 C 138.133688 -164.242312 133.399313 -159.507937 127.559469 -159.507937 C 121.719625 -159.507937 116.989156 -164.242312 116.989156 -170.082156 C 116.989156 -175.922 121.719625 -180.652469 127.559469 -180.652469 C 133.399313 -180.652469 138.133688 -175.922 138.133688 -170.082156 Z M 138.133688 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="437.874" y="254.241"/>
<use xlink:href="#glyph-0-3" x="442.8553" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 138.329 -137.781375 L 130.965719 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 166.481344 -170.082156 C 166.481344 -164.242312 161.746969 -159.507937 155.907125 -159.507937 C 150.067281 -159.507937 145.332906 -164.242312 145.332906 -170.082156 C 145.332906 -175.922 150.067281 -180.652469 155.907125 -180.652469 C 161.746969 -180.652469 166.481344 -175.922 166.481344 -170.082156 Z M 166.481344 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="466.22" y="254.241"/>
<use xlink:href="#glyph-0-6" x="471.2013" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 145.1415 -137.781375 L 152.500875 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 209.000875 -127.558719 C 209.000875 -121.722781 204.2665 -116.988406 198.426656 -116.988406 C 192.586813 -116.988406 187.852438 -121.722781 187.852438 -127.558719 C 187.852438 -133.398562 192.586813 -138.132937 198.426656 -138.132937 C 204.2665 -138.132937 209.000875 -133.398562 209.000875 -127.558719 Z M 209.000875 -127.558719 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-1" x="508.74" y="211.722"/>
<use xlink:href="#glyph-0-7" x="513.7213" y="211.722"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 175.04775 -92.488406 L 192.454 -118.597781 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 194.829 -170.082156 C 194.829 -164.242312 190.094625 -159.507937 184.254781 -159.507937 C 178.414938 -159.507937 173.680563 -164.242312 173.680563 -170.082156 C 173.680563 -175.922 178.414938 -180.652469 184.254781 -180.652469 C 190.094625 -180.652469 194.829 -175.922 194.829 -170.082156 Z M 194.829 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-9" x="494.567" y="254.241"/>
<use xlink:href="#glyph-0-8" x="499.5483" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 195.020406 -137.781375 L 187.661031 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<path fill-rule="nonzero" fill="rgb(79.998779%, 79.998779%, 100%)" fill-opacity="1" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 100%)" stroke-opacity="1" stroke-miterlimit="10" d="M 223.176656 -170.082156 C 223.176656 -164.242312 218.442281 -159.507937 212.602438 -159.507937 C 206.762594 -159.507937 202.028219 -164.242312 202.028219 -170.082156 C 202.028219 -175.922 206.762594 -180.652469 212.602438 -180.652469 C 218.442281 -180.652469 223.176656 -175.922 223.176656 -170.082156 Z M 223.176656 -170.082156 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-2" x="522.913" y="254.241"/>
<use xlink:href="#glyph-0-0" x="527.8943" y="254.241"/>
</g>
<path fill="none" stroke-width="0.3985" stroke-linecap="butt" stroke-linejoin="miter" stroke="rgb(0%, 0%, 0%)" stroke-opacity="1" stroke-miterlimit="10" d="M 201.832906 -137.781375 L 209.196188 -159.8595 " transform="matrix(1, 0, 0, -1, 315.296, 80.953)"/>
</svg>

Before

Width:  |  Height:  |  Size: 40 KiB

View file

@ -231,42 +231,6 @@ Heap elements can be tuples. This is useful for assigning comparison values
(1, 'write spec')
Other Applications
------------------
`Medians <https://en.wikipedia.org/wiki/Median>`_ are a measure of
central tendency for a set of numbers. In distributions skewed by
outliers, the median provides a more stable estimate than an average
(arithmetic mean). A running median is an `online algorithm
<https://en.wikipedia.org/wiki/Online_algorithm>`_ that updates
continuously as new data arrives.
A running median can be efficiently implemented by balancing two heaps,
a max-heap for values at or below the midpoint and a min-heap for values
above the midpoint. When the two heaps have the same size, the new
median is the average of the tops of the two heaps; otherwise, the
median is at the top of the larger heap::
def running_median(iterable):
"Yields the cumulative median of values seen so far."
lo = [] # max-heap
hi = [] # min-heap (same size as or one smaller than lo)
for x in iterable:
if len(lo) == len(hi):
heappush_max(lo, heappushpop(hi, x))
yield lo[0]
else:
heappush(hi, heappushpop_max(lo, x))
yield (lo[0] + hi[0]) / 2
For example::
>>> list(running_median([5.0, 9.0, 4.0, 12.0, 8.0, 9.0]))
[5.0, 7.0, 5.0, 7.0, 8.0, 8.5]
Priority Queue Implementation Notes
-----------------------------------
@ -348,12 +312,17 @@ elements are considered to be infinite. The interesting property of a heap is
that ``a[0]`` is always its smallest element.
The strange invariant above is meant to be an efficient memory representation
for a tournament. The numbers below are *k*, not ``a[k]``:
for a tournament. The numbers below are *k*, not ``a[k]``::
.. figure:: heapq-binary-tree.svg
:class: invert-in-dark-mode
:align: center
:alt: Example (min-heap) binary tree.
0
1 2
3 4 5 6
7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a usual
binary tournament we see in sports, each cell is the winner over the two cells

View file

@ -34,7 +34,7 @@ The module provides the following classes:
.. class:: HTTPConnection(host, port=None[, timeout], source_address=None, \
blocksize=8192, max_response_headers=None)
blocksize=8192)
An :class:`HTTPConnection` instance represents one transaction with an HTTP
server. It should be instantiated by passing it a host and optional port
@ -46,9 +46,7 @@ The module provides the following classes:
The optional *source_address* parameter may be a tuple of a (host, port)
to use as the source address the HTTP connection is made from.
The optional *blocksize* parameter sets the buffer size in bytes for
sending a file-like message body. The optional *max_response_headers*
parameter sets the maximum number of allowed response headers to help
prevent denial-of-service attacks, otherwise the default value (100) is used.
sending a file-like message body.
For example, the following calls all create instances that connect to the server
at the same host and port::
@ -68,13 +66,10 @@ The module provides the following classes:
.. versionchanged:: 3.7
*blocksize* parameter was added.
.. versionchanged:: 3.15
*max_response_headers* parameter was added.
.. class:: HTTPSConnection(host, port=None, *[, timeout], \
source_address=None, context=None, \
blocksize=8192, max_response_headers=None)
blocksize=8192)
A subclass of :class:`HTTPConnection` that uses SSL for communication with
secure servers. Default port is ``443``. If *context* is specified, it
@ -114,9 +109,6 @@ The module provides the following classes:
The deprecated *key_file*, *cert_file* and *check_hostname* parameters
have been removed.
.. versionchanged:: 3.15
*max_response_headers* parameter was added.
.. class:: HTTPResponse(sock, debuglevel=0, method=None, url=None)
@ -424,14 +416,6 @@ HTTPConnection Objects
.. versionadded:: 3.7
.. attribute:: HTTPConnection.max_response_headers
The maximum number of allowed response headers to help prevent denial-of-service
attacks. By default, the maximum number of allowed headers is set to 100.
.. versionadded:: 3.15
As an alternative to using the :meth:`~HTTPConnection.request` method described above, you can
also send your request step by step, by using the four functions below.

View file

@ -28,10 +28,8 @@ The character set, :data:`string.ascii_letters`, :data:`string.digits` and
in a cookie name (as :attr:`~Morsel.key`).
.. versionchanged:: 3.3
Allowed '``:``' as a valid cookie name character.
Allowed ':' as a valid cookie name character.
.. versionchanged:: 3.15
Allowed '``"``' as a valid cookie value character.
.. note::
@ -316,10 +314,3 @@ The following example demonstrates how to use the :mod:`http.cookies` module.
>>> print(C)
Set-Cookie: number=7
Set-Cookie: string=seven
>>> import json
>>> C = cookies.SimpleCookie()
>>> C.load(f'cookies=7; mixins="{json.dumps({"chips": "dark chocolate"})}"; state=gooey')
>>> print(C)
Set-Cookie: cookies=7
Set-Cookie: mixins="{"chips": "dark chocolate"}"
Set-Cookie: state=gooey

View file

@ -458,6 +458,55 @@ such as using different index file names by overriding the class attribute
:attr:`index_pages`.
.. class:: CGIHTTPRequestHandler(request, client_address, server)
This class is used to serve either files or output of CGI scripts from the
current directory and below. Note that mapping HTTP hierarchic structure to
local directory structure is exactly as in :class:`SimpleHTTPRequestHandler`.
.. note::
CGI scripts run by the :class:`CGIHTTPRequestHandler` class cannot execute
redirects (HTTP code 302), because code 200 (script output follows) is
sent prior to execution of the CGI script. This pre-empts the status
code.
The class will however, run the CGI script, instead of serving it as a file,
if it guesses it to be a CGI script. Only directory-based CGI are used ---
the other common server configuration is to treat special extensions as
denoting CGI scripts.
The :func:`do_GET` and :func:`do_HEAD` functions are modified to run CGI scripts
and serve the output, instead of serving files, if the request leads to
somewhere below the ``cgi_directories`` path.
The :class:`CGIHTTPRequestHandler` defines the following data member:
.. attribute:: cgi_directories
This defaults to ``['/cgi-bin', '/htbin']`` and describes directories to
treat as containing CGI scripts.
The :class:`CGIHTTPRequestHandler` defines the following method:
.. method:: do_POST()
This method serves the ``'POST'`` request type, only allowed for CGI
scripts. Error 501, "Can only POST to CGI scripts", is output when trying
to POST to a non-CGI url.
Note that CGI scripts will be run with UID of user nobody, for security
reasons. Problems with the CGI script will be translated to error 403.
.. deprecated-removed:: 3.13 3.15
:class:`CGIHTTPRequestHandler` is being removed in 3.15. CGI has not
been considered a good way to do things for well over a decade. This code
has been unmaintained for a while now and sees very little practical use.
Retaining it could lead to further :ref:`security considerations
<http.server-security>`.
.. _http-server-cli:
Command-line interface
@ -514,6 +563,24 @@ The following options are accepted:
.. versionadded:: 3.11
.. option:: --cgi
:class:`CGIHTTPRequestHandler` can be enabled in the command line by passing
the ``--cgi`` option::
python -m http.server --cgi
.. deprecated-removed:: 3.13 3.15
:mod:`http.server` command line ``--cgi`` support is being removed
because :class:`CGIHTTPRequestHandler` is being removed.
.. warning::
:class:`CGIHTTPRequestHandler` and the ``--cgi`` command-line option
are not intended for use by untrusted clients and may be vulnerable
to exploitation. Always use within a secure environment.
.. option:: --tls-cert
Specifies a TLS certificate chain for HTTPS connections::

View file

@ -413,7 +413,7 @@ An :class:`IMAP4` instance has the following methods:
the password. Will only work if the server ``CAPABILITY`` response includes the
phrase ``AUTH=CRAM-MD5``.
.. versionchanged:: 3.15
.. versionchanged:: 3.14
An :exc:`IMAP4.error` is raised if MD5 support is not available.

View file

@ -73,15 +73,12 @@ for example, a package and its resources can be imported from a zip file using
.. versionadded:: 3.9
.. versionchanged:: 3.12
*package* parameter was renamed to *anchor*.
*package* was still accepted, but deprecated.
.. versionchanged:: 3.15
*package* parameter was fully removed. *anchor* can now be a
non-package module and if omitted will default to the caller's module.
*package* is no longer accepted since Python 3.15. Consider passing the
anchor positionally or using ``importlib_resources >= 5.10`` for a
compatible interface on older Pythons.
*package* parameter was renamed to *anchor*. *anchor* can now
be a non-package module and if omitted will default to the caller's
module. *package* is still accepted for compatibility but will raise
a :exc:`DeprecationWarning`. Consider passing the anchor positionally or
using ``importlib_resources >= 5.10`` for a compatible interface
on older Pythons.
.. function:: as_file(traversable)

View file

@ -124,10 +124,6 @@ Functions
need to call :func:`invalidate_caches` in order for the new module to be
noticed by the import system.
If the module cannot be imported, :func:`import_module` will raise
:exc:`ImportError` or an appropriate subclass like
:exc:`ModuleNotFoundError`.
.. versionchanged:: 3.3
Parent packages are automatically imported.
@ -459,7 +455,7 @@ ABC hierarchy::
.. versionchanged:: 3.4
Raises :exc:`ImportError` instead of :exc:`NotImplementedError`.
.. staticmethod:: source_to_code(data, path='<string>', fullname=None)
.. staticmethod:: source_to_code(data, path='<string>')
Create a code object from Python source.
@ -471,19 +467,11 @@ ABC hierarchy::
With the subsequent code object one can execute it in a module by
running ``exec(code, module.__dict__)``.
The optional argument *fullname* specifies the module name.
It is needed to unambiguous :ref:`filter <warning-filter>` syntax
warnings by module name.
.. versionadded:: 3.4
.. versionchanged:: 3.5
Made the method static.
.. versionadded:: 3.15
Added the *fullname* parameter.
.. method:: exec_module(module)
Implementation of :meth:`Loader.exec_module`.
@ -1021,36 +1009,6 @@ find and load modules.
:exc:`ImportError` is raised.
.. class:: NamespacePath(name, path, path_finder)
Represents a :term:`namespace package`'s path (:attr:`module.__path__`).
When its ``__path__`` value is accessed it will be recomputed if necessary.
This keeps it in-sync with the global state (:attr:`sys.modules`).
The *name* argument is the name of the namespace module.
The *path* argument is the initial path value.
The *path_finder* argument is the callable used to recompute the path value.
The callable has the same signature as :meth:`importlib.abc.MetaPathFinder.find_spec`.
When the parent's :attr:`module.__path__` attribute is updated, the path
value is recomputed.
If the parent module is missing from :data:`sys.modules`, then
:exc:`ModuleNotFoundError` will be raised.
For top-level modules, the parent module's path is :data:`sys.path`.
.. note::
:meth:`PathFinder.invalidate_caches` invalidates :class:`NamespacePath`,
forcing the path value to be recomputed next time it is accessed.
.. versionadded:: 3.15
.. class:: SourceFileLoader(fullname, path)
A concrete implementation of :class:`importlib.abc.SourceLoader` by

View file

@ -619,29 +619,17 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
Retrieving source code
----------------------
.. function:: getdoc(object, *, inherit_class_doc=True, fallback_to_class_doc=True)
.. function:: getdoc(object)
Get the documentation string for an object, cleaned up with :func:`cleandoc`.
If the documentation string for an object is not provided:
* if the object is a class and *inherit_class_doc* is true (by default),
retrieve the documentation string from the inheritance hierarchy;
* if the object is a method, a property or a descriptor, retrieve
the documentation string from the inheritance hierarchy;
* otherwise, if *fallback_to_class_doc* is true (by default), retrieve
the documentation string from the class of the object.
If the documentation string for an object is not provided and the object is
a class, a method, a property or a descriptor, retrieve the documentation
string from the inheritance hierarchy.
Return ``None`` if the documentation string is invalid or missing.
.. versionchanged:: 3.5
Documentation strings are now inherited if not overridden.
.. versionchanged:: 3.15
Added parameters *inherit_class_doc* and *fallback_to_class_doc*.
Documentation strings on :class:`~functools.cached_property`
objects are now inherited if not overriden.
.. function:: getcomments(object)

Some files were not shown because too many files have changed in this diff Show more