Commit graph

125098 commits

Author SHA1 Message Date
Serhiy Storchaka
731832a024
[3.13] gh-140615: Update docstrings in the fcntl module (GH-140619) (GH-141231) (GH-141232)
* 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)
(cherry picked from commit 1a080199af)
2025-11-08 11:50:17 +00:00
Miss Islington (bot)
be33104f88
[3.13] gh-140793: Improve documentatation and tests for the ensure_ascii option in the json module (GH-140906) (GH-141228)
* 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:30:15 +00:00
Miss Islington (bot)
46d96dce63
[3.13] gh-139741: Make dist-pdf docs archive build work for macOS (GH-140837) (#141230)
Co-authored-by: Naitree Zhu <Naitreey@gmail.com>
2025-11-08 10:26:51 +00:00
Miss Islington (bot)
a728f7f89f
[3.13] gh-141004: Document Py_HASH_* macros (GH-141205) (#141224)
* 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:22:02 +00:00
Miss Islington (bot)
dfbc5eb80e
[3.13] gh-140826: Update winreg's docstring (GH-141050) (GH-141200) (GH-141209)
(cherry picked from commit bea0d3d12b)
(cherry picked from commit b3377c3b41)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-11-07 19:01:27 +00:00
Miss Islington (bot)
0efb799852
[3.13] gh-141004: Document PyTraceBack* APIs (GH-141192) (GH-141211)
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:53:05 +00:00
Miss Islington (bot)
26c2a49857
[3.13] gh-141004: Document PyErr_WarnExplicitFormat (GH-141187) (GH-141203)
gh-141004: Document `PyErr_WarnExplicitFormat` (GH-141187)
(cherry picked from commit 9420795b47)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-07 16:25:58 +00:00
Miss Islington (bot)
09cc93dc67
[3.13] gh-141004: Document PyCapsule_Type (GH-141079) (GH-141198)
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:14 +00:00
Stan Ulbrych
0923704b49
[3.13] gh-139246: zero-width word paste can be wrong in default repl (GH-139254) (GH-141166)
(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:51:03 +01:00
Miss Islington (bot)
353bfc813b
[3.13] gh-141141: Make base64.b85decode() thread safe (GH-141149) (GH-141185)
(cherry picked from commit a7bf27f7f5)

Co-authored-by: Benel Tayar <86257734+beneltayar@users.noreply.github.com>
2025-11-07 11:10:21 +00:00
Miss Islington (bot)
dcd2dbaf36
[3.13] gh-140734: fix off-by-one error when comparing to _SUN_PATH_MAX (GH-140903) (#141182)
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:18:06 +00:00
Rodrigo Girão Serrão
e753887bd2
[3.13] Minor documentation improvements (GH-140626) (#141161) 2025-11-06 17:37:31 +00:00
Miss Islington (bot)
00032a4245
[3.13] gh-141004: Document Py_GetRecursionLimit and Py_SetRecursionLimit (GH-141151) (GH-141157)
* 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>

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-06 17:00:03 +00:00
Stan Ulbrych
f1a93727c4
[3.13] gh-140939: Fix memory leak in _PyBytes_FormatEx error path (GH-140957) (#141155)
(cherry picked from commit d6c89a2df2)
2025-11-06 16:16:43 +00:00
Peter Bierma
908695b5c7
[3.13] gh-141004: Document PyLong_FromPid and PyLong_AsPid (GH-141028) (GH-141143)
* gh-141004: Document `PyLong_FromPid` and `PyLong_AsPid` (GH-141028)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit bcc524f82d)
2025-11-06 14:10:24 +00:00
Miss Islington (bot)
ccbee02436
[3.13] gh-141004: Document Py_hexdigits (GH-141059) (GH-141139)
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:14 +00:00
Miss Islington (bot)
a8cd8f0441
[3.13] gh-141004: Document built-in iterator types in the C API (GH-141006) (GH-141135)
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:31 +00:00
Miss Islington (bot)
1be80bec79
[3.13] gh-125346: Add more base64 tests (GH-141061) (GH-141130) (GH-141133)
(cherry picked from commit fd17ee026f)

Add more tests for the altchars argument of b64decode() and for the map01
argument of b32decode().
(cherry picked from commit 13360efd38)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-11-06 14:32:42 +02:00
Miss Islington (bot)
89cb8aa3ba
[3.13] Minor fixes to idle.rst and regenerate help.html (GH-140037) (#141122)
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 12:11:50 +00:00
Miss Islington (bot)
54e5dea534
[3.13] gh-129876: Move misplaced IDLE news item (GH-141118) (#141120)
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:15 -05:00
Miss Islington (bot)
a29f5218e5
[3.13] gh-140569: recommend the new REPL in the asyncio REPL docs (GH-140570) (#141116)
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:45:18 +00:00
Miss Islington (bot)
8641c471a7
[3.13] gh-118516: clarify that subprocess are automatically killed if transport gets garbage collected (GH-140997) (#141111)
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:35:01 +05:30
Miss Islington (bot)
f671739fdc
[3.13] GH-108009: Add clarification of parser and argument defaults in argparse docs (GH-124154) (#141085)
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:43 +00:00
Miss Islington (bot)
fc059dbe55
[3.13] gh-141004: Document PyDict_GET_SIZE (GH-141078) (GH-141083)
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:41:16 +00:00
Miss Islington (bot)
d29fe3f32c
[3.13] gh-76007: remove curses.__version__ doc (GH-141052) (#141077)
Co-authored-by: Zenith <me@arielle.codes>
2025-11-05 22:07:32 +00:00
Miss Islington (bot)
4907f37eed
[3.13] gh-141004: Document Py_RETURN_NAN and Py_RETURN_INF (GH-141029) (GH-141075)
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:06:41 +00:00
Miss Islington (bot)
db0900be6e
[3.13] Docs: replace an esoteric Von Neumann mention (GH-137598) (#140371)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-11-05 23:40:56 +02:00
Miss Islington (bot)
3ecf63754e
[3.13] Fix a compiler warning in _randommodule.c (GH-141058) (#141064)
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:08:41 +00:00
Miss Islington (bot)
91b85c5346
[3.13] gh-139313: Improve docs on XML security (GH-139460) (GH-141066)
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:06:37 +00:00
Miss Islington (bot)
2dd0a6ad9c
[3.13] Docs: Fix cached calls count in factorial example (gh-140882) (gh-141032)
Co-authored-by: Clifford Gama <cliffygamy@gmail.com>
2025-11-05 12:15:05 -06:00
Victor Stinner
43882c7c4e
[3.13] gh-140815: Fix faulthandler for invalid/freed frame (#140921) (#140985)
gh-140815: Fix faulthandler for invalid/freed frame (#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)
2025-11-05 18:39:28 +01:00
Miss Islington (bot)
7ac9048ce9
[3.13] gh-141004: Document PyMemoryView_Type (GH-141034) (GH-141055)
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:31 +00:00
Jan-Eric Nitschke
15db2421ce
[3.13] gh-138772: Add tests for Turtle.dot() signature (GH-138773) (#140992)
Co-authored-by: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-05 17:24:46 +02:00
Miss Islington (bot)
a3756c6ea0
[3.13] gh-141004: Document missing iterator types in the C API (GH-141010) (GH-141047)
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:22:32 +00:00
Hugo van Kemenade
64bf92179b
[3.13] Omit Python/perf_jit_trampoline.c from the **/*jit* CODEOWNERS rule (GH-136519) (#140988)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2025-11-05 14:24:12 +02:00
Miss Islington (bot)
82ed4d0707
[3.13] gh-141004: Document Py_UNICODE_{HIGH, LOW}_SURROGATE functions (GH-141019) (GH-141026)
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:24:52 +00:00
Filip Łajszczak
d76e411891
[3.13] gh-139434: Update selected RFC 2822 references to RFC 5322 (GH-139435) (#141024)
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:22:31 -05:00
Miss Islington (bot)
426daef412
[3.13] Docs: Fix typo in email.headerregistry.rst (GH-140965) (#141021)
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:14 +00:00
Miss Islington (bot)
fbfa3e3fe8
[3.13] gh-134817: Restore accidentally deleted line in documentation. (GH-141013) (GH-141017)
(cherry picked from commit 66c86c6)
2025-11-04 18:57:32 +00:00
Miss Islington (bot)
aa4dd4ece8
[3.13] Document that returning sys.monitoring.DISABLE in response to a global event raises ValueError (GH-140726) (GH-141015)
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:36:40 +00:00
Hugo van Kemenade
56146059d3
[3.13] gh-139590: Stricter ruff rules for Tools/wasm (GH-139752) (#140986)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-11-04 18:17:57 +00:00
Miss Islington (bot)
ac0ecb0f5d
[3.13] gh-140826 Remove the wrong documents about comparison behavior on winreg.HKEYType (GH-140999) (GH-141003)
(cherry picked from commit c3f9702f04)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-11-04 16:36:46 +00:00
Miss Islington (bot)
fd9be78f4e
[3.13] gh-140979: Fix off-by-one error in the RE code validator (GH-140984) (GH-141000)
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:40 +02:00
Miss Islington (bot)
551d68d8cf
[3.13] Fix minor typo: 'web site' -> 'website' (GH-140561) (GH-140977)
(cherry picked from commit 08115d241a)

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

Co-authored-by: Abhishek Tiwari <Abhi210@users.noreply.github.com>
2025-11-04 11:17:29 +00:00
Miss Islington (bot)
e7507967f8
[3.13] Docs: Fix a typo in idle.rst (Chitespace -> Whitespace) (GH-140946) (#140954)
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-11-04 10:02:17 +02:00
Hugo van Kemenade
5a2bcbd452
[3.13] Fix minor typos and wording in C API docs (GH-140955) (#140967)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-04 09:46:18 +02:00
Jiucheng(Oliver)
10af8404b4
[3.13] gh-135307: Fix email error when policy max_line_length is set to 0 or None (GH-135367) (#140917)
[3.13] gh-135307: Fix email error when policy max_line_length is set to 0 or None (GH-135367)
(cherry picked from commit 6d45cd8dbb)

Co-authored-by: Jiucheng(Oliver) <git.jiucheng@gmail.com>
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.
2025-11-02 15:20:29 -05:00
Miss Islington (bot)
b8910fc444
[3.13] Docs: avoid informal formulation in Doc/c-api/conversion.rst (GH-140898) (#140913)
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:03 +00:00
Sebastian Pipping
bc36bd1786
[3.13] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234) (#139367)
* gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (#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 12:39:11 +00:00