Commit graph

124557 commits

Author SHA1 Message Date
Miss Islington (bot)
b250035384
[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 f00512db20)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-06-06 15:57:52 +00:00
Miss Islington (bot)
f9c18bab7f
[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 899cca6dbf,
which broke buildbots.
(cherry picked from commit b477e21d5c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-06 16:09:09 +02:00
Miss Islington (bot)
705fa8a23f
[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 343182853f)

Co-authored-by: Jean-Louis GUENEGO <jlguenego@gmail.com>
2025-06-06 13:23:07 +00:00
Serhiy Storchaka
d864a9150b
[3.13] gh-135120: Add test.support.subTests() (GH-135121) (GH-135210)
(cherry picked from commit 6ef06fad84)
2025-06-06 13:16:50 +00:00
Miss Islington (bot)
793de28b40
[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 e004cf8fd5)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-06 12:36:50 +00:00
Steve Dower
728a881321
[3.13] gh-135151: Fix incorrect packaging of pyconfig.h in Windows installer (GH-135180) 2025-06-05 23:03:38 +01:00
Victor Stinner
922dc2ccb0
[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 9258f3da91)
2025-06-05 15:02:09 +00:00
Serhiy Storchaka
e2a9a3fa98
[3.13] gh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys=True (GH-132200) (GH-135061)
(cherry picked from commit ec12559eba)

Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
2025-06-05 14:38:11 +00:00
Miss Islington (bot)
5a69d4fe00
[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 3d396ab759)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-05 10:11:26 +00:00
Malcolm Smith
fd39aa3a7f
[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 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 17:23:46 +08:00
Miss Islington (bot)
68f8eed6ff
[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 0df15d0d4d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-06-04 15:50:21 +00:00
Victor Stinner
95f62969bb
[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 c21113072c)
2025-06-04 17:10:51 +02:00
Victor Stinner
659631f769
[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 e26bafd107)
2025-06-04 17:10:35 +02:00
Miss Islington (bot)
ae2e7958f2
[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 40c8be0008)

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>
2025-06-04 13:29:22 +00:00
Miss Islington (bot)
70c7aad306
[3.13] gh-135074: Fix exception messages in test.support module (GH-135076) (GH-135130)
(cherry picked from commit bc00ce941e)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
2025-06-04 13:22:02 +00:00
Miss Islington (bot)
9d5543ae70
[3.13] gh-135108: Fix utmp.h inclusion in posixmodule.c on NetBSD (GH-135109) (GH-135128)
(cherry picked from commit 5b3865418c)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-06-04 13:16:09 +00:00
Miss Islington (bot)
d446dbc68b
[3.13] gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775) (GH-134983)
(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-06-04 14:50:54 +02:00
Miss Islington (bot)
3a65f46353
[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 dba9de731b)

Co-authored-by: Joe Rickerby <joerick@mac.com>
2025-06-04 00:54:42 +00:00
Thomas Wouters
b9512c3b93 Merge branch '3.13' of https://github.com/python/cpython into 3.13 2025-06-03 22:22:54 +02:00
Thomas Wouters
c7ee596fd0 Post 3.13.4 2025-06-03 22:22:30 +02:00
Steve Dower
b679b74132
[3.13] Backport PyManager support to PC/layout script (GH-135096) 2025-06-03 21:21:11 +01:00
Sam Gross
b21d15fa95
[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 1ffe913c20)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-06-03 14:41:26 -04:00
Thomas Wouters
8a526ec7cb Python 3.13.4 2025-06-03 17:34:24 +02:00
T. Wouters
aa9eb5f757
[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 3612d8f517)

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>
2025-06-03 15:59:54 +02:00
Miss Islington (bot)
9f3d99967c
[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 899cca6dbf)

Co-authored-by: stratakis <cstratak@redhat.com>
2025-06-03 13:54:53 +00:00
Miss Islington (bot)
b0c9c192f1
[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 b525e31b7f)

Co-authored-by: Donghee Na <donghee.na@python.org>
2025-06-03 17:04:20 +09:00
Miss Islington (bot)
f67dede253
[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 7a79f52d83)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-02 20:49:32 +00:00
Miss Islington (bot)
7e2ebdbe9c
[3.13] gh-74232: Add a note about roundtrip of non-float numerics in CSV (GH-134963) (GH-135049)
(cherry picked from commit e814f43f2c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-02 20:39:01 +00:00
Serhiy Storchaka
3e1b8d6e67
[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 68784fed78)
2025-06-02 23:16:30 +03:00
Sam Gross
a9b8ffd9b9
[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 44fb7c361c)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-06-02 19:40:42 +00:00
Miss Islington (bot)
7ca17edd13
[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>
2025-06-02 16:58:29 +02:00
Bénédikt Tran
11f7270e8f
[3.13] gh-122153: indicate that Windows does not support socket.{send,recv}_fds (GH-134960) (#135017)
This amends commit e3b6ff19aa.
(cherry picked from commit 128195e12e)

Co-authored-by: GalaxySnail <me@glxys.nl>
2025-06-02 10:44:39 +00:00
Miss Islington (bot)
0446628697
[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 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:27:26 +00:00
Bénédikt Tran
2c325e28c3
[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 c6e63d9d35)
(cherry picked from commit 379d0bc956)
2025-06-01 10:27:02 +02:00
Miss Islington (bot)
e69ecfee5e
[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)

🫖
(cherry picked from commit 3704171415)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-31 17:54:38 +00:00
Miss Islington (bot)
379c4a2002
[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 f58873e4b2)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2025-05-31 14:51:48 +00:00
Miss Islington (bot)
366a7902a0
[3.13] gh-134918: Fix and improve doctest's documentation (GH-134919) (GH-134967)
(cherry picked from commit 3c66e59766)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-31 09:09:07 +00:00
Miss Islington (bot)
19b31d10c2
[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 a4251411a9)

Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
2025-05-30 13:24:22 -07:00
Steve Dower
5fd62beadf
gh-134923: Use /GENPROFILE and /USEPROFILE for Windows PGO builds (GH-134924) 2025-05-30 19:03:59 +00:00
Miss Islington (bot)
7c5a1ea9f6
[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 1a89991d23)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-30 19:30:26 +03:00
Serhiy Storchaka
681856c194
[3.13] gh-134718: Fix ast.dump() for empty non-default values (GH-134926) (GH-134936)
(cherry picked from commit cc344e8dd0)
2025-05-30 15:48:48 +00:00
Miss Islington (bot)
7fdc829bc2
Doc: remove unnecessary section header (GH-134917)
(cherry picked from commit b367e27af9)
2025-05-30 18:14:00 +09:00
Miss Islington (bot)
f4b8cd5510
[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 381020d41f)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-30 04:19:04 +00:00
Miss Islington (bot)
a9ba2ecae5
[3.13] gh-133260: Remove claim that PyUnicode_InternFromString immortalizes (GH-134213) (GH-134884)
(cherry picked from commit 4109a9c6b3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-05-29 13:44:00 +00:00
Miss Islington (bot)
aebb4eab45
[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 b783e1791b)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-29 13:22:33 +00:00
Miss Islington (bot)
029eceaf05
gh-134262: Add retries to downloads in PCbuild\get_external.py (GH-134820)
(cherry picked from commit e9d845b41d)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-28 21:45:01 +00:00
Miss Islington (bot)
dcfb22935f
[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 f6324bc7ee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-28 17:38:02 +00:00
Miss Islington (bot)
9cd608f999
[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 b265a7ddeb)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 16:36:59 +00:00
Miss Islington (bot)
07d4b6313f
[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 4635115c3f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-28 16:08:08 +00:00
Miss Islington (bot)
a0287bf574
[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 d83576bf48)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-28 15:46:40 +00:00