Commit graph

125868 commits

Author SHA1 Message Date
Miss Islington (bot)
dad9bec4fa
[3.13] gh-84353: Preserve non-UTF-8 filenames when appending to ZipFile (GH-150091) (GH-150529)
Preserve non-UTF-8 filenames when appending to a ZipFile.

---------
(cherry picked from commit 24c6bbc92b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-05-27 18:21:14 +00:00
Serhiy Storchaka
68840510e3
[3.13] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) (GH-150473) (GH-150526)
(cherry picked from commit 49975a511f)
(cherry picked from commit cf73b17adf)
(cherry picked from commit 287c98f4cb)
2026-05-27 18:06:50 +00:00
Miss Islington (bot)
446c91e5fb
[3.13] gh-149861: Fix rule in match statement case_block PEG grammar (#150512)
(cherry picked from commit 99c254e2f7)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
2026-05-27 16:25:43 +01:00
Miss Islington (bot)
a58c24d9fd
[3.13] gh-88726: Stop using non-standard charset names eucgb2312_cn and big5_tw in email (GH-149959) (GH-150493)
(cherry picked from commit 5e467f4331)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-27 10:53:08 +00:00
Miss Islington (bot)
98a9ccbe39
[3.13] gh-149571: Fix the C implementation of Element.itertext() (GH-149929) (GH-150511)
It no longer emits text for comments and processing instructions.
(cherry picked from commit 7de4fcd445)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-27 10:49:54 +00:00
Miss Islington (bot)
43f71b0005
[3.13] gh-150175: Fix ThreadingMock call_count race condition (GH-150176) (#150180)
gh-150175: Fix ThreadingMock call_count race condition (GH-150176)

ThreadingMock._increment_mock_call() was not thread-safe.
Multiple threads calling the mock simultaneously could lose
increments due to race conditions on call_count and other
attributes.

Fix by overriding _increment_mock_call in ThreadingMixin
and wrapping it with the existing _mock_calls_events_lock.
(cherry picked from commit 388e023fe1)

Co-authored-by: saisneha196 <156835592+saisneha196@users.noreply.github.com>
2026-05-26 12:47:20 -07:00
Serhiy Storchaka
43b6b483b2
[3.13] gh-150285: Fix too long docstrings in builtins (GH-150293) (GH-150466) (GH-150472)
(cherry picked from commit 730fc6a858)
(cherry picked from commit e1e06be119)
2026-05-26 10:34:50 +00:00
Serhiy Storchaka
96d66ac33b
[3.13] gh-150285: Fix too long docstrings in the io module (GH-150287) (GH-150458) (GH-150470)
(cherry picked from commit 36137e46a8)
(cherry picked from commit 160dc74122)
2026-05-26 10:29:28 +00:00
Serhiy Storchaka
b030936f33
[3.13] gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) (GH-150461) (GH-150471)
(cherry picked from commit 7168b02795)
(cherry picked from commit 0466560b31)
2026-05-26 10:11:11 +00:00
Serhiy Storchaka
56be4fb3d2
[3.13] gh-150285: Fix too long docstrings in the pyexpat module (GH-150294) (GH-150463) (GH-150468)
(cherry picked from commit ad1bb6c14c)
(cherry picked from commit 9da7923835)
2026-05-26 10:01:15 +00:00
Serhiy Storchaka
59cafbbeaf
[3.13] gh-150285: Fix too long docstrings in the curses module (GH-150286) (GH-150457) (GH-150469)
(cherry picked from commit e7f1216204)
(cherry picked from commit 4c0fe2d134)
2026-05-26 09:58:11 +00:00
Miss Islington (bot)
9463c9d33e
[3.13] gh-150285: Fix too long docstrings in the decimal module (GH-150288) (GH-150460) (GH-150465)
(cherry picked from commit 9d79e71fb6)
(cherry picked from commit 6bed57a3b6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-26 12:49:41 +03:00
Russell Keith-Magee
7d265b6013
[3.13] gh-150443: Exclude explicit dup3 and pipe2 checks on iOS builds. (GH-150444) (#150448)
Exclude explicit dup3 and pipe2 checks on iOS builds.
(cherry picked from commit 629da5c914)
2026-05-26 13:07:20 +08:00
Miss Islington (bot)
20805238e5
[3.13] gh-80198: Improve test_pwd and test_grp (GH-150380) (GH-150398) (GH-150423)
Fix tests for non-existing names and ids when getpwall()/getgrall()
don't return all users/groups.

Add tests for out-of-range uids, integer float ids, bytes names,
null-terminated names, names with surrogates, empty names, excessive
arguments.
(cherry picked from commit 4bdff2cc89)
(cherry picked from commit 46e8f7a9e7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-25 19:10:25 +00:00
Miss Islington (bot)
ab4df90364
[3.13] gh-149156: Fix perf trampoline crash after fork (GH-150347) (#150393) 2026-05-25 19:19:07 +01:00
Miss Islington (bot)
60d843777c
[3.13] gh-149449: Fix use-after-free in _PyUnicode_GetNameCAPI (GH-150323) (#150354)
gh-149449: Fix use-after-free in `_PyUnicode_GetNameCAPI` (GH-150323)
(cherry picked from commit 43c60ec2fd)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-05-25 16:10:48 +05:30
Miss Islington (bot)
effcfd725d
[3.13] gh-145896: Fix typos and stale docstrings in the traceback module (GH-145897) (GH-150384)
(cherry picked from commit 832afeddce)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2026-05-25 10:07:38 +00:00
Miss Islington (bot)
80c422d442
[3.13] gh-110704: Recommend distclean target over clean when source tree is not clean (GH-112610) (#150344)
gh-110704: Recommend `distclean` target over `clean` when source tree is not clean (GH-112610)

Recommend `distclean` target over `clean` when source tree is not clean
(cherry picked from commit 34631058f2)

Co-authored-by: James <6125322+SnoopJ@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-05-24 08:47:49 -07:00
Bénédikt Tran
e102378eca
[3.13] gh-142516: fix reference leaks in ssl.SSLContext objects (GH-143685) (GH-145075) (#148371)
Cherry picked from commits 3a2a686cc4
and 1decc7ee20 with minor amendments.
2026-05-24 11:43:03 +02:00
Jonathan Dung
29fcf3c5f9
[3.13] Document that import sys.monitoring raises ModuleNotFoundError (GH-148320) (#148422) 2026-05-24 12:54:29 +05:30
Hai Zhu
5d03b24827
[3.13] gh-148450: abc.register needs to update type_version when tp_flags is changed (GH-148623) (#150307) 2026-05-23 17:20:16 +05:30
Miss Islington (bot)
95c93239be
[3.13] gh-150178: Fix refcount leaks in hamt allocation failure paths (GH-150179) (#150301)
gh-150178: Fix refcount leaks in hamt allocation failure paths (GH-150179)
(cherry picked from commit 32823af153)

Co-authored-by: pengyu lee <lipengyu@kylinos.cn>
2026-05-23 14:54:11 +05:30
Miss Islington (bot)
7388a67340
[3.13] gh-150232: update Thread group parameter doc (GH-150283) (#150299)
gh-150232: update Thread group parameter doc (GH-150283)
(cherry picked from commit 82191c6d2c)

Co-authored-by: My-ABC <569817555@qq.com>
2026-05-23 14:04:15 +05:30
Miss Islington (bot)
c0e40601d7
[3.13] Remove 'expat' dependency for Linux in Misc/Brewfile (GH-150118) (#150254)
Co-authored-by: Brett Cannon <brett@python.org>
2026-05-22 14:28:10 +00:00
Miss Islington (bot)
5cf32883dc
[3.13] gh-149902: Remove dead packaging docs link and add a new section for external resources (GH-150030) (#150239)
Co-authored-by: Mia Albert <micha@2231puppy.tech>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-05-22 14:45:31 +03:00
Miss Islington (bot)
26a814e4e1
[3.13] Replace deprecated action with RtD app (GH-149111) (#150234)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-05-22 11:08:42 +00:00
Miss Islington (bot)
46cff6be90
[3.13] gh-137571: Protect against possible UnboundLocalError in gzip._GzipReader.read() (GH-150222) (GH-150231)
This has not been observed in practice, but we cannot be 100% sure that
it will not happen with some weird gzip data.
(cherry picked from commit 28eac9a726)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-22 09:37:57 +00:00
Jelle Zijlstra
1df755c135
[3.13] gh-149995: Update typing.py docstrings and documentation (#150217)
Some of these docstrings read as if they were written when typing.py was
first written, and things have evolved since then.

A few motivations:
- Call protocols protocols instead of ABCs. They are also ABCs, but the fact
  they are protocols is more relevant to typing.
- Avoid recommending direct use of .__annotations__ and steer users to
  annotationlib instead.
- For TypedDict, mention NotRequired before total=False since it is more
  general and probably more frequently useful.
- For overloads, mention runtime use first instead of stub use. I think early on
  there was talk of allowing overload only in stubs, but it is now heavily used at
  runtime too and that's more likely to be relevant to users.
(cherry picked from commit f159419ae2)
2026-05-22 05:09:41 +00:00
Miss Islington (bot)
cfa3daa7fe
[3.13] gh-107398: Fix tarfile stream mode exception when process the file with the gzip extra field (GH-126304) (GH-150201)
(cherry picked from commit 65f99329ed)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-21 22:38:54 +03:00
Stan Ulbrych
6f72734446
[3.13] Fix minor typos in unicode.rst (GH-149587) (#150163)
(cherry picked from commit 4e97ff3351)

Co-authored-by: Manoj K M <manojkmdev24@gmail.com>
2026-05-20 15:37:06 +00:00
sobolevn
32feeff72d
[3.13] gh-150146: Fix NULL dereference in _Py_subs_parameters (GH-150147) (#150155)
* [3.13] gh-150146: Fix NULL dereference in `_Py_subs_parameters` (GH-150147)
(cherry picked from commit f621ba16b7)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-05-20 14:04:17 +00:00
Shamil
e87baa8d24
[3.13] gh-142831: Fix use-after-free in json encoder during re-entrant mutation (gh-142851) (#150079)
gh-142831: Fix use-after-free in json encoder during re-entrant mutation (gh-142851)

User callbacks invoked during JSON encoding (e.g. the `default` callback or
a custom string encoder) can mutate or clear the dict or sequence being
encoded, invalidating borrowed references to items, keys, and values. Hold
strong references unconditionally while iterating.



(cherry picked from commit 235fa7244a)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-05-19 20:33:22 -07:00
Miss Islington (bot)
792a552879
[3.13] gh-134887: Add references to locale module for locale-aware number formatting references in string module docs (GH-134888) (GH-150122)
(cherry picked from commit 47723af4e7)

Co-authored-by: Stefanie Molin <24376333+stefmolin@users.noreply.github.com>
2026-05-20 02:55:24 +02:00
Miss Islington (bot)
23fcb4824f
[3.13] gh-149983: Fix PyErr_NoMemory call without GIL in winconsoleio.c (GH-149984) (GH-150112)
(cherry picked from commit 3d2aa899ba)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-05-19 23:11:28 +02:00
Miss Islington (bot)
6fb207ef3e
[3.13] gh-69619: Clarify whitespace definition in str.strip docs (GH-150021) (GH-150047)
(cherry picked from commit 17eb17d43f)

Co-authored-by: Daniil <d.mayorov@innopolis.university>
2026-05-19 23:07:20 +02:00
Armaan Vakharia
44f314933c
[3.13] gh-149590: Remove faulthandler_traverse (GH-150023) (#150087)
`faulthandler_traverse` visits Python objects owned by `_PyRuntime`, not
by the module instance. With multi-phase init allowing multiple module
instances, each instance's GC traversal decrements `gc_refs` on the same
runtime-owned objects, driving it negative when two instances are
collected simultaneously.
(cherry picked from commit 56737483c2)
2026-05-19 15:04:13 +00:00
Miss Islington (bot)
8ee6aff140
[3.13] gh-146581: Update docs for dangerous filenames in ZIP files (GH-149994) (GH-150066)
(cherry picked from commit ba0aca3bff)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Sebastian Gassner <sebastian.gassner@gmail.com>
2026-05-19 08:44:21 +00:00
Miss Islington (bot)
09b2e00b42
[3.13] gh-95816: Fix TLS version range example in docs (GH-148574) (#150010)
gh-95816: Fix TLS version range example in docs (GH-148574)

docs(ssl): Fix TLS version range example
(cherry picked from commit dbd8985e82)

Co-authored-by: Jan Brasna <1784648+janbrasna@users.noreply.github.com>
2026-05-18 14:47:35 -07:00
Miss Islington (bot)
9e071c9b28
[3.13] gh-146211: Reject CR/LF in HTTP tunnel request headers (GH-146212) (#148343)
gh-146211: Reject CR/LF in HTTP tunnel request headers (GH-146212)
(cherry picked from commit 05ed7ce7ae)

Co-authored-by: Seth Larson <seth@python.org>
Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
2026-05-18 19:44:36 +02:00
Hugo van Kemenade
419fe42b5a
[3.13] CI: Move Homebrew dependencies into Brewfile (GH-148335) (#149884)
Co-authored-by: Brett Cannon <brett@python.org>
2026-05-18 16:33:04 +03:00
AN Long
5531c77d33
[3.13] gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (GH-149922) (#149954)
(cherry picked from commit acefff95ea)
2026-05-17 13:36:32 +00:00
Miss Islington (bot)
b2b35bad02
[3.13] gh-149916: Restore the commented out part of test_body_encode in test_email (GH-149917) (GH-149939)
(cherry picked from commit 1cbe035723)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-17 08:29:33 +00:00
Miss Islington (bot)
e90f3baf5d
[3.13] gh-134837: Correct and improve base85 documentation for base64 module (GH-145843) (GH-149743) (GH-149893)
(cherry picked from commit e667d62f11)
(cherry picked from commit 9ad8a1b955)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: David Huggins-Daines <dhd@ecolingui.ca>
2026-05-15 21:36:47 +03:00
Miss Islington (bot)
012530ba4f
[3.13] gh-149801: Add IANA registered names and aliases with leading zeros (GH-149804) (GH-149872)
Like IBM00858, CP00858, IBM01140, CP01140.
(cherry picked from commit 20438866ae)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-15 15:08:50 +03:00
Victor Stinner
782880ba23
[3.13] gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791) (#149867)
gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791)

Change my_strchr() return type to "const char*" (add "const").

Fix the compiler warning:

Modules/_ctypes/_ctypes_test.c: In function 'my_strchr':
Modules/_ctypes/_ctypes_test.c:451:12: warning: return discards
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  451 |     return strchr(s, c);
      |            ^~~~~~

When using C23, strchr(text, ch) return type is "const char*" if text
type is "const char*".

(cherry picked from commit 5465b69255)
2026-05-15 11:32:58 +00:00
sobolevn
a89fafca65
[3.13] gh-149763: Improve availablity docs in select.rst (GH-149764) (#149856)
(cherry picked from commit 7e98debdf4)
2026-05-15 07:33:33 +00:00
Miss Islington (bot)
4da3e91363
[3.13] Link to existing rules in compound_stmts.rst (GH-149811) (GH-149838)
Link to existing rules in compound_stmts.rst (GH-149811)

In gh-138418, `!` was added to links to rules that don't exist in
the docs, in order to silence broken link warnings.
However, productionlist doesn't parse the `!`, which ends up in
the rendered documentation. (It's possible that gh-127835 broke
the `!` support.)

Replace the names with ones that appear in docs:

- `star_named_expression` in the grammar corresponds to
  `flexible_expression` in the docs
- `star_named_expressions` in the grammar corresponds to
  `flexible_expression_list` in the docs
- `named_expression` in the grammar corresponds to
  `assignment_expression` in the docs

Having two sets of names isn't great of course. Consolidating them
is tracked in (subissues of) gh-127833.
(cherry picked from commit c37529293d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-05-14 19:34:29 +02:00
Miss Islington (bot)
6fff3e4bc6
[3.13] gh-149698: Update bundled expat to 2.8.1 (GH-149699) (#149827)
(cherry picked from commit f1a47e79fb)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-05-14 15:24:39 +00:00
Miss Islington (bot)
ae31e50d3f
[3.13] gh-149017: Upgrade bundled Expat to 2.8.0 (GH-149020) (#149099)
(cherry picked from commit 005555a3f0)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-05-14 16:00:07 +01:00
Miss Islington (bot)
a6ebca755c
[3.13] gh-148821: Add more tests for invalid XML encodings (GH-149820) (GH-149823)
(cherry picked from commit c6f7368157)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-14 10:34:45 +00:00