]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 months agogh-131002: clarify how to enforce sqlite3 column types for generated fields (#131006)
Erlend E. Aasland [Mon, 17 Mar 2025 22:26:27 +0000 (23:26 +0100)] 
gh-131002: clarify how to enforce sqlite3 column types for generated fields (#131006)

7 months agogh-119786: Fix _PyExecutorObject link at jit.md file (#131382)
Nybblista [Mon, 17 Mar 2025 21:22:12 +0000 (00:22 +0300)] 
gh-119786: Fix _PyExecutorObject link at jit.md file (#131382)

7 months agogh-130080: implement PEP 765 (#130087)
Irit Katriel [Mon, 17 Mar 2025 20:48:54 +0000 (20:48 +0000)] 
gh-130080: implement PEP 765 (#130087)

7 months agoGH-131278: Add option to build with computed gotos on Windows with clang-cl (GH-131279)
Chris Eibl [Mon, 17 Mar 2025 20:32:23 +0000 (21:32 +0100)] 
GH-131278: Add option to build with computed gotos on Windows with clang-cl (GH-131279)

7 months agogh-131325: fix sendfile fallback implementation to drain data after writing to transp...
Kumar Aditya [Mon, 17 Mar 2025 19:22:57 +0000 (00:52 +0530)] 
gh-131325: fix sendfile fallback implementation to drain data after writing to transport (#131376)

7 months agogh-116738: remove multiprocessing suppressions (#131319)
Kumar Aditya [Mon, 17 Mar 2025 18:59:18 +0000 (00:29 +0530)] 
gh-116738: remove multiprocessing suppressions (#131319)

7 months agoFix test_pyrepl.TestDumbTerminal if PYTHON_BASIC_REPL set. (#131332)
R. David Murray [Mon, 17 Mar 2025 17:56:21 +0000 (13:56 -0400)] 
Fix test_pyrepl.TestDumbTerminal if PYTHON_BASIC_REPL set. (#131332)

Most of the tests that care already adjust PYTHON_BASIC_REPL as needed,
but this one doesn't, and it fails if the developer has the variable set.

7 months agoGH-127705: Move mortal decrefs to internal header and make sure _PyReftracerTrack...
Mark Shannon [Mon, 17 Mar 2025 17:23:50 +0000 (17:23 +0000)] 
GH-127705: Move mortal decrefs to internal header and make sure _PyReftracerTrack is called

7 months agoGH-125174: Make immortality "sticky" (GH-131355)
Mark Shannon [Mon, 17 Mar 2025 17:22:35 +0000 (17:22 +0000)] 
GH-125174: Make immortality "sticky" (GH-131355)

* Use a higher threshold for immortality for INCREF than DECREF

7 months agogh-131268: Adjust _PYTHREAD_NAME_MAXLEN on BSD (#131345)
Victor Stinner [Mon, 17 Mar 2025 16:52:59 +0000 (17:52 +0100)] 
gh-131268: Adjust _PYTHREAD_NAME_MAXLEN on BSD (#131345)

Adjust _PYTHREAD_NAME_MAXLEN constant on FreeBSD and NetBSD.
Initial patch by Xavier G.

7 months agogh-131281: Add include for pystats builds (#131369)
Ken Jin [Mon, 17 Mar 2025 16:36:06 +0000 (00:36 +0800)] 
gh-131281: Add include for pystats builds (#131369)

Add include to for pystats builds

7 months agoGH-131291: Suppress clang-specific warning in python_uwp.cpp (GH-131292)
Chris Eibl [Mon, 17 Mar 2025 16:22:25 +0000 (17:22 +0100)] 
GH-131291: Suppress clang-specific warning in python_uwp.cpp (GH-131292)

7 months agogh-116666: Add "token" glossary term (GH-130888)
Petr Viktorin [Mon, 17 Mar 2025 16:05:47 +0000 (17:05 +0100)] 
gh-116666: Add "token" glossary term (GH-130888)

Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months agogh-126895: Fix readline module in free-threaded build (#131208)
Tomasz Pytel [Mon, 17 Mar 2025 15:57:11 +0000 (11:57 -0400)] 
gh-126895: Fix readline module in free-threaded build (#131208)

The underlying readline library is not thread-safe so this adds `@critical_section` to functions that use it.

7 months agoDocs: Fix incorrect sphinx markup for a class member (GH-130970)
Yuki Kobayashi [Mon, 17 Mar 2025 15:28:56 +0000 (00:28 +0900)] 
Docs: Fix incorrect sphinx markup for a class member (GH-130970)

7 months agogh-111178: fix UBSan failures in `Modules/_ssl.c` (GH-130719)
Bénédikt Tran [Mon, 17 Mar 2025 15:25:28 +0000 (16:25 +0100)] 
gh-111178: fix UBSan failures in `Modules/_ssl.c` (GH-130719)

* fix UBSan failures for `PySSLContext`, `PySSLSocket`, `PySSLMemoryBIO`, `PySSLSession`

7 months agoGH-131238: More refactoring of core header files (GH-131351)
Mark Shannon [Mon, 17 Mar 2025 14:41:05 +0000 (14:41 +0000)] 
GH-131238: More refactoring of core header files (GH-131351)

Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.

7 months agogh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) (#131272)
Gregory P. Smith [Mon, 17 Mar 2025 13:55:02 +0000 (06:55 -0700)] 
gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) (#131272)

7 months agogh-131238: Add explicit includes to pycore headers (#131257)
Victor Stinner [Mon, 17 Mar 2025 11:32:43 +0000 (12:32 +0100)] 
gh-131238: Add explicit includes to pycore headers (#131257)

7 months agogh-131238: Convert pycore_pystate.h static inline to functions (#131352)
Victor Stinner [Mon, 17 Mar 2025 11:31:55 +0000 (12:31 +0100)] 
gh-131238: Convert pycore_pystate.h static inline to functions (#131352)

Convert static inline functions to functions:

* _Py_IsMainThread()
* _PyInterpreterState_Main()
* _Py_IsMainInterpreterFinalizing()
* _Py_GetMainConfig()

7 months agogh-129843: fix pure Python implementation of `warnings.warn_explicit` (#129848)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Mon, 17 Mar 2025 10:49:53 +0000 (16:19 +0530)] 
gh-129843: fix pure Python implementation of `warnings.warn_explicit` (#129848)

The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage`
with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`).

7 months agogh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)
Bénédikt Tran [Mon, 17 Mar 2025 10:12:55 +0000 (11:12 +0100)] 
gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)

Refactor `_setException()` into different helpers that can be used separately:

- set_ssl_exception_from_errcode(): set an exception from an explicit SSL error code.
- raise_ssl_error(): set an exception from the last SSL error code or use a user-defined message.
- notify_ssl_error_occurred(): same as raise_ssl_error() but with a generic default message.

7 months agogh-131316: handle NULL values returned by HACL* functions (#131324)
Bénédikt Tran [Mon, 17 Mar 2025 10:10:39 +0000 (11:10 +0100)] 
gh-131316: handle NULL values returned by HACL* functions  (#131324)

- Handle NULL returned by allocation functions.
- Handle NULL returned by copy functions.
- Suppress unused impossible return codes.

7 months agogh-130149: cleanup refactorization of `test_hmac.py` (#131318)
Bénédikt Tran [Mon, 17 Mar 2025 10:10:03 +0000 (11:10 +0100)] 
gh-130149: cleanup refactorization of `test_hmac.py` (#131318)

New features:

* refactor `hashlib_helper.requires_hashdigest` in prevision of a future
  `hashlib_helper.requires_builtin_hashdigest` for built-in hashes only
* add `hashlib_helper.requires_openssl_hashdigest` to request OpenSSL
   hashes, assuming that `_hashlib` exists.

Refactoring:

* split hmac.copy() test by implementation
* update how algorithms are discovered for RFC test cases
* simplify how OpenSSL hash digests are requested
* refactor hexdigest tests for RFC test vectors
* typo fix: `assert_hmac_hexdigest_by_new` -> `assert_hmac_hexdigest_by_name`

Improvements:

* strengthen contract on `hmac_new_by_name` and `hmac_digest_by_name`
* rename mixin classes to better match their responsibility

7 months agogh-93096: Update and document `pickletools` CLI (#131273)
Semyon Moroz [Mon, 17 Mar 2025 09:36:30 +0000 (13:36 +0400)] 
gh-93096: Update and document `pickletools` CLI (#131273)

7 months agoGH-131238: Core header refactor (GH-131250)
Mark Shannon [Mon, 17 Mar 2025 09:19:04 +0000 (09:19 +0000)] 
GH-131238: Core header refactor (GH-131250)

* Moves most structs in pycore_ header files into pycore_structs.h and pycore_runtime_structs.h

* Removes many cross-header dependencies

7 months agogh-131339: test PyBytes_Size for a zero-size bytes object (#131340)
Nybblista [Mon, 17 Mar 2025 08:38:37 +0000 (11:38 +0300)] 
gh-131339: test PyBytes_Size for a zero-size bytes object (#131340)

7 months agogh-127146: Update test skips for Emscripten 4.0.2 (#129474)
Hood Chatham [Sun, 16 Mar 2025 22:02:27 +0000 (23:02 +0100)] 
gh-127146: Update test skips for Emscripten 4.0.2 (#129474)

Updates test skips to reflect capabilities of Emscripten 4.0.2.

7 months agogh-119786: add `JUMP_BACKWARD` macro to the Jumps section (#131213)
Nybblista [Sun, 16 Mar 2025 20:04:39 +0000 (23:04 +0300)] 
gh-119786: add `JUMP_BACKWARD` macro to the Jumps section (#131213)

add JUMP_BACKWARD opcode macro to the Jumps section

JUMP_BACKWARD opcode macro added to the Jumps section in
interpreter.md file at InternalDocs.

7 months agogh-131306: Remove unused code related to `BINARY_SUBSCR` (#131307)
Tomas R. [Sun, 16 Mar 2025 16:37:29 +0000 (17:37 +0100)] 
gh-131306: Remove unused code related to `BINARY_SUBSCR` (#131307)

7 months agogh-131327: Document winsound.SND_APPLICATION (#131328)
AN Long [Sun, 16 Mar 2025 15:27:24 +0000 (00:27 +0900)] 
gh-131327: Document winsound.SND_APPLICATION (#131328)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131254: ensure that `BROWSER` is not set for `test_webbrowser` on macOS (#131276)
Bénédikt Tran [Sun, 16 Mar 2025 14:39:30 +0000 (15:39 +0100)] 
gh-131254: ensure that `BROWSER` is not set for `test_webbrowser` on macOS (#131276)

7 months agogh-131277: allow `EnvironmentVarGuard` to unset more than one environment variable...
Bénédikt Tran [Sun, 16 Mar 2025 13:09:33 +0000 (14:09 +0100)] 
gh-131277: allow `EnvironmentVarGuard` to unset more than one environment variable at once (#131280)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agogh-130160: use `.. program::` directive for documenting `doctest` CLI (#131034)
donBarbos [Sun, 16 Mar 2025 11:53:22 +0000 (15:53 +0400)] 
gh-130160: use `.. program::` directive for documenting `doctest` CLI (#131034)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agoGH-130614: pathlib ABCs: improve support for receiving path metadata (#131259)
Barney Gale [Sun, 16 Mar 2025 06:11:20 +0000 (06:11 +0000)] 
GH-130614: pathlib ABCs: improve support for receiving path metadata (#131259)

In the private pathlib ABCs, replace `_WritablePath._write_info()` with
`_WritablePath._copy_from()`. This provides the target path object with
more control over the copying process, including support for querying and
setting metadata *before* the path is created.

Adjust `_ReadablePath.copy()` so that it forwards its keyword arguments to
`_WritablePath._copy_from()` of the target path object. This allows us to
remove the unimplemented *preserve_metadata* argument in the ABC method,
making it a `Path` exclusive.

7 months agoGH-131296: fix clang-cl warnings on Windows in pyshellext.cpp (GH-131300)
Chris Eibl [Sat, 15 Mar 2025 18:55:00 +0000 (19:55 +0100)] 
GH-131296:  fix clang-cl warnings on Windows in pyshellext.cpp (GH-131300)

fix unused warnings in pyshellext.cpp

7 months agoGH-131296: fix clang-cl warning on Windows in pytime.c (GH-131297)
Chris Eibl [Sat, 15 Mar 2025 18:41:34 +0000 (19:41 +0100)] 
GH-131296: fix clang-cl warning on Windows in pytime.c (GH-131297)

fix warning : integer literal is too large

to be represented in a signed integer type,
interpreting as unsigned [-Wimplicitly-unsigned-literal]

7 months agoGH-131296: fix clang-cl warnings on Windows in blake2module.c (#131299)
Chris Eibl [Sat, 15 Mar 2025 18:37:53 +0000 (19:37 +0100)] 
GH-131296: fix clang-cl warnings on Windows in blake2module.c (#131299)

work around unimportant clang-cl warnings in blake2module.c

7 months agogh-130213: update hacl_star_rev to 322f6d58290e0ed7f4ecb84fcce12917aa0f594b (GH-130960)
Chris Eibl [Sat, 15 Mar 2025 17:42:27 +0000 (18:42 +0100)] 
gh-130213: update hacl_star_rev to 322f6d58290e0ed7f4ecb84fcce12917aa0f594b (GH-130960)

Updates the HACL* implementation used by hashlib from upstream sources.

7 months agogh-130160: use `.. program::` directive for documenting `http.server` CLI (#131010)
donBarbos [Sat, 15 Mar 2025 16:28:56 +0000 (20:28 +0400)] 
gh-130160: use `.. program::` directive for documenting `http.server` CLI (#131010)

7 months agogh-131281: fix compile error due to `BINARY_SUBSCR` (GH-131283)
Xuanteng Huang [Sat, 15 Mar 2025 15:38:46 +0000 (23:38 +0800)] 
gh-131281: fix compile error due to `BINARY_SUBSCR` (GH-131283)

* fix compile error due to `BINARY_SUBSCR`

* replace stat_inc with `BINARY_OP`

7 months agogh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen to CFG (#130481)
Yan Yanchii [Fri, 14 Mar 2025 21:23:27 +0000 (22:23 +0100)] 
gh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen to CFG (#130481)

7 months agogh-121468: Fix the doctest failure for asyncio test on pdb (#131258)
Tian Gao [Fri, 14 Mar 2025 20:23:21 +0000 (16:23 -0400)] 
gh-121468: Fix the doctest failure for asyncio test on pdb (#131258)

7 months agoGH-130614: pathlib ABCs: delete vestigial `test_pathlib_abc` module (#131215)
Barney Gale [Fri, 14 Mar 2025 20:04:07 +0000 (20:04 +0000)] 
GH-130614: pathlib ABCs: delete vestigial `test_pathlib_abc` module (#131215)

Remove the `test.test_pathlib.test_pathlib_abc` test module, which was
hollowed out in previous commits. Its few remaining tests are most relevant
to `PurePath` and `Path`, so we move them into `test_pathlib`.

7 months agogh-121468: Add current asyncio task as a convenience variable in pdb (#124367)
Tian Gao [Fri, 14 Mar 2025 18:46:26 +0000 (14:46 -0400)] 
gh-121468: Add current asyncio task as a convenience variable in pdb (#124367)

7 months agoPost 3.14.0a6
Hugo van Kemenade [Fri, 14 Mar 2025 17:09:56 +0000 (19:09 +0200)] 
Post 3.14.0a6

7 months agoPython 3.14.0a6 v3.14.0a6
Hugo van Kemenade [Fri, 14 Mar 2025 15:04:35 +0000 (17:04 +0200)] 
Python 3.14.0a6

7 months agogh-121970: Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116...
Hugo van Kemenade [Fri, 14 Mar 2025 14:25:56 +0000 (16:25 +0200)] 
gh-121970: Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116)" (#131245)

Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116)"

This reverts commit 01bcf13a1c5bfca5124cf2e0679c9d1b25b04708.

7 months agogh-111178: Fix function signatures for test_os (#131227)
Victor Stinner [Fri, 14 Mar 2025 13:53:06 +0000 (14:53 +0100)] 
gh-111178: Fix function signatures for test_os (#131227)

7 months agogh-111178: Fix function signatures in `_asynciomodule.c` (#131228)
Victor Stinner [Fri, 14 Mar 2025 13:37:39 +0000 (14:37 +0100)] 
gh-111178: Fix function signatures in `_asynciomodule.c` (#131228)

7 months agogh-93096: Update and document `pickle` CLI (#131097)
donBarbos [Fri, 14 Mar 2025 13:15:35 +0000 (17:15 +0400)] 
gh-93096: Update and document `pickle` CLI (#131097)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agoGH-127705: Handle trace refs in specialized decref (GH-131198)
Mark Shannon [Fri, 14 Mar 2025 12:02:09 +0000 (12:02 +0000)] 
GH-127705: Handle trace refs in specialized decref (GH-131198)

This is missing `_PyReftracerTrack` calls, see gh-131238.
Merging as-is for the 3.14.0a6 release.

7 months agogh-131234: Improve `test_popen` with more asserts (#131235)
sobolevn [Fri, 14 Mar 2025 11:38:31 +0000 (14:38 +0300)] 
gh-131234: Improve `test_popen` with more asserts (#131235)

7 months agoGH-125174 Revert: Make immortality "sticky" (GH-131184)" (#131230)
Mark Shannon [Fri, 14 Mar 2025 11:13:47 +0000 (11:13 +0000)] 
GH-125174 Revert: Make immortality "sticky" (GH-131184)" (#131230)

Revert "GH-125174: Make immortality "sticky" (GH-131184)"

This reverts commit 3a91ee97245639c7c4f8852418157d3fc0ec1a82.

7 months agogh-131204: Fix `difflib.HtmlDiff` may not use monospaced font (#131221)
Wulian233 [Fri, 14 Mar 2025 10:45:33 +0000 (18:45 +0800)] 
gh-131204: Fix `difflib.HtmlDiff` may not use monospaced font (#131221)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agogh-92897: Doc: the check_home removal has been scheduled for 3.15 (#130586)
Hugo van Kemenade [Fri, 14 Mar 2025 10:29:23 +0000 (12:29 +0200)] 
gh-92897: Doc: the check_home removal has been scheduled for 3.15 (#130586)

7 months agogh-131219: Improve tests in `test_lzma.py` by adding more asserts (#131220)
sobolevn [Fri, 14 Mar 2025 10:16:50 +0000 (13:16 +0300)] 
gh-131219: Improve tests in `test_lzma.py` by adding more asserts (#131220)

7 months agogh-130814: Enhance documentation for Python C API type objects (#130817)
sharktide [Fri, 14 Mar 2025 09:53:13 +0000 (05:53 -0400)] 
gh-130814: Enhance documentation for Python C API type objects (#130817)

The "Type Objects" title in `c-api/typeobj.rst`, duplicating the title of `c-api/type.rst`,
has been changed to "Type Objects Structures", thereby slightly improving Sphinx
search.

7 months agogh-111178: Fix function signatures to fix undefined behavior (#131191)
Victor Stinner [Fri, 14 Mar 2025 09:52:15 +0000 (10:52 +0100)] 
gh-111178: Fix function signatures to fix undefined behavior (#131191)

7 months agogh-124269: Simplify `typing.Annotated` docs (#130770)
Stan Ulbrych [Fri, 14 Mar 2025 09:46:57 +0000 (09:46 +0000)] 
gh-124269: Simplify `typing.Annotated` docs (#130770)

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-111178: Fix function signatures for PyStdPrinter (#131192)
Victor Stinner [Fri, 14 Mar 2025 09:24:38 +0000 (10:24 +0100)] 
gh-111178: Fix function signatures for PyStdPrinter (#131192)

7 months agogh-111178: Fix _PyLegacyEventHandler_Type deallocator (#131193)
Victor Stinner [Fri, 14 Mar 2025 09:23:54 +0000 (10:23 +0100)] 
gh-111178: Fix _PyLegacyEventHandler_Type deallocator (#131193)

Don't use PyObject_Free() as tp_dealloc to avoid an undefined
behavior. Instead, use the default deallocator which just calls
tp_free which is PyObject_Free().

7 months agogh-128540: lookup default webbrowser on macOS (#130535)
Min RK [Fri, 14 Mar 2025 06:51:15 +0000 (07:51 +0100)] 
gh-128540: lookup default webbrowser on macOS (#130535)

Ensure web browser is launched by `webbrowser.open` on macOS, even for `file://` URLs.

7 months agoGH-130396: Work around for broken `pthread_get_stackaddr_np` on Emscripten (#131088)
Hood Chatham [Thu, 13 Mar 2025 23:04:40 +0000 (00:04 +0100)] 
GH-130396: Work around for broken `pthread_get_stackaddr_np` on Emscripten (#131088)

Implements a workaround implementation of `pthread_get_stackaddr_np` for Emscripten.
This will be replaced by an implementation that will be included in Emscripten 4.0.6.

7 months agogh-131196: Improve perfomance of `UUID.hex` and `UUID.__str__` by ~10% (#131197)
Grigory Bukovsky [Thu, 13 Mar 2025 22:57:38 +0000 (01:57 +0300)] 
gh-131196: Improve perfomance of `UUID.hex` and `UUID.__str__` by ~10% (#131197)

Results before and after the fix:

```
hex
before: 0.021755493999989994
after:  0.01465080400066654

str
before: 0.06381790500017814
after:  0.05134949700004654
```

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-74028: update `whatsnew/3.14.rst` post gh-125663 (#131214)
Enzo Bonnal [Thu, 13 Mar 2025 22:22:04 +0000 (22:22 +0000)] 
gh-74028: update `whatsnew/3.14.rst` post gh-125663 (#131214)

7 months agoGH-130614: pathlib ABCs: parametrize test suite for path copying (#131168)
Barney Gale [Thu, 13 Mar 2025 21:56:59 +0000 (21:56 +0000)] 
GH-130614: pathlib ABCs: parametrize test suite for path copying (#131168)

Test copying from `Path` and `ReadableZipPath` (types of `_ReadablePath`)
to `Path` and `WritableZipPath` (types of `_WritablePath`).

7 months agoRemove `print` from `test_monitoring.py` (#131200)
sobolevn [Thu, 13 Mar 2025 19:54:17 +0000 (22:54 +0300)] 
Remove `print` from `test_monitoring.py` (#131200)

7 months agogh-121464: Make concurrent iteration over enumerate safe under free-threading (#125734)
Pieter Eendebak [Thu, 13 Mar 2025 18:44:05 +0000 (19:44 +0100)] 
gh-121464: Make concurrent iteration over enumerate safe under free-threading (#125734)

7 months agogh-85012: Properly reset msgctxt when compiling messages with msgfmt (GH-130525)
Tomas R. [Thu, 13 Mar 2025 18:40:40 +0000 (19:40 +0100)] 
gh-85012: Properly reset msgctxt when compiling messages with msgfmt (GH-130525)

Add also human-readable snapshots for tests.

7 months agogh-130382: add missing `_PyReftracerTrack` to ceval `Py_DECREF` (#130689)
Tomasz Pytel [Thu, 13 Mar 2025 16:31:49 +0000 (12:31 -0400)] 
gh-130382: add missing `_PyReftracerTrack` to ceval `Py_DECREF` (#130689)

7 months agoGH-125174: Make immortality "sticky" (GH-131184)
Mark Shannon [Thu, 13 Mar 2025 16:10:13 +0000 (16:10 +0000)] 
GH-125174: Make immortality "sticky" (GH-131184)

7 months agogh-130080: move _Py_EnsureArrayLargeEnough to a separate header so it can be used...
Irit Katriel [Thu, 13 Mar 2025 16:02:58 +0000 (16:02 +0000)] 
gh-130080: move _Py_EnsureArrayLargeEnough to a separate header so it can be used outside of the compiler (#130930)

7 months agogh-111178: Fix function signatures in misc files (#131180)
Victor Stinner [Thu, 13 Mar 2025 15:55:08 +0000 (16:55 +0100)] 
gh-111178: Fix function signatures in misc files (#131180)

7 months agogh-131170: fix duplicated sections in frames.md file (#131177)
Nybblista [Thu, 13 Mar 2025 13:59:19 +0000 (16:59 +0300)] 
gh-131170: fix duplicated sections in frames.md file (#131177)

fix duplicated sections in frames.md file

In the frames.md file at InternalDocs, change the first
duplicated title to Specials, and remove unnecessary content
under the Specials section.

7 months agogh-130947: Add again PySequence_Fast() to the limited C API (#130948)
Victor Stinner [Thu, 13 Mar 2025 12:00:57 +0000 (13:00 +0100)] 
gh-130947: Add again PySequence_Fast() to the limited C API (#130948)

Add again PySequence_Fast() to the limited C API.

Add unit tests.

7 months agogh-93096: Remove CLI interface for `difflib` (#131099)
donBarbos [Thu, 13 Mar 2025 11:22:16 +0000 (15:22 +0400)] 
gh-93096: Remove CLI interface for `difflib` (#131099)

7 months agogh-93096: Make `mimetypes` CLI tool public (#93097)
Oleg Iarygin [Thu, 13 Mar 2025 11:19:22 +0000 (15:19 +0400)] 
gh-93096: Make `mimetypes` CLI tool public (#93097)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agogh-129149: Add fast path for medium-sized integers in `PyLong_FromSsize_t()` (#129301)
Chris Eibl [Thu, 13 Mar 2025 11:06:56 +0000 (12:06 +0100)] 
gh-129149: Add fast path for medium-sized integers in `PyLong_FromSsize_t()` (#129301)

The implementation of `PyLong_FromLong()`, `PyLong_FromLongLong()` and `PyLong_FromSsize_t()`
are now handled by a common macro `PYLONG_FROM_INT` which contains fast paths depending on the
size of the integer to convert. Consequently, `PyLong_FromSsize_t()` for medium-sized integers is faster
by roughly 25%.

---------

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
7 months agogh-74028: add `buffersize` parameter to `concurrent.futures.Executor.map` for lazier...
Enzo Bonnal [Thu, 13 Mar 2025 10:57:53 +0000 (10:57 +0000)] 
gh-74028: add `buffersize` parameter to `concurrent.futures.Executor.map` for lazier behavior (#125663)

`concurrent.futures.Executor.map` now supports limiting the number of submitted
tasks whose results have not yet been yielded via the new `buffersize` parameter.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-130099: Fix CAN socket fallthrough annotation for NetBSD compatibility (#131026)
Furkan Onder [Thu, 13 Mar 2025 10:25:43 +0000 (13:25 +0300)] 
gh-130099: Fix CAN socket fallthrough annotation for NetBSD compatibility (#131026)

7 months agogh-130806: Emit ResourceWarning if GzipFile unclosed (#130905)
Cody Maloney [Thu, 13 Mar 2025 10:20:05 +0000 (03:20 -0700)] 
gh-130806: Emit ResourceWarning if GzipFile unclosed (#130905)

This may indicate accidental data loss.

Ways to make sure all data is written:
1. Use the [file-like object](https://docs.python.org/3/glossary.html#term-file-object) as a [“With Statement Context Manager”](https://docs.python.org/3/reference/datamodel.html#context-managers).
   - All objects which [inherit](https://docs.python.org/3/tutorial/classes.html#inheritance) from [IOBase](https://docs.python.org/3/library/io.html#io.IOBase) support this.
   - [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase), [`BufferedWriter`](https://docs.python.org/3/library/io.html#io.BufferedWriter), and [`GzipFile`](https://docs.python.org/3/library/gzip.html#gzip.GzipFile) all support this.
   - Ensures `.close()` is called in both exception and regular cases.

2. Ensure [`.close()`](https://docs.python.org/3/library/io.html#io.IOBase.close) is always called which flushes data before closing.

3. If the underlying stream need to be kept open, use [`.detach()`](https://docs.python.org/3/library/io.html#io.BufferedIOBase.detach)

Since 3.12 flushing has been necessary in GzipFile (see gh-105808 which was a release blocker), this makes that more visible. Users have been encountering as they upgrade to 3.12 (ex. gh-129726).

There are a number of cases of unclosed file-like objects being deleted in CPython libraries and the test suite. This issue includes resolving those cases where the new ResourceWarning is emitted.

Co-authored-by: Victor Stinner <vstinner@python.org>
7 months agogh-111178: Fix function signatures in odictobject.c (#131160)
Victor Stinner [Thu, 13 Mar 2025 10:14:59 +0000 (11:14 +0100)] 
gh-111178: Fix function signatures in odictobject.c (#131160)

Add _PyODictObject_CAST() macro.

7 months agogh-131152: Remove unused imports from `Tools/cases_generator` (#131156)
Victor Stinner [Thu, 13 Mar 2025 09:59:51 +0000 (10:59 +0100)] 
gh-131152: Remove unused imports from `Tools/cases_generator` (#131156)

7 months agogh-131152: Remove unused imports from `Tools/{build,wasm}` (#131155)
Victor Stinner [Thu, 13 Mar 2025 09:58:28 +0000 (10:58 +0100)] 
gh-131152: Remove unused imports from `Tools/{build,wasm}` (#131155)

7 months agogh-131152: Remove unused imports from tests (part 2) (#131154)
Victor Stinner [Thu, 13 Mar 2025 09:57:40 +0000 (10:57 +0100)] 
gh-131152: Remove unused imports from tests (part 2) (#131154)

7 months agogh-111178: Fix function signatures in rangeobject.c (#131161)
Victor Stinner [Thu, 13 Mar 2025 09:56:06 +0000 (10:56 +0100)] 
gh-111178: Fix function signatures in rangeobject.c (#131161)

7 months agogh-131152: Remove unused imports from tests (#131153)
Victor Stinner [Thu, 13 Mar 2025 09:55:23 +0000 (10:55 +0100)] 
gh-131152: Remove unused imports from tests (#131153)

7 months agogh-111178: Fix PyRangeIter_Type deallocator (#131162)
Victor Stinner [Thu, 13 Mar 2025 09:46:20 +0000 (10:46 +0100)] 
gh-111178: Fix PyRangeIter_Type deallocator (#131162)

Don't use PyObject_Free() as tp_dealloc to avoid an undefined
behavior. Instead, use the default deallocator which just calls
tp_free which is PyObject_Free().

7 months agogh-111178: Fix function signatures in iterobject.c (#131163)
Victor Stinner [Thu, 13 Mar 2025 09:42:59 +0000 (10:42 +0100)] 
gh-111178: Fix function signatures in iterobject.c (#131163)

7 months agogh-131032: Add support.linked_to_musl() function (#131071)
Victor Stinner [Thu, 13 Mar 2025 09:33:46 +0000 (10:33 +0100)] 
gh-131032: Add support.linked_to_musl() function (#131071)

Skip test_math.test_fma_zero_result() if Python is linked to the musl
C library.

7 months agogh-111178: Change Argument Clinic signature for `@staticmethod` (#131157) (#131159)
Victor Stinner [Thu, 13 Mar 2025 09:22:58 +0000 (10:22 +0100)] 
gh-111178: Change Argument Clinic signature for `@staticmethod` (#131157) (#131159)

Use "PyObject*", instead of "void*", for `@staticmethod` functions to
fix an undefined behavior.

7 months agogh-130940: Modify default behavior of `PyConfig.use_system_logger` to enable on iOS...
Russell Keith-Magee [Thu, 13 Mar 2025 06:28:49 +0000 (14:28 +0800)] 
gh-130940: Modify default behavior of `PyConfig.use_system_logger` to enable on iOS (#131172)

Modify default behavior of use_system_log to enable on iOS.

7 months agoRemove vestigial code in socketmodule.c for Mac OS X 10.1 (#131090)
Max Bachmann [Thu, 13 Mar 2025 04:13:07 +0000 (05:13 +0100)] 
Remove vestigial code in socketmodule.c for Mac OS X 10.1 (#131090)

7 months agogh-127503: Improve tracebacks on Emscripten when there is a trap (#131158)
Hood Chatham [Thu, 13 Mar 2025 00:28:15 +0000 (01:28 +0100)] 
gh-127503: Improve tracebacks on Emscripten when there is a trap (#131158)

Modifies the behavior of the interpreter on crash under Emscripten:
1. No Python traceback shown on segfault/trap
2. The JavaScript source line is shown

The JavaScript source line is super long and completely unenlightening,
whereas the Python traceback is very helpful.

7 months agogh-126835: Avoid creating unnecessary tuple when looking for constant sequence during...
Yan Yanchii [Wed, 12 Mar 2025 21:45:54 +0000 (22:45 +0100)] 
gh-126835: Avoid creating unnecessary tuple when looking for constant sequence during constant folding (#131054)

7 months agogh-131123: Support completion in `pdb` for convenience variable attributes (#131124)
Tian Gao [Wed, 12 Mar 2025 21:23:53 +0000 (17:23 -0400)] 
gh-131123: Support completion in `pdb` for convenience variable attributes (#131124)

7 months agogh-131045: [Enum] fix flag containment checks when using values (GH-131053)
Ethan Furman [Wed, 12 Mar 2025 19:10:47 +0000 (12:10 -0700)] 
gh-131045: [Enum] fix flag containment checks when using values (GH-131053)

Check would fail if value would create a pseudo-member, but that member
had not yet been created.  We now attempt to create a pseudo-member for
a passed-in value first.

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
7 months agoGH-130614: pathlib ABCs: revise test suite for writable paths (#131112)
Barney Gale [Wed, 12 Mar 2025 19:06:43 +0000 (19:06 +0000)] 
GH-130614: pathlib ABCs: revise test suite for writable paths (#131112)

Test `pathlib.types._WritablePath` in a dedicated test module. These tests
cover `WritableZipPath`, `WritableLocalPath` and `Path`, where the former
two classes are implementations of `_WritablePath` for use in tests.

7 months agogh-131141: fix data race in instrumentation while registering callback (#131142)
Kumar Aditya [Wed, 12 Mar 2025 18:41:52 +0000 (00:11 +0530)] 
gh-131141: fix data race in instrumentation while registering callback (#131142)