]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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)

7 months agoImprove docstring for random.binomialvariate (gh-131164)
Raymond Hettinger [Wed, 12 Mar 2025 18:25:31 +0000 (13:25 -0500)] 
Improve docstring for random.binomialvariate (gh-131164)

Add probability distribution to the docstring

7 months agogh-110097: Fix flaky `test_timeout` in `test_concurrent_futures.test_process_pool...
Sam Gross [Wed, 12 Mar 2025 17:16:23 +0000 (13:16 -0400)] 
gh-110097: Fix flaky `test_timeout` in `test_concurrent_futures.test_process_pool` (gh-131108)

On heavily loaded systems, the launch of the workers to run
`time.sleep(0)` can take longer than the five second timeout.

7 months agoGH-127705: Fix _Py_RefcntAdd to handle objects becoming immortal (GH-131140)
Mark Shannon [Wed, 12 Mar 2025 16:54:10 +0000 (16:54 +0000)] 
GH-127705: Fix _Py_RefcntAdd to handle objects becoming immortal (GH-131140)

7 months agogh-111178: Change Argument Clinic signature for `@classmethod` (#131157)
Victor Stinner [Wed, 12 Mar 2025 16:42:07 +0000 (17:42 +0100)] 
gh-111178: Change Argument Clinic signature for `@classmethod` (#131157)

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

7 months agogh-115999: Add free-threaded specialization for FOR_ITER (#128798)
T. Wouters [Wed, 12 Mar 2025 15:21:46 +0000 (16:21 +0100)] 
gh-115999: Add free-threaded specialization for FOR_ITER (#128798)

Add free-threaded versions of existing specialization for FOR_ITER (list, tuples, fast range iterators and generators), without significantly affecting their thread-safety. (Iterating over shared lists/tuples/ranges should be fine like before. Reusing iterators between threads is not fine, like before. Sharing generators between threads is a recipe for significant crashes, like before.)

7 months agogh-131152: Remove unused imports in `_pyrepl` and `ctypes` (#131150)
Victor Stinner [Wed, 12 Mar 2025 14:04:12 +0000 (15:04 +0100)] 
gh-131152: Remove unused imports in `_pyrepl` and `ctypes` (#131150)

7 months agogh-131152, pkgutil: Remove unused imports (#131149)
Victor Stinner [Wed, 12 Mar 2025 14:03:36 +0000 (15:03 +0100)] 
gh-131152, pkgutil: Remove unused imports (#131149)

7 months agogh-131121: Fix `_Py_atomic_store_char_relaxed` memory order (gh-131122)
Sam Gross [Wed, 12 Mar 2025 13:03:04 +0000 (09:03 -0400)] 
gh-131121: Fix `_Py_atomic_store_char_relaxed` memory order (gh-131122)

7 months agogh-120608: Make reversed iterator work with free-threading (#120971)
Pieter Eendebak [Wed, 12 Mar 2025 11:39:52 +0000 (12:39 +0100)] 
gh-120608: Make reversed iterator work with free-threading (#120971)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
7 months agogh-111178: Fix type of PyCMethod's "nargs" argument (GH-131135)
Victor Stinner [Wed, 12 Mar 2025 10:54:02 +0000 (11:54 +0100)] 
gh-111178: Fix type of PyCMethod's "nargs" argument (GH-131135)

Replace "size_t nargs" with "Py_ssize_t nargs" in PyCMethod.

7 months agogh-129349: Accept bytes in bytes.fromhex()/bytearray.fromhex() (#129844)
Daniel Pope [Wed, 12 Mar 2025 10:40:11 +0000 (10:40 +0000)] 
gh-129349: Accept bytes in bytes.fromhex()/bytearray.fromhex() (#129844)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
7 months agogh-123471: make `itertools.batched` thread-safe (#129416)
Pieter Eendebak [Wed, 12 Mar 2025 10:00:33 +0000 (11:00 +0100)] 
gh-123471: make `itertools.batched` thread-safe (#129416)

7 months agogh-81267: Correct time.sleep() error message (#131055)
Stan Ulbrych [Wed, 12 Mar 2025 08:12:57 +0000 (08:12 +0000)] 
gh-81267: Correct time.sleep() error message (#131055)

7 months agogh-93096: Load doctests in `test_itertools` (#131133)
donBarbos [Wed, 12 Mar 2025 07:40:59 +0000 (11:40 +0400)] 
gh-93096: Load doctests in `test_itertools` (#131133)

7 months agogh-111178: Fix function signatures in rangeobject.c (#131101)
Victor Stinner [Wed, 12 Mar 2025 06:29:20 +0000 (07:29 +0100)] 
gh-111178: Fix function signatures in rangeobject.c (#131101)

7 months agoUse subTest() in math.fma() tests (#131125)
Sergey B Kirpichev [Wed, 12 Mar 2025 06:22:28 +0000 (09:22 +0300)] 
Use subTest() in math.fma() tests (#131125)

7 months agogh-117174: Fix reference leak and gdb tests (#131095)
Pablo Galindo Salgado [Tue, 11 Mar 2025 23:17:58 +0000 (23:17 +0000)] 
gh-117174: Fix reference leak and gdb tests (#131095)

7 months agogh-131113: Fix data race in dict.popitem() (gh-131115)
Sam Gross [Tue, 11 Mar 2025 23:15:22 +0000 (19:15 -0400)] 
gh-131113: Fix data race in dict.popitem() (gh-131115)

The clearing of the key, hash, and value need to use atomic operations
to avoid a data race with concurrent read operations.

7 months agoGH-130614: pathlib ABCs: revise test suite for readable paths (#131018)
Barney Gale [Tue, 11 Mar 2025 20:54:22 +0000 (20:54 +0000)] 
GH-130614: pathlib ABCs: revise test suite for readable paths (#131018)

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

7 months agogh-128002: add `test_asyncio.test_free_threading` to tsan tests (#131106)
Kumar Aditya [Tue, 11 Mar 2025 20:03:44 +0000 (01:33 +0530)] 
gh-128002: add `test_asyncio.test_free_threading` to tsan tests (#131106)

7 months agofix various warnings in `test_asyncio.test_tasks` (#131109)
Kumar Aditya [Tue, 11 Mar 2025 19:51:53 +0000 (01:21 +0530)] 
fix various warnings in `test_asyncio.test_tasks` (#131109)

7 months agogh-122029: Do not unpack method for legacy tracing anymore (#130898)
Tian Gao [Tue, 11 Mar 2025 18:04:22 +0000 (14:04 -0400)] 
gh-122029: Do not unpack method for legacy tracing anymore (#130898)

7 months agoGH-130614: pathlib ABCs: revise test suite for Windows path joining (#131016)
Barney Gale [Tue, 11 Mar 2025 18:01:43 +0000 (18:01 +0000)] 
GH-130614: pathlib ABCs: revise test suite for Windows path joining (#131016)

Test Windows-flavoured `pathlib.types._JoinablePath` in a dedicated test
module. These tests cover `LexicalWindowsPath`, `PureWindowsPath` and
`WindowsPath`, where `LexicalWindowsPath` is a simple implementation of
`_JoinablePath` for use in tests.

7 months agoReplace link to historical TypedDict PEP with current document on typing.python…...
Gerardwx [Tue, 11 Mar 2025 16:45:31 +0000 (12:45 -0400)] 
Replace link to historical TypedDict PEP with current document on typing.python… (#131096)

* Replace link to historical PEP with current document on typing.python.org

* Update Doc/library/typing.rst

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
---------

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
7 months agogh-111178: Change Argument Clinic signature for METH_O (#130682)
Victor Stinner [Tue, 11 Mar 2025 15:33:36 +0000 (16:33 +0100)] 
gh-111178: Change Argument Clinic signature for METH_O (#130682)

Use "PyObject*" for METH_O functions to fix an undefined behavior.

7 months agogh-130396: Fix thread sanitizer crashes on stack overflow tests (gh-130966)
Sam Gross [Tue, 11 Mar 2025 14:33:23 +0000 (10:33 -0400)] 
gh-130396: Fix thread sanitizer crashes on stack overflow tests (gh-130966)

Thread sanitizer will often crash if a test uses more than half the
stack.

7 months agogh-130957: Use `sleeping_retry` in `test_free_reference` (#130958)
Sam Gross [Tue, 11 Mar 2025 13:51:26 +0000 (09:51 -0400)] 
gh-130957: Use `sleeping_retry` in `test_free_reference` (#130958)

The weak reference may not be immediately dead.

7 months agoReplace K&R function declarations with ANSI declarations (#114818)
Max Bachmann [Tue, 11 Mar 2025 12:06:36 +0000 (13:06 +0100)] 
Replace K&R function declarations with ANSI declarations (#114818)

7 months agoGH-127705: Check for immortality in refcount accounting (#131072)
Mark Shannon [Tue, 11 Mar 2025 11:53:07 +0000 (11:53 +0000)] 
GH-127705: Check for immortality in refcount accounting (#131072)

Check for immortality in refcount accounting

7 months agogh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044)
Max Bachmann [Tue, 11 Mar 2025 11:33:01 +0000 (12:33 +0100)] 
gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044)

* Add missing guards for WIN32_LEAN_AND_MEAN

* add missing whitespaces

7 months agogh-93096: Remove `-t` and `-v` flags from `pickle` cli (#131068)
donBarbos [Tue, 11 Mar 2025 11:07:00 +0000 (15:07 +0400)] 
gh-93096: Remove `-t` and `-v` flags from `pickle` cli (#131068)

* Remove `python -m pickle -t`

* Revert adding doctest to unittests

7 months agogh-93096: Remove `-t` and `-v` flags from `pickletools` cli (#131039)
donBarbos [Tue, 11 Mar 2025 11:06:26 +0000 (15:06 +0400)] 
gh-93096: Remove `-t` and `-v` flags from `pickletools` cli (#131039)

Remove `python -m pickletools -t`

7 months agogh-93096: Load doctests in `test_pickle` (#131069)
donBarbos [Tue, 11 Mar 2025 10:25:25 +0000 (14:25 +0400)] 
gh-93096: Load doctests in `test_pickle` (#131069)

Add doctests to unittest for `pickle`

7 months agogh-129675: Update documentation for tp_basicsize & tp_itemsize (#129850)
Petr Viktorin [Tue, 11 Mar 2025 10:21:18 +0000 (11:21 +0100)] 
gh-129675: Update documentation for tp_basicsize & tp_itemsize (#129850)

* Update documentation for tp_basicsize & tp_itemsize

- Add alignment requirement
- Mention that ob_size is unreliable if you don't control it
- Add some links for context
- basicsize should include the base type in generaly not just PyObject

This adds a “by-the-way” link to `PyObject_New`, which shouldn't be
used for GC types. In order to be comfortable linking to it, I also
add a link to `PyObject_GC_New` from its docs. And the same for
`*Var` variants, while I'm here.

* Strongly suggest Py_SIZE & Py_SET_SIZE

7 months agogh-46236: Add missing PyUnicode_Append() doc (#130531)
RUANG (James Roy) [Tue, 11 Mar 2025 09:28:17 +0000 (17:28 +0800)] 
gh-46236: Add missing PyUnicode_Append() doc (#130531)

* Add missing PyUnicode_Append() doc

* Change the copied content

* Add '`` ``'

* Change doc

* Add PyUnicode_AppendAndDel function doc

* Change doc

* Add PyUnicode_AppendAndDel to refcounts

* Change doc

* Change doc

Co-authored-by: Petr Viktorin <encukou@gmail.com>
* Change doc

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
7 months agogh-130959: Reject whitespace in fractions, in pure Python `fromisoformat()` (#130962)
Michał Górny [Tue, 11 Mar 2025 09:15:40 +0000 (10:15 +0100)] 
gh-130959: Reject whitespace in fractions, in pure Python `fromisoformat()` (#130962)

* gh-130959: Reject whitespace in fractions, in pure Python `fromisoformat()`

Fix the pure Python implementation of `fromisoformat()` to reject any
non-digit characters, including whitespace, in the fractional part
of time specification.  This makes the behavior consistent with the C
implementation, and prevents incorrect parsing of these fractions
(e.g. `.400 ` would be misinterpreted as `.04`).

* Add the news entry

* Use a different example to fix Sphinx lint

* Apply suggestions from code review

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
* Try fixing `:func:` ref.

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
7 months agogh-130932: cwd cannot be removed on Solaris/Illumos (#131037)
Jakub Kulík [Tue, 11 Mar 2025 09:09:04 +0000 (10:09 +0100)] 
gh-130932: cwd cannot be removed on Solaris/Illumos (#131037)

7 months agoMinor nits to whats new tail call wording (#130912)
Ken Jin [Tue, 11 Mar 2025 02:57:35 +0000 (10:57 +0800)] 
Minor nits to whats new tail call wording (#130912)

7 months agogh-130039: Tailcall for windows builds (GH-130040)
Ken Jin [Tue, 11 Mar 2025 02:52:56 +0000 (10:52 +0800)] 
gh-130039: Tailcall for windows builds (GH-130040)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agogh-117174: Adapt test_multiple_statements_fail_early now that we have always source...
Pablo Galindo Salgado [Mon, 10 Mar 2025 23:10:53 +0000 (23:10 +0000)] 
gh-117174: Adapt test_multiple_statements_fail_early now that we have always source (#131065)