Commit graph

127238 commits

Author SHA1 Message Date
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