]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 months agogh-135001: Explicitly specify the encoding parameter value of `calendar.HTMLCalendar...
Wulian233 [Mon, 9 Jun 2025 13:40:09 +0000 (21:40 +0800)] 
gh-135001: Explicitly specify the encoding parameter value of `calendar.HTMLCalendar` as 'utf-8' (#135002)

5 months agogh-133968: Update PyUnicodeWriter_WriteASCII() documentation (#135297)
Victor Stinner [Mon, 9 Jun 2025 12:47:02 +0000 (14:47 +0200)] 
gh-133968: Update PyUnicodeWriter_WriteASCII() documentation (#135297)

The function was added to Python 3.14.

5 months agoGH-135287: clang-cl PGO builds on Windows fail with `could not open '/GENPROFILE...
Chris Eibl [Mon, 9 Jun 2025 11:52:38 +0000 (13:52 +0200)] 
GH-135287: clang-cl PGO builds on Windows fail with `could not open '/GENPROFILE'` (GH-135289)

5 months agogh-131798: Optimize `_UNARY_INVERT` (GH-135222)
Noam Cohen [Mon, 9 Jun 2025 10:33:18 +0000 (13:33 +0300)] 
gh-131798: Optimize `_UNARY_INVERT` (GH-135222)

5 months agogh-131316: fix invalid `DECREF` in `_md5.md5.copy()` (#135291)
Bénédikt Tran [Mon, 9 Jun 2025 09:10:32 +0000 (11:10 +0200)] 
gh-131316: fix invalid `DECREF` in `_md5.md5.copy()` (#135291)

This amends commit 261633bd3f48607478f50d12d8025cd4bb36f6f4.

5 months agobpo-45210: Document that error indicator may be set in tp_dealloc (#28358)
Edward Z. Yang [Mon, 9 Jun 2025 08:56:32 +0000 (04:56 -0400)] 
bpo-45210: Document that error indicator may be set in tp_dealloc (#28358)

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
5 months agogh-135004: rewrite and cleanup `blake2module.c` (#135006)
Bénédikt Tran [Mon, 9 Jun 2025 07:17:43 +0000 (09:17 +0200)] 
gh-135004: rewrite and cleanup `blake2module.c` (#135006)

* Cleanup imports and update module docstring.
* Simplify detection of SIMD support.
* Correctly guard `update()` cases.
* Rewrite `py_blake2b_or_s_new` and rename it to `py_blake2_new`.
* Rewrite `blake2_blake2b_copy_locked` and `py_blake2_clear`.
* Refactor computations of `digest` and `hexdigest`.
* Simplify `py_blake2b_get_name` and `py_blake2b_get_block_size`.
* Add `hacl_get_blake2_info` to extract static BLAKE-2 information.
   This new helper is used by `py_blake2b_get_digest_size`, but can
   be later used to expose `key_length` more easily.

5 months agogh-135234: improve `_hashlib` exceptions when reporting an OpenSSL function failure...
Bénédikt Tran [Mon, 9 Jun 2025 07:13:29 +0000 (09:13 +0200)] 
gh-135234: improve `_hashlib` exceptions when reporting an OpenSSL function failure (#135250)

- Refactor `get_openssl_evp_md_by_utf8name` error branches.
- Refactor `HASH.{digest,hexdigest}` computations.
- Refactor `_hashlib_HASH_copy_locked` and `locked_HMAC_CTX_copy`.

5 months agoUse f-strings in csv docs example (#135245)
Ezio Melotti [Sun, 8 Jun 2025 22:28:37 +0000 (00:28 +0200)] 
Use f-strings in csv docs example (#135245)

5 months agogh-135263: Fix typo in token.NAME documentation (#135275)
Vladyslav Lazoryk [Sun, 8 Jun 2025 19:59:26 +0000 (22:59 +0300)] 
gh-135263: Fix typo in token.NAME documentation (#135275)

5 months agogh-135276: Refresh `zipfile.Path` from zipp 3.23 (#135277)
Jason R. Coombs [Sun, 8 Jun 2025 19:20:20 +0000 (15:20 -0400)] 
gh-135276: Refresh `zipfile.Path` from zipp 3.23 (#135277)

Apply changes from zipp 3.23

5 months agoAdd compile_commands.json to .gitignore (#135111)
Alper [Sun, 8 Jun 2025 16:55:12 +0000 (09:55 -0700)] 
Add compile_commands.json to .gitignore (#135111)

5 months agoUpdate tutorial for new "Copy" button (#135007)
Stan Ulbrych [Sun, 8 Jun 2025 16:33:19 +0000 (17:33 +0100)] 
Update tutorial for new "Copy" button (#135007)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
5 months agogh-134531: refactor `_hashlib` logic for handling NIDs and EVP_MDs (#135254)
Bénédikt Tran [Sun, 8 Jun 2025 12:34:57 +0000 (14:34 +0200)] 
gh-134531: refactor `_hashlib` logic for handling NIDs and EVP_MDs (#135254)

5 months agogh-134976: document the exception type that can be raised by `s[i]` (#134977)
Yongzi Li [Sun, 8 Jun 2025 12:28:55 +0000 (20:28 +0800)] 
gh-134976: document the exception type that can be raised by `s[i]` (#134977)

5 months agogh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (...
LamentXU [Sun, 8 Jun 2025 11:46:16 +0000 (19:46 +0800)] 
gh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (#135226)

This aligns with the recommendations of RFC 9562, Section 6.10, paragraph 3 [1].

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-6.10-3.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-134531: fix `_hashlib` clinic directive post GH-134626 (#135249)
Bénédikt Tran [Sun, 8 Jun 2025 07:43:32 +0000 (09:43 +0200)] 
gh-134531: fix `_hashlib` clinic directive post GH-134626 (#135249)

5 months agogh-134151 Fix `TypeError` in `email.utils.decode_params` when sorting RFC 2231 contin...
Jiucheng(Oliver) [Sun, 8 Jun 2025 07:13:21 +0000 (03:13 -0400)] 
gh-134151 Fix `TypeError` in `email.utils.decode_params` when sorting RFC 2231 continuations (#134687)

- Fix sorting logic in `email.utils.decode_params` to handle None values.
- Update tests for RFC 2231 continuation sorting.

5 months agogh-133579: correctly report C curses errors in `_curses_panel` (#134629)
Bénédikt Tran [Sun, 8 Jun 2025 07:10:52 +0000 (09:10 +0200)] 
gh-133579: correctly report C curses errors in `_curses_panel` (#134629)

This is a follow-up to ee36db550076e5a9185444ffbc53eaf8157ef04c.

5 months agoGH-131798: Type-propagate string/list/tuple slices (GH-134671)
Amit Lavon [Sat, 7 Jun 2025 21:08:44 +0000 (14:08 -0700)] 
GH-131798: Type-propagate string/list/tuple slices (GH-134671)

5 months agogh-134876: Add fallback for when process_vm_readv fails with ENOSYS (#134878)
Daniel Golding [Sat, 7 Jun 2025 18:32:06 +0000 (20:32 +0200)] 
gh-134876: Add fallback for when process_vm_readv fails with ENOSYS (#134878)

5 months agoRevert "gh-133390: Support SQL keyword completion for sqlite3 CLI (#133393)" temporar...
Petr Viktorin [Sat, 7 Jun 2025 08:56:43 +0000 (10:56 +0200)] 
Revert "gh-133390: Support SQL keyword completion for sqlite3 CLI (#133393)" temporarily (GH-135232)

This reverts commit 62b3d2d443785c4ea5262edb4f9f7040440f9463,
which broke buildbots

5 months agoGH-131798: Optimize away type(x) in the JIT when the result is known (GH-135194)
Tomas R. [Fri, 6 Jun 2025 23:44:43 +0000 (01:44 +0200)] 
GH-131798: Optimize away type(x) in the JIT when the result is known (GH-135194)

5 months agoDocs: Update `PyExc_*` tables in the c-api documentation (GH-131640)
Yuki Kobayashi [Fri, 6 Jun 2025 15:51:47 +0000 (00:51 +0900)] 
Docs: Update `PyExc_*` tables in the c-api documentation (GH-131640)

Add `PyExc_BaseExceptionGroup` and `PyExc_EncodingWarning`

5 months agogh-133390: Support SQL keyword completion for sqlite3 CLI (#133393)
Tan Long [Fri, 6 Jun 2025 14:52:41 +0000 (22:52 +0800)] 
gh-133390: Support SQL keyword completion for sqlite3 CLI (#133393)

5 months agogh-57089: Note _layout_ in the bitfield docs (GH-134148)
Petr Viktorin [Fri, 6 Jun 2025 14:51:40 +0000 (16:51 +0200)] 
gh-57089: Note _layout_ in the bitfield docs (GH-134148)

Co-authored-by: Meador Inge <meadori@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
5 months agogh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174)
Petr Viktorin [Fri, 6 Jun 2025 14:08:58 +0000 (16:08 +0200)] 
gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
5 months agogh-134891: Add PyUnstable_Unicode_GET_CACHED_HASH (GH-134892)
Petr Viktorin [Fri, 6 Jun 2025 13:51:00 +0000 (15:51 +0200)] 
gh-134891: Add PyUnstable_Unicode_GET_CACHED_HASH (GH-134892)

5 months agofeat(docs): type fix - apply pep8 by using docstring instead of comment in the doc...
Jean-Louis GUENEGO [Fri, 6 Jun 2025 13:16:12 +0000 (15:16 +0200)] 
feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (#135181)

Giving the right example incitates the tutorial readers to do the same in the future.

5 months agoFix versionadded directive rendering in c-api/arg.rst (#135199)
Rafael Fontenelle [Fri, 6 Jun 2025 12:23:07 +0000 (09:23 -0300)] 
Fix versionadded directive rendering in c-api/arg.rst (#135199)

5 months agogh-134036: Update test_syntax for gh-133999 (#135204)
Victor Stinner [Fri, 6 Jun 2025 12:22:14 +0000 (14:22 +0200)] 
gh-134036: Update test_syntax for gh-133999 (#135204)

5 months agogh-134993: Add os.lstat() to os.supports_dir_fd (#135188)
Victor Stinner [Fri, 6 Jun 2025 12:11:49 +0000 (14:11 +0200)] 
gh-134993: Add os.lstat() to os.supports_dir_fd (#135188)

5 months agogh-135120: Add test.support.subTests() (GH-135121)
Serhiy Storchaka [Fri, 6 Jun 2025 11:52:48 +0000 (14:52 +0300)] 
gh-135120: Add test.support.subTests() (GH-135121)

5 months agogh-134036: Improve error messages for invalid `raise` statements (#134077)
sobolevn [Fri, 6 Jun 2025 00:51:06 +0000 (03:51 +0300)] 
gh-134036: Improve error messages for invalid `raise` statements (#134077)

5 months agogh-135155: Added dependencies required for compiling the _zstd module (GH-135156)
Weipeng Hong [Fri, 6 Jun 2025 00:44:25 +0000 (08:44 +0800)] 
gh-135155: Added dependencies required for compiling the _zstd module (GH-135156)

5 months agoGH-132554: Fix tier2 `FOR_ITER` implementation and optimizations (GH-135137)
Mark Shannon [Thu, 5 Jun 2025 17:53:57 +0000 (18:53 +0100)] 
GH-132554:  Fix tier2 `FOR_ITER` implementation and optimizations (GH-135137)

5 months agogh-134155: fix AttributeError in email._header_value_parser.get_address (#134194)
Sergey Miryanov [Thu, 5 Jun 2025 17:28:11 +0000 (10:28 -0700)] 
gh-134155: fix AttributeError in email._header_value_parser.get_address (#134194)

Append the defect to defects instead of to the parse tree.

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>
5 months agogh-135166: Fix exception type expected by test.test_zstd (GH-135167)
Weipeng Hong [Thu, 5 Jun 2025 16:00:07 +0000 (00:00 +0800)] 
gh-135166: Fix exception type expected by test.test_zstd (GH-135167)

5 months agogh-135161: Remove redundant NULL check for 'exc' after dereference in ceval.c (#135162)
rialbat [Thu, 5 Jun 2025 15:08:48 +0000 (18:08 +0300)] 
gh-135161: Remove redundant NULL check for 'exc' after dereference in ceval.c (#135162)

5 months agogh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165)
Victor Stinner [Thu, 5 Jun 2025 12:43:47 +0000 (14:43 +0200)] 
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.

5 months agogh-134938: Add set_pledged_input_size() to ZstdCompressor (GH-135010)
Emma Smith [Thu, 5 Jun 2025 11:31:49 +0000 (04:31 -0700)] 
gh-134938: Add set_pledged_input_size() to ZstdCompressor (GH-135010)

5 months agogh-135124: Change stdout errors in regrtest worker process (#135138)
Victor Stinner [Thu, 5 Jun 2025 09:17:03 +0000 (11:17 +0200)] 
gh-135124: Change stdout errors in regrtest worker process (#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.

5 months agogh-131531: android.py enhancements to support cibuildwheel (#132870)
Malcolm Smith [Thu, 5 Jun 2025 05:46:16 +0000 (06:46 +0100)] 
gh-131531: android.py enhancements to support cibuildwheel (#132870)

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.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
5 months agogh-134889: Fix handling of a few opcodes when optimizing `LOAD_FAST` (#134958)
mpage [Wed, 4 Jun 2025 23:07:58 +0000 (16:07 -0700)] 
gh-134889: Fix handling of a few opcodes when optimizing `LOAD_FAST` (#134958)

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.

5 months agogh-135144: Add `_remote_debugging` to the MSI (legacy) Windows installers. (#135145)
T. Wouters [Wed, 4 Jun 2025 19:39:00 +0000 (21:39 +0200)] 
gh-135144: Add `_remote_debugging` to the MSI (legacy) Windows installers. (#135145)

Add _remote_debugging to the MSI (legacy) installers.

5 months agoUpdate the devcontainer image to the latest version (GH-135143)
Brett Cannon [Wed, 4 Jun 2025 17:06:10 +0000 (10:06 -0700)] 
Update the devcontainer image to the latest version (GH-135143)

Fixes an issue where the WASI tools were being incorrectly installed under the ARM image.

5 months agogh-129876: Update IDLE News3.txt to May 2025 (#135139)
Terry Jan Reedy [Wed, 4 Jun 2025 15:26:19 +0000 (11:26 -0400)] 
gh-129876: Update IDLE News3.txt to May 2025 (#135139)

5 months agogh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021)
Victor Stinner [Wed, 4 Jun 2025 13:07:52 +0000 (15:07 +0200)] 
gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021)

5 months agogh-126483: disable warnings filters mutation in concurrent test (GH-132694)
Thomas Grainger [Wed, 4 Jun 2025 13:00:25 +0000 (14:00 +0100)] 
gh-126483: disable warnings filters mutation in concurrent test (GH-132694)

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.

5 months agogh-135074: Fix exception messages in test.support module (GH-135076)
Daniel Hollas [Wed, 4 Jun 2025 12:58:34 +0000 (13:58 +0100)] 
gh-135074: Fix exception messages in test.support module (GH-135076)

5 months agogh-135108: Fix utmp.h inclusion in posixmodule.c on NetBSD (GH-135109)
Furkan Onder [Wed, 4 Jun 2025 12:51:18 +0000 (15:51 +0300)] 
gh-135108: Fix utmp.h inclusion in posixmodule.c on NetBSD (GH-135109)

5 months agoUse a more clear example for the PEP 758 what's new section (#135118)
Pablo Galindo Salgado [Wed, 4 Jun 2025 09:23:08 +0000 (10:23 +0100)] 
Use a more clear example for the PEP 758 what's new section (#135118)

5 months agogh-135099: Only wait on `_PyOS_SigintEvent()` in main thread (GH-135100)
Sam Gross [Wed, 4 Jun 2025 07:35:56 +0000 (03:35 -0400)] 
gh-135099: Only wait on `_PyOS_SigintEvent()` in main thread (GH-135100)

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.

5 months agogh-135103: Remove an unused local variable in Lib/code.py (GH-135104)
Christian Veenhuis [Wed, 4 Jun 2025 04:57:31 +0000 (06:57 +0200)] 
gh-135103: Remove an unused local variable in Lib/code.py (GH-135104)

remove unused local variable

5 months agogh-135101: When choosing the default simulator device, don't use `simctl --set testin...
Joe Rickerby [Wed, 4 Jun 2025 00:31:43 +0000 (01:31 +0100)] 
gh-135101: When choosing the default simulator device, don't use `simctl --set testing` (#135102)

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.

5 months agogh-127081: use `getlogin_r` if available (gh-132751)
Duane Griffin [Tue, 3 Jun 2025 17:28:58 +0000 (05:28 +1200)] 
gh-127081: use `getlogin_r` if available (gh-132751)

The `getlogin` function is not thread-safe: replace with `getlogin_r` where
available.

5 months agogh-134248 test_getallocatedblocks pre-check to ignore immortalized strings (#134871)
tpburns [Tue, 3 Jun 2025 16:00:25 +0000 (12:00 -0400)] 
gh-134248 test_getallocatedblocks pre-check to ignore immortalized strings (#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.

5 months agogh-135034: Normalize link targets in tarfile, add `os.path.realpath(strict='allow_mis...
Łukasz Langa [Tue, 3 Jun 2025 10:42:11 +0000 (12:42 +0200)] 
gh-135034: Normalize link targets in tarfile, add `os.path.realpath(strict='allow_missing')` (#135037)

Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.

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>
5 months agogh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys...
Roei Ben Artzi [Tue, 3 Jun 2025 07:40:25 +0000 (10:40 +0300)] 
gh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys=True (GH-132200)

5 months agogh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606)
stratakis [Tue, 3 Jun 2025 07:09:43 +0000 (09:09 +0200)] 
gh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606)

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

5 months agogh-135028: Increase parser MAXSTACK for nested parenthesis (#135031)
Victor Stinner [Tue, 3 Jun 2025 06:40:45 +0000 (08:40 +0200)] 
gh-135028: Increase parser MAXSTACK for nested parenthesis (#135031)

5 months agogh-134875: Fix mimallc build error for the old compilers (gh-134994)
Donghee Na [Mon, 2 Jun 2025 23:40:40 +0000 (08:40 +0900)] 
gh-134875: Fix mimallc build error for the old compilers (gh-134994)

5 months agogh-134830: Fix reference in `Doc/extending/windows.rst` (GH-134831)
Stan Ulbrych [Mon, 2 Jun 2025 22:08:20 +0000 (23:08 +0100)] 
gh-134830: Fix reference in `Doc/extending/windows.rst` (GH-134831)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
5 months agogh-132813: Improve error messages for incorrect types and values of csv.Dialog attrib...
Serhiy Storchaka [Mon, 2 Jun 2025 20:35:41 +0000 (23:35 +0300)] 
gh-132813: Improve error messages for incorrect types and values of csv.Dialog attributes (GH-133241)

Make them similar to PyArg_Parse error messages, mention None as
a possible value, show a wrong type and the string length.

5 months agogh-74232: Add a note about roundtrip of non-float numerics in CSV (GH-134963)
Serhiy Storchaka [Mon, 2 Jun 2025 20:31:06 +0000 (23:31 +0300)] 
gh-74232: Add a note about roundtrip of non-float numerics in CSV (GH-134963)

5 months agogh-133454: Mark test_queue tests with many threads as bigmem (gh-134575)
Serhiy Storchaka [Mon, 2 Jun 2025 20:25:32 +0000 (23:25 +0300)] 
gh-133454: Mark test_queue tests with many threads as bigmem (gh-134575)

50 producer and 50 consumer threads need more than 5GB of memory.

5 months agoRemove newline in Doc/c-api/lifecycle.rst for gettext builder (GH-135013)
Rafael Fontenelle [Mon, 2 Jun 2025 18:13:08 +0000 (15:13 -0300)] 
Remove newline in Doc/c-api/lifecycle.rst for gettext builder (GH-135013)

5 months agogh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)
Serhiy Storchaka [Mon, 2 Jun 2025 18:08:26 +0000 (21:08 +0300)] 
gh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)

This may harm performance, but improve crash tolerance.

5 months agogh-134908: Protect `textiowrapper_iternext` with critical section (gh-134910)
Duane Griffin [Mon, 2 Jun 2025 17:22:41 +0000 (05:22 +1200)] 
gh-134908: Protect `textiowrapper_iternext` with critical section (gh-134910)

The `textiowrapper_iternext` function called `_textiowrapper_writeflush`, but did not
use a critical section, making it racy in free-threaded builds.

5 months agogh-130999: Fix globals() poisoning in test_traceback (gh-135030)
Łukasz Langa [Mon, 2 Jun 2025 14:57:08 +0000 (16:57 +0200)] 
gh-130999: Fix globals() poisoning in test_traceback (gh-135030)

5 months agogh-123471: make concurrent iteration over `itertools.cycle` safe under free-threading...
Pieter Eendebak [Mon, 2 Jun 2025 14:43:32 +0000 (16:43 +0200)] 
gh-123471: make concurrent iteration over `itertools.cycle` safe under free-threading (#131212)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
5 months agogh-117852: fix argument checking of `async_generator.athrow` (#134868)
Duane Griffin [Mon, 2 Jun 2025 14:34:26 +0000 (02:34 +1200)] 
gh-117852: fix argument checking of `async_generator.athrow` (#134868)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
5 months agogh-130662: Accept leading zeros in precision/width for Decimal's formatting (#132549)
Sergey B Kirpichev [Mon, 2 Jun 2025 13:30:52 +0000 (16:30 +0300)] 
gh-130662: Accept leading zeros in precision/width for Decimal's formatting (#132549)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-130662: Accept leading zeros in precision/width for Fraction's formatting (#130663)
Sergey B Kirpichev [Mon, 2 Jun 2025 13:28:20 +0000 (16:28 +0300)] 
gh-130662: Accept leading zeros in precision/width for Fraction's formatting (#130663)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-130999: Avoid exiting the new REPL when there are non-string candidates for sugges...
devdanzin [Mon, 2 Jun 2025 11:04:59 +0000 (08:04 -0300)] 
gh-130999: Avoid exiting the new REPL when there are non-string candidates for suggestions (gh-131001)

5 months agogh-132908: Add math.isnormal/issubnormal() functions (GH132935)
Sergey B Kirpichev [Mon, 2 Jun 2025 10:38:05 +0000 (13:38 +0300)] 
gh-132908: Add math.isnormal/issubnormal() functions (GH132935)

5 months agogh-122153: indicate that Windows does not support `socket.{send,recv}_fds` (#134960)
GalaxySnail [Mon, 2 Jun 2025 10:23:52 +0000 (18:23 +0800)] 
gh-122153: indicate that Windows does not support `socket.{send,recv}_fds` (#134960)

This amends commit e3b6ff19aaa318a813130ba9ad2ab0a332f27feb.

5 months agogh-134449: fix grammar for `precision_with_grouping` in format description (#134608)
Sergey B Kirpichev [Mon, 2 Jun 2025 09:45:48 +0000 (12:45 +0300)] 
gh-134449: fix grammar for `precision_with_grouping` in format description (#134608)

This amends commit f39a07be47cd9219eaf0e538ae32ad8239c88e66.

5 months agogh-134978: deprecate `string` keyword parameter for hash function constructors (...
Bénédikt Tran [Mon, 2 Jun 2025 08:25:50 +0000 (10:25 +0200)] 
gh-134978: deprecate `string` keyword parameter for hash function constructors (#134979)

5 months agogh-130478: fix HACL* build for macOS Silicon (#134188)
Sam Ng [Sun, 1 Jun 2025 15:35:58 +0000 (08:35 -0700)] 
gh-130478: fix HACL* build for macOS Silicon (#134188)

5 months agogh-134004: Added the reorganize() methods to dbm.sqlite, dbm.dumb and shelve (GH...
Andrea-Oliveri [Sun, 1 Jun 2025 12:30:04 +0000 (14:30 +0200)] 
gh-134004: Added the reorganize() methods to dbm.sqlite, dbm.dumb and shelve (GH-134028)

They are similar to the same named method in dbm.gnu.

5 months agogh-132983: Minor fixes and clean up for the _zstd module (GH-134930)
Serhiy Storchaka [Sun, 1 Jun 2025 08:22:15 +0000 (11:22 +0300)] 
gh-132983: Minor fixes and clean up for the _zstd module (GH-134930)

5 months agogh-133503: clarify `compileall -s/-p` docs (#134756)
Rihaan Meher [Sun, 1 Jun 2025 08:18:31 +0000 (04:18 -0400)] 
gh-133503: clarify `compileall -s/-p` docs (#134756)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-134970: Fix exception message in argparse module (GH-134971)
Michał Górny [Sun, 1 Jun 2025 05:56:56 +0000 (07:56 +0200)] 
gh-134970: Fix exception message in argparse module (GH-134971)

Fix the "unknown action" exception in argparse.ArgumentParser.add_argument_group()
to correctly replace the action class.

5 months agogh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c`...
sobolevn [Sat, 31 May 2025 21:33:02 +0000 (00:33 +0300)] 
gh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c` (#133892)

5 months agogh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844)
Stan Ulbrych [Sat, 31 May 2025 17:48:51 +0000 (18:48 +0100)] 
gh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844)

:teapot:

5 months agogh-134954: Hard-cap max file descriptors in subprocess test fd_status (#134955)
Itamar Oren [Sat, 31 May 2025 14:29:03 +0000 (07:29 -0700)] 
gh-134954: Hard-cap max file descriptors in subprocess test fd_status (#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/

5 months agoImprove format of `InternalDocs/exception_handling.md` (#134969)
sobolevn [Sat, 31 May 2025 11:56:33 +0000 (14:56 +0300)] 
Improve format of `InternalDocs/exception_handling.md` (#134969)

5 months agoskip test for sys._stdlib_dir if that is not present (#134973)
CF Bolz-Tereick [Sat, 31 May 2025 11:46:22 +0000 (13:46 +0200)] 
skip test for sys._stdlib_dir if that is not present (#134973)

5 months agoSkip test as cpython_only that checks whether setattr interns the attribute or not...
CF Bolz-Tereick [Sat, 31 May 2025 11:38:05 +0000 (13:38 +0200)] 
Skip test as cpython_only that checks whether setattr interns the attribute or not (#134972)

Skip test that checks whether setattr interns the attribute or not

The details of when a string is being interned or not is implementation
dependent.

5 months agogh-133968: Create the Unicode writer on demand in json (#133832)
Nice Zombies [Sat, 31 May 2025 11:35:51 +0000 (13:35 +0200)] 
gh-133968: Create the Unicode writer on demand in json (#133832)

5 months agogh-134696: fix `hashlib` tests for FIPS-only BLAKE-2 buildbot (#134968)
Bénédikt Tran [Sat, 31 May 2025 10:48:34 +0000 (12:48 +0200)] 
gh-134696: fix `hashlib` tests for FIPS-only BLAKE-2 buildbot  (#134968)

5 months ago gh-108885: Use subtests for doctest examples run by unittest (GH-134890)
Serhiy Storchaka [Sat, 31 May 2025 10:01:46 +0000 (13:01 +0300)] 
 gh-108885: Use subtests for doctest examples run by unittest (GH-134890)

Run each example as a subtest in unit tests synthesized by
doctest.DocFileSuite() and doctest.DocTestSuite().

Add the doctest.DocTestRunner.report_skip() method.

5 months agogh-134918: Fix and improve doctest's documentation (GH-134919)
Serhiy Storchaka [Sat, 31 May 2025 09:03:08 +0000 (12:03 +0300)] 
gh-134918: Fix and improve doctest's documentation (GH-134919)

5 months agogh-133489: Remove size restrictions on getrandbits() and randbytes() (GH-133658)
Serhiy Storchaka [Sat, 31 May 2025 08:23:01 +0000 (11:23 +0300)] 
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.

5 months agogh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures...
Bénédikt Tran [Sat, 31 May 2025 07:37:47 +0000 (09:37 +0200)] 
gh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures (#134713)

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.

5 months agogh-134718: Omit optional Load() values in ast.dump() (GH-134934)
Serhiy Storchaka [Sat, 31 May 2025 07:32:53 +0000 (10:32 +0300)] 
gh-134718: Omit optional Load() values in ast.dump() (GH-134934)

5 months agogh-91048: Reorder result tuple of parse_code_object (#134898)
László Kiss Kollár [Sat, 31 May 2025 00:32:36 +0000 (03:32 +0300)] 
gh-91048:  Reorder result tuple of parse_code_object (#134898)

Reorder result tuple of parse_code_object

The standard followed by APIs like pstat.Stats is to take a file, line,
function triplet. The parse_code_object function (and callers exposing
this in Python like RemoteUnwinder.get_stack_trace) return function,
file, line triplets which requires the caller to reorder these when
using it in classes like pstat.Stats.

5 months agogh-134923: Use /GENPROFILE and /USEPROFILE for Windows PGO builds (GH-134924)
Steve Dower [Fri, 30 May 2025 18:37:29 +0000 (19:37 +0100)] 
gh-134923: Use /GENPROFILE and /USEPROFILE for Windows PGO builds (GH-134924)

5 months agorearrange my gitingore addition w/comment to make backporting easier (#134945)
Gregory P. Smith [Fri, 30 May 2025 18:28:14 +0000 (11:28 -0700)] 
rearrange my gitingore addition w/comment to make backporting easier (#134945)