]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Miss Islington (bot) [Thu, 19 Jun 2025 10:04:48 +0000 (12:04 +0200)]
[3.13] gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (GH-135681) (#135705)
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
5c25c884b93eb79f640c47d6dba20f11fdf0ade4 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Thu, 19 Jun 2025 07:18:00 +0000 (09:18 +0200)]
[3.13] Document that PyType_GetModuleByDef returns a borrowed reference (GH-135666) (GH-135702)
(cherry picked from commit
140731ff671395fb7a869c2784429c14dc83fb27 )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Miss Islington (bot) [Wed, 18 Jun 2025 21:17:42 +0000 (23:17 +0200)]
gh-134538: Add link to shutil.rmtree example in function docs (GH-135540)
(cherry picked from commit
e9b647dd30d22cef465972d898a34c4b1bb6615d )
Co-authored-by: alexey semenyuk <alexsemenyuk88@gmail.com>
Miss Islington (bot) [Wed, 18 Jun 2025 18:47:59 +0000 (20:47 +0200)]
[3.13] gh-135641: Fix flaky `test_capi.test_lock_two_threads` test case (gh-135642) (gh-135688)
The mutex may have the `_Py_HAS_PARKED` bit set.
(cherry picked from commit
17ac3933c3c860e08f7963cf270116a39a063be7 )
Co-authored-by: Sam Gross <colesbury@gmail.com>
Miss Islington (bot) [Wed, 18 Jun 2025 17:44:43 +0000 (19:44 +0200)]
[3.13] Docs: Fix markups for emphasis (GH-135598) (GH-135686)
Docs: Fix markups for emphasis (GH-135598)
The word emphasis character `_` is not supported as sphinx markup, so changed to `*`.
(cherry picked from commit
46c60e0d0b716e8e6f0b74a0f9d0542605b1efd4 )
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Miss Islington (bot) [Wed, 18 Jun 2025 12:40:21 +0000 (14:40 +0200)]
[3.13] gh-135335: flush stdout/stderr in forkserver after preloading modules (GH-135338) (#135671)
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
9877d191f441741fc27ae5e7a6dd7ab6d4bcc6b7 )
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>
Miss Islington (bot) [Tue, 17 Jun 2025 05:47:27 +0000 (07:47 +0200)]
[3.13] gh-135489: Show verbose output for failing tests during PGO profiling step with `--enable-optimizations` (#135600)
Co-authored-by: PuQing <me@puqing.work>
Miss Islington (bot) [Mon, 16 Jun 2025 22:17:21 +0000 (00:17 +0200)]
[3.13] Use replacements to update versions in "Using Python on macOS" (GH-130400) (#135587)
(cherry picked from commit
21bac3aecd03805ea74ca67a3a291a9eb347588f )
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sam Gross [Mon, 16 Jun 2025 17:30:52 +0000 (13:30 -0400)]
[3.13] gh-132617: Fix `dict.update()` mutation check (gh-134815) (gh-135582)
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
d8994b0a77cc9821772d05db00a6ab23382fa17d )
Miss Islington (bot) [Mon, 16 Jun 2025 12:08:03 +0000 (14:08 +0200)]
[3.13] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) (GH-135343)
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
598aa7cc98bc1b39f10ec41decddd8dd88799fe1 )
Co-authored-by: Ajay Kamdar <140011370+ogbiggles@users.noreply.github.com>
Miss Islington (bot) [Sun, 15 Jun 2025 20:02:43 +0000 (22:02 +0200)]
[3.13] gh-67022: Document bytes/str inconsistency in email.header.decode_header() and suggest email.headerregistry.HeaderRegistry as a sane alternative (GH-92900) (#135549)
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
60181f4ed0e48ff35dc296da6b51473bfc553d16 )
Co-authored-by: Dan Lenski <dlenski@gmail.com>
Miss Islington (bot) [Sun, 15 Jun 2025 00:38:52 +0000 (02:38 +0200)]
[3.13] gh-135171: Update documentation for the generator expression (GH-135351) (GH-135525)
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
8979d3afe376c67931665070a79f6939ebcd940b )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
Miss Islington (bot) [Sat, 14 Jun 2025 16:49:13 +0000 (18:49 +0200)]
[3.13] gh-135497: fix `MAXLOGNAME` detection in `configure.ac` (GH-135508) (#135517)
gh-135497: fix `MAXLOGNAME` detection in `configure.ac` (GH-135508)
(cherry picked from commit
2e15a50851da66eb8227ec6ea07a9cc7ed08fbf3 )
Co-authored-by: Caleb Xu <calebcenter@live.com>
GiGaGon [Sat, 14 Jun 2025 08:00:14 +0000 (01:00 -0700)]
[3.13] gh-135496: Fix f string exclamation mark error typo (GH-135495) (#135501)
Mikhail Efimov [Fri, 13 Jun 2025 18:08:03 +0000 (21:08 +0300)]
[3.13] gh-125723: Fix crash with f_locals when generator frame outlive their generator (GH-135453)
Backport of
8e20e42cc63321dacc500d7670bfc225ca04e78b from GH-126956
Closes GH-125723
Tan Long [Fri, 13 Jun 2025 17:40:24 +0000 (01:40 +0800)]
[3.13] gh-133439: Fix dot commands with trailing spaces are mistaken for multi-line sqlite statements in the sqlite3 command-line interface (GH-133440) (GH-133765)
(cherry picked from commit
ebd4881db2e8448b238d8ca2f6fcf331826132dd )
Miss Islington (bot) [Fri, 13 Jun 2025 17:20:30 +0000 (19:20 +0200)]
[3.13] gh-135462: Fix quadratic complexity in processing special input in HTMLParser (GH-135464) (GH-135482)
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
6eb6c5dbfb528bd07d77b60fd71fd05d81d45c41 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Fri, 13 Jun 2025 16:53:52 +0000 (18:53 +0200)]
[3.13] doc: Remove what was essentially duplicate wording. (GH-135431) (GH-135441)
(cherry picked from commit
f273fd77d790300506c6443baa94d027b643f603 )
Miss Islington (bot) [Fri, 13 Jun 2025 15:50:53 +0000 (17:50 +0200)]
[3.13] gh-106318: Add example for `str.expandtabs()` (GH-134525) (#135477)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Miss Islington (bot) [Fri, 13 Jun 2025 15:28:02 +0000 (17:28 +0200)]
gh-135455: Fix version and architecture detection in PC/layout script. (GH-135461)
(cherry picked from commit
afc5ab6cce9d7095b99c1410a6762bc4a96504dd )
Co-authored-by: Steve Dower <steve.dower@python.org>
Miss Islington (bot) [Fri, 13 Jun 2025 12:13:59 +0000 (14:13 +0200)]
[3.13] gh-106318: Add example for `str.endswith()` (GH-134523) (#135460)
gh-106318: Add example for `str.endswith()` (GH-134523)
(cherry picked from commit
eed827ed091c6e55f11164046d287a76e30fbc0e )
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Miss Islington (bot) [Fri, 13 Jun 2025 11:46:14 +0000 (13:46 +0200)]
[3.13] gh-106318: Add example for `str.encode()` (GH-134520) (#135458)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Miss Islington (bot) [Thu, 12 Jun 2025 01:37:30 +0000 (03:37 +0200)]
[3.13] Fix presentation of dataclasses' `unsafe_hash` default value (GH-116532) (#135417)
Fix presentation of dataclasses' `unsafe_hash` default value (GH-116532)
(cherry picked from commit
71f5fafdfb2e509f59cd584d45949c6496f88d41 )
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Thomas Wouters [Wed, 11 Jun 2025 21:32:50 +0000 (23:32 +0200)]
Post 3.13.5
Thomas Wouters [Wed, 11 Jun 2025 15:36:41 +0000 (17:36 +0200)]
Python 3.13.5
Miss Islington (bot) [Wed, 11 Jun 2025 15:32:42 +0000 (17:32 +0200)]
[3.13] gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (GH-135337) (#135395)
gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (GH-135337)
(cherry picked from commit
b706ff003c536c5bca24dfdd3a8917bffcfa3df1 )
Co-authored-by: Malcolm Smith <smith@chaquo.com>
T. Wouters [Wed, 11 Jun 2025 14:57:35 +0000 (16:57 +0200)]
[3.13] GH-135171: Roll back all fixes for GH-127682 as they are not suitable for 3.13 (#135390)
Miss Islington (bot) [Wed, 11 Jun 2025 14:55:14 +0000 (16:55 +0200)]
[3.13] gh-132415: Update vendored setuptools in ``Lib/test/wheeldata`` (GH-132887) (#135391)
(cherry picked from commit
c9f3f5b4ed52d7bed6073ffa39717ece47202558 )
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Miss Islington (bot) [Wed, 11 Jun 2025 14:13:37 +0000 (16:13 +0200)]
[3.13] Docs: Add note to tutorial clarifying scope (GH-134534) (#134535)
Co-authored-by: Kattni <kattni@kattni.com>
Miss Islington (bot) [Wed, 11 Jun 2025 11:00:59 +0000 (13:00 +0200)]
[3.13] gh-135321: Always raise a correct exception for BINSTRING argument > 0x7fffffff in pickle (GH-135322) (GH-135383)
(cherry picked from commit
2b8b4774d29a707330d463f226630185cbd3ceff )
Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
stratakis [Wed, 11 Jun 2025 10:09:20 +0000 (12:09 +0200)]
[3.13] gh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606) (#135353)
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
Miss Islington (bot) [Wed, 11 Jun 2025 09:43:38 +0000 (11:43 +0200)]
[3.13] gh-133967: Do not normalize locale name 'C.UTF-8' to 'en_US.UTF-8' (GH-135347) (GH-135350)
(cherry picked from commit
0f866cbfefd797b4dae25962457c5579bb90dde5 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Serhiy Storchaka [Tue, 10 Jun 2025 10:41:10 +0000 (13:41 +0300)]
[3.13] gh-135326: Restore support of __index__ in random.getrandbits() (#135332)
Bénédikt Tran [Tue, 10 Jun 2025 09:12:41 +0000 (11:12 +0200)]
[3.13] gh-133157: fix UBSan failures in `Parser/pegen.c` (GH-134048) (#135334)
[3.13] gh-133157: fix UBSan failures in `Parser/pegen.c` (GH-134048)
(cherry picked from commit
754e7c9b5187fcad22acf7555479603f173a4a09 )
Miss Islington (bot) [Mon, 9 Jun 2025 21:09:37 +0000 (23:09 +0200)]
[3.13] Heavily comment Python/perf_jit_trampoline.c to improve maintainability (GH-134527) (#135300)
Miss Islington (bot) [Mon, 9 Jun 2025 06:41:03 +0000 (08:41 +0200)]
[3.13] Use f-strings in csv docs example (GH-135245) (#135286)
Use f-strings in csv docs example (GH-135245)
(cherry picked from commit
2677dd017a033eaaad3b8e1e0eb5664a44e7e231 )
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Miss Islington (bot) [Sun, 8 Jun 2025 21:56:35 +0000 (23:56 +0200)]
[3.13] gh-135276: Refresh `zipfile.Path` from zipp 3.23 (GH-135277) (#135279)
* gh-135276: Refresh `zipfile.Path` from zipp 3.23 (GH-135277)
Apply changes from zipp 3.23
(cherry picked from commit
8d6eb0c26276c4013346622580072908d46d2341 )
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>
Miss Islington (bot) [Sun, 8 Jun 2025 21:55:12 +0000 (23:55 +0200)]
[3.13] gh-135263: Fix typo in token.NAME documentation (GH-135275) (#135281)
gh-135263: Fix typo in token.NAME documentation (GH-135275)
(cherry picked from commit
8d17a412da7e7d8412efc625d48dcb5eecea50b0 )
Co-authored-by: Vladyslav Lazoryk <80263725+lazorikv@users.noreply.github.com>
Miss Islington (bot) [Sun, 8 Jun 2025 17:13:34 +0000 (19:13 +0200)]
[3.13] Update tutorial for new "Copy" button (GH-135007) (#135271)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Miss Islington (bot) [Sun, 8 Jun 2025 12:37:55 +0000 (14:37 +0200)]
[3.13] gh-134976: document the exception type that can be raised by `s[i]` (GH-134977) (#135259)
gh-134976: document the exception type that can be raised by `s[i]` (GH-134977)
(cherry picked from commit
158e5162bfaa8a49178ce2c3f2455c3e03b60157 )
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
Miss Islington (bot) [Sun, 8 Jun 2025 07:38:00 +0000 (09:38 +0200)]
[3.13] gh-134151 Fix `TypeError` in `email.utils.decode_params` when sorting RFC 2231 continuations (GH-134687) (#135248)
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
bcb6b45cb86a2f9f65b6c41f27c36059ba86a50b )
Co-authored-by: Jiucheng(Oliver) <git.jiucheng@gmail.com>
Miss Islington (bot) [Sat, 7 Jun 2025 09:03:32 +0000 (11:03 +0200)]
[3.13] gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174) (GH-135214)
gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174)
(cherry picked from commit
1adca08d658ee2d520f3193960eaf3ae2ead1cef )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Miss Islington (bot) [Fri, 6 Jun 2025 18:11:15 +0000 (20:11 +0200)]
[3.13] gh-134155: fix AttributeError in email._header_value_parser.get_address (GH-134194) (#135192)
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
d9cad074d52fe31327429fd81e4d2eeea3dbe35b )
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>
Miss Islington (bot) [Fri, 6 Jun 2025 15:57:52 +0000 (17:57 +0200)]
[3.13] Docs: Update `PyExc_*` tables in the c-api documentation (GH-131640) (GH-135221)
Docs: Update `PyExc_*` tables in the c-api documentation (GH-131640)
Add `PyExc_BaseExceptionGroup` and `PyExc_EncodingWarning`
(cherry picked from commit
f00512db20561370faad437853f6ecee0eec4856 )
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Miss Islington (bot) [Fri, 6 Jun 2025 14:09:09 +0000 (16:09 +0200)]
[3.13] gh-128605: Revert "Add branch protections for x86_64 in asm_tr…ampoline.S (GH-128606) (GH-135077)" (GH-135175) (GH-135203)
[3.14] gh-128605: Revert "Add branch protections for x86_64 in asm_tr…ampoline.S (GH-128606) (GH-135077)" (GH-135175)
This reverts commit
899cca6dbf76bf3e06a99f60a5f996ad6ba0761f ,
which broke buildbots.
(cherry picked from commit
b477e21d5cb85bc764d6d9d18d122aa703d7b548 )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Miss Islington (bot) [Fri, 6 Jun 2025 13:23:07 +0000 (15:23 +0200)]
[3.13] feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181) (#135211)
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
343182853f19a42c0ba8980d3104076a8c7bcfe7 )
Co-authored-by: Jean-Louis GUENEGO <jlguenego@gmail.com>
Serhiy Storchaka [Fri, 6 Jun 2025 13:16:50 +0000 (16:16 +0300)]
[3.13] gh-135120: Add test.support.subTests() (GH-135121) (GH-135210)
(cherry picked from commit
6ef06fad84244261c695ec337c7d2734277054db )
Miss Islington (bot) [Fri, 6 Jun 2025 12:36:50 +0000 (14:36 +0200)]
[3.13] gh-134993: Add os.lstat() to os.supports_dir_fd (GH-135188) (#135206)
gh-134993: Add os.lstat() to os.supports_dir_fd (GH-135188)
(cherry picked from commit
e004cf8fd5c006a7a1c60807a03066f4c43452e5 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Steve Dower [Thu, 5 Jun 2025 22:03:38 +0000 (23:03 +0100)]
[3.13] gh-135151: Fix incorrect packaging of pyconfig.h in Windows installer (GH-135180)
Victor Stinner [Thu, 5 Jun 2025 15:02:09 +0000 (17:02 +0200)]
[3.13] gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) (#135182)
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
9258f3da9175134d03f2c8c7c7eed223802ad945 )
Serhiy Storchaka [Thu, 5 Jun 2025 14:38:11 +0000 (17:38 +0300)]
[3.13] gh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys=True (GH-132200) (GH-135061)
(cherry picked from commit
ec12559ebafca01ded22c9013de64abe535c838d )
Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
Miss Islington (bot) [Thu, 5 Jun 2025 10:11:26 +0000 (12:11 +0200)]
[3.13] gh-135124: Change stdout errors in regrtest worker process (GH-135138) (#135169)
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
3d396ab7591d544ac8bc1fb49615b4e867ca1c83 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Malcolm Smith [Thu, 5 Jun 2025 09:23:46 +0000 (10:23 +0100)]
[3.13] gh-131531: android.py enhancements to support cibuildwheel (GH-132870) (#135164)
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
2e1544fd2b0cd46ba93fc51e3cdd47f4781d7499 )
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>
Miss Islington (bot) [Wed, 4 Jun 2025 15:50:21 +0000 (17:50 +0200)]
[3.13] gh-129876: Update IDLE News3.txt to May 2025 (GH-135139) (#135141)
gh-129876: Update IDLE News3.txt to May 2025 (GH-135139)
(cherry picked from commit
0df15d0d4d55dcf7b7a7f4b2985bf84fd092d257 )
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Victor Stinner [Wed, 4 Jun 2025 15:10:51 +0000 (17:10 +0200)]
[3.13] gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021) (#135134)
gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021)
(cherry picked from commit
c21113072cd1f0da83729f99d3576647db85d816 )
Victor Stinner [Wed, 4 Jun 2025 15:10:35 +0000 (17:10 +0200)]
[3.13] gh-133256: Add _Py_NONSTRING macro (#133257) (#135135)
gh-133256: Add _Py_NONSTRING macro (#133257)
Fix GCC 15 compiler warnings such as:
In file included from Python/pylifecycle.c:26:
Include/internal/pycore_runtime.h:47:26: warning:
initializer-string for array of 'char' truncates NUL terminator
but destination lacks 'nonstring' attribute (9 chars into 8
available) [-Wunterminated-string-initialization]
47 | #define _Py_Debug_Cookie "xdebugpy"
| ^~~~~~~~~~
(cherry picked from commit
e26bafd107aa86a4bdd6051848640f36a56d0efb )
Miss Islington (bot) [Wed, 4 Jun 2025 13:29:22 +0000 (15:29 +0200)]
[3.13] gh-126483: disable warnings filters mutation in concurrent test (GH-132694) (GH-135132)
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()`.
Disable the warnings check in the multi-threaded test because `warnings_helper` isn't
thread-safe in 3.13 or earlier.
(cherry picked from commit
40c8be0008ecadb5d0dc9a017434b1133a3a6e06 )
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* Fix for 3.13
---------
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
Miss Islington (bot) [Wed, 4 Jun 2025 13:22:02 +0000 (15:22 +0200)]
[3.13] gh-135074: Fix exception messages in test.support module (GH-135076) (GH-135130)
(cherry picked from commit
bc00ce941e03347dade3faa8822f19836b5bbfe4 )
Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
Miss Islington (bot) [Wed, 4 Jun 2025 13:16:09 +0000 (15:16 +0200)]
[3.13] gh-135108: Fix utmp.h inclusion in posixmodule.c on NetBSD (GH-135109) (GH-135128)
(cherry picked from commit
5b3865418ceb1448bfbf15cddf52c900cd5882a3 )
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Miss Islington (bot) [Wed, 4 Jun 2025 12:50:54 +0000 (14:50 +0200)]
[3.13] gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775) (GH-134983)
(cherry picked from commit
eb145fabbdd755f803296beba2d235fc32efe592 )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Miss Islington (bot) [Wed, 4 Jun 2025 00:54:42 +0000 (02:54 +0200)]
[3.13] gh-135101: When choosing the default simulator device, don't use `simctl --set testing` (GH-135102) (#135114)
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
dba9de731b231ca0c079205f496d1e3d178b4fd3 )
Co-authored-by: Joe Rickerby <joerick@mac.com>
Thomas Wouters [Tue, 3 Jun 2025 20:22:54 +0000 (22:22 +0200)]
Merge branch '3.13' of https://github.com/python/cpython into 3.13
Thomas Wouters [Tue, 3 Jun 2025 20:22:30 +0000 (22:22 +0200)]
Post 3.13.4
Steve Dower [Tue, 3 Jun 2025 20:21:11 +0000 (21:21 +0100)]
[3.13] Backport PyManager support to PC/layout script (GH-135096)
Sam Gross [Tue, 3 Jun 2025 18:41:26 +0000 (14:41 -0400)]
[3.13] gh-127081: use `getlogin_r` if available (gh-132751) (#135098)
The `getlogin` function is not thread-safe: replace with `getlogin_r` where
available.
(cherry picked from commit
1ffe913c2017b44804aca18befd45689df06c069 )
Co-authored-by: Duane Griffin <duaneg@dghda.com>
Thomas Wouters [Tue, 3 Jun 2025 15:34:08 +0000 (17:34 +0200)]
Python 3.13.4
T. Wouters [Tue, 3 Jun 2025 13:59:54 +0000 (15:59 +0200)]
[3.13] gh-135034: Normalize link targets in tarfile, add `os.path.realpath(strict='allow_missing')` (GH-135037) (GH-135064)
Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.
(cherry picked from commit
3612d8f51741b11f36f8fb0494d79086bac9390a )
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
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>
Miss Islington (bot) [Tue, 3 Jun 2025 13:54:53 +0000 (15:54 +0200)]
[3.13] gh-128605: Add branch protections for x86_64 in asm_trampoline.S (GH-128606) (GH-135077) (#135083)
[3.14] gh-128605: Add branch protections for x86_64 in asm_trampoline.S (GH-128606) (GH-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
(cherry picked from commit
899cca6dbf76bf3e06a99f60a5f996ad6ba0761f )
Co-authored-by: stratakis <cstratak@redhat.com>
Miss Islington (bot) [Tue, 3 Jun 2025 08:04:20 +0000 (10:04 +0200)]
[3.13] gh-134875: Fix mimallc build error for the old compilers (gh-134994) (gh-135054)
gh-134875: Fix mimallc build error for the old compilers (gh-134994)
(cherry picked from commit
b525e31b7fc50e7a498f8b9b16437cb7b9656f6f )
Co-authored-by: Donghee Na <donghee.na@python.org>
Miss Islington (bot) [Mon, 2 Jun 2025 20:49:32 +0000 (22:49 +0200)]
[3.13] gh-133454: Mark test_queue tests with many threads as bigmem (gh-134575) (GH-135047)
50 producer and 50 consumer threads need more than 5GB of memory.
(cherry picked from commit
7a79f52d83c22f5a9787e590f267325c1175d389 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Mon, 2 Jun 2025 20:39:01 +0000 (22:39 +0200)]
[3.13] gh-74232: Add a note about roundtrip of non-float numerics in CSV (GH-134963) (GH-135049)
(cherry picked from commit
e814f43f2c655b931af8ee9e1c128bd1027549fb )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Serhiy Storchaka [Mon, 2 Jun 2025 20:16:30 +0000 (23:16 +0300)]
[3.13] gh-133489: Remove size restrictions on getrandbits() and randbytes() (GH-133658) (GH-134965)
random.getrandbits() can now generate more that 2**31 bits.
random.randbytes() can now generate more that 256 MiB.
(cherry picked from commit
68784fed78aa297f0de0d038742495709185bef5 )
Sam Gross [Mon, 2 Jun 2025 19:40:42 +0000 (15:40 -0400)]
[3.13] gh-134908: Protect `textiowrapper_iternext` with critical section (gh-134910) (gh-135040)
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
44fb7c361cb24dcf9989a7a1cfee4f6aad5c81aa )
Co-authored-by: Duane Griffin <duaneg@dghda.com>
Miss Islington (bot) [Mon, 2 Jun 2025 14:58:29 +0000 (16:58 +0200)]
[3.13] gh-130999: Avoid exiting the new REPL when there are non-string candidates for suggestions (gh-131001) (gh-135020)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Bénédikt Tran [Mon, 2 Jun 2025 10:44:39 +0000 (12:44 +0200)]
[3.13] gh-122153: indicate that Windows does not support `socket.{send,recv}_fds` (GH-134960) (#135017)
This amends commit
e3b6ff19aaa318a813130ba9ad2ab0a332f27feb .
(cherry picked from commit
128195e12eb6d5b9542558453df7045dd7aa1e15 )
Co-authored-by: GalaxySnail <me@glxys.nl>
Miss Islington (bot) [Sun, 1 Jun 2025 08:27:26 +0000 (10:27 +0200)]
[3.13] gh-133503: clarify `compileall -s/-p` docs (GH-134756) (#134996)
gh-133503: clarify `compileall -s/-p` docs (GH-134756)
(cherry picked from commit
fe6f8a3619242b287a793a5b5d8645f402482c71 )
Co-authored-by: Rihaan Meher <meherrihaan@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Bénédikt Tran [Sun, 1 Jun 2025 08:27:02 +0000 (10:27 +0200)]
[3.13] gh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures (GH-134713) (#134962)
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
c6e63d9d351f6d952000ec3bf84b3a7607989f92 )
(cherry picked from commit
379d0bc95646dfe923e7ea05fb7f1befbd85572d )
Miss Islington (bot) [Sat, 31 May 2025 17:54:38 +0000 (19:54 +0200)]
[3.13] gh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844) (#134985)
gh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844)
:teapot:
(cherry picked from commit
3704171415c1ea6ebbeb2f992758b6565f42e378 )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Sat, 31 May 2025 14:51:48 +0000 (16:51 +0200)]
[3.13] gh-134954: Hard-cap max file descriptors in subprocess test fd_status (GH-134955) (#134981)
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
f58873e4b2b7aad8e3a08a6188c6eb08d0a3001b )
Co-authored-by: Itamar Oren <itamarost@gmail.com>
Miss Islington (bot) [Sat, 31 May 2025 09:09:07 +0000 (11:09 +0200)]
[3.13] gh-134918: Fix and improve doctest's documentation (GH-134919) (GH-134967)
(cherry picked from commit
3c66e5976669a599adfb260514c03815b1a9e4e9 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Fri, 30 May 2025 20:24:22 +0000 (22:24 +0200)]
[3.13] GH-106235: Clarify `parse_known_args` documentation by removing "remaining" (GH-126921) (#134914)
GH-106235: Clarify `parse_known_args` documentation by removing "remaining" (GH-126921)
(cherry picked from commit
a4251411a97304ab001721c6231d86ddf4eac3f0 )
Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
Steve Dower [Fri, 30 May 2025 19:03:59 +0000 (20:03 +0100)]
gh-134923: Use /GENPROFILE and /USEPROFILE for Windows PGO builds (GH-134924)
Miss Islington (bot) [Fri, 30 May 2025 16:30:26 +0000 (18:30 +0200)]
[3.13] gh-134733: Fix documentation for the show_empty option of ast.dump() (GH-134925) (GH-134941)
Optional None values are always omitted.
(cherry picked from commit
1a89991d2362867a9127e151376135615bc92a4c )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Serhiy Storchaka [Fri, 30 May 2025 15:48:48 +0000 (18:48 +0300)]
[3.13] gh-134718: Fix ast.dump() for empty non-default values (GH-134926) (GH-134936)
(cherry picked from commit
cc344e8dd0a6fdc83a032c229f9b3cf53f76a887 )
Miss Islington (bot) [Fri, 30 May 2025 09:14:00 +0000 (11:14 +0200)]
Doc: remove unnecessary section header (GH-134917)
(cherry picked from commit
b367e27af9b52528e395f95b277ec7b69e98e287 )
Miss Islington (bot) [Fri, 30 May 2025 04:19:04 +0000 (06:19 +0200)]
[3.13] ast docs: Fix description of ast.Constant (GH-134741) (#134912)
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
381020d41fb1f8b33421f01c609ba0d0edb99764 )
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Miss Islington (bot) [Thu, 29 May 2025 13:44:00 +0000 (15:44 +0200)]
[3.13] gh-133260: Remove claim that PyUnicode_InternFromString immortalizes (GH-134213) (GH-134884)
(cherry picked from commit
4109a9c6b33faa0032ffc95d96cd0db482af3ce2 )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Miss Islington (bot) [Thu, 29 May 2025 13:22:33 +0000 (15:22 +0200)]
[3.13] gh-69011: : clarify & deduplicate `ctypes.create_*_buffer` docs (GH-132858) (GH-134882)
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
b783e1791b2076ef560104f8207156d75859c0a6 )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Wed, 28 May 2025 21:45:01 +0000 (23:45 +0200)]
gh-134262: Add retries to downloads in PCbuild\get_external.py (GH-134820)
(cherry picked from commit
e9d845b41dca9ad84b76ef777d05e647a4b4d8cd )
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Miss Islington (bot) [Wed, 28 May 2025 17:38:02 +0000 (19:38 +0200)]
[3.13] gh-108885: Imporove tests for doctest (GH-134832) (GH-134856)
Test the error and failure report in more detail.
(cherry picked from commit
f6324bc7eedc615c3c961fe368a8c56697d42936 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Wed, 28 May 2025 16:36:59 +0000 (18:36 +0200)]
[3.13] GH-134848: Use a set to store ``AuditEvents.sources`` (GH-134849) (#134854)
GH-134848: Use a set to store ``AuditEvents.sources`` (GH-134849)
(cherry picked from commit
b265a7ddeb12b2040d80b471d447ce4c3ff4bb95 )
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Miss Islington (bot) [Wed, 28 May 2025 16:08:08 +0000 (18:08 +0200)]
[3.13] gh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (GH-134841) (#134852)
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
4635115c3f1495fa20e553937df37861fffa7054 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Wed, 28 May 2025 15:46:40 +0000 (17:46 +0200)]
[3.13] gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (GH-134836) (#134846)
gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (GH-134836)
(cherry picked from commit
d83576bf48d07d5e29d5d171c4e25afb048622aa )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Wed, 28 May 2025 15:44:03 +0000 (17:44 +0200)]
[3.13] gh-133711: Fix test_regrtest for PYTHONUTF8=1 (GH-134839) (#134843)
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
91618278e7cd1ffc222efa03bb5334bd5a13dc5b )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Wed, 28 May 2025 12:32:57 +0000 (14:32 +0200)]
[3.13] gh-134817: Document [Timed]RotatingFileHandler shouldRollover method (GH-134818) (GH-134824)
(cherry picked from commit
7be5916f6dc3db95744b5fec945327d82cce0183 )
Miss Islington (bot) [Wed, 28 May 2025 10:54:53 +0000 (12:54 +0200)]
[3.13] gh-134744: Fix fcntl error handling (GH-134748) (GH-134795) (#134798)
[3.14] gh-134744: Fix fcntl error handling (GH-134748) (GH-134795)
gh-134744: Fix fcntl error handling (GH-134748)
Fix also reference leak on buffer overflow.
(cherry picked from commit
8a6a6f39c869a6601babc31592e156ce22478a47 )
(cherry picked from commit
9300a596d37d058e6e58d00a2ad70617c863a3de )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Wed, 28 May 2025 07:59:20 +0000 (09:59 +0200)]
[3.13] gh-134160: Block multiple module initialization (GH-134773) (#134828)
gh-134160: Block multiple module initialization (GH-134773)
(cherry picked from commit
469a56470b1d8df03862d8ceb73aebca14772dcf )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Miss Islington (bot) [Wed, 28 May 2025 07:36:24 +0000 (09:36 +0200)]
[3.13] Update outdated statement from `math` about C standard (GH-134621) (#134826)
Update outdated statement from `math` about C standard (GH-134621)
(cherry picked from commit
21672b694bd1786bad6eb71a9eff89291a91554b )
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Miss Islington (bot) [Tue, 27 May 2025 18:54:16 +0000 (20:54 +0200)]
[3.13] gh-134789: Document del s[i] operation for mutable sequences (GH-134804) (#134809)
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
967f361993c9c97eb3ff3076a409b78ea32938df )
Co-authored-by: Rishabh Singh <67859818+rishabh11336@users.noreply.github.com>
Mark Shannon [Tue, 27 May 2025 17:14:56 +0000 (18:14 +0100)]
[3.13] GH-128161: Fix refleak introduced in GH-134788 (GH-134799)