]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 months agogh-128446: Run Windows CI tests on each commit (#131702)
Adam Turner [Tue, 25 Mar 2025 07:06:15 +0000 (07:06 +0000)] 
gh-128446: Run Windows CI tests on each commit (#131702)

7 months agogh-131666: mark `anext_awaitable.close` as a `METH_NOARGS` instead of `METH_VARARGS...
Bénédikt Tran [Tue, 25 Mar 2025 03:33:22 +0000 (04:33 +0100)] 
gh-131666: mark `anext_awaitable.close` as a `METH_NOARGS` instead of `METH_VARARGS` (#131671)

7 months agoGH-131473: Override PreferredToolArchitecture when using Visual Studio bundled clang...
Chris Eibl [Mon, 24 Mar 2025 23:15:51 +0000 (00:15 +0100)] 
GH-131473: Override PreferredToolArchitecture when using Visual Studio bundled clang-cl (GH-131689)

tweak PreferredToolArchitecture for bundled clang-cl

7 months agogh-127146: Fix Emscripten build with --pydebug (#131672)
Hood Chatham [Mon, 24 Mar 2025 21:43:31 +0000 (22:43 +0100)] 
gh-127146: Fix Emscripten build with --pydebug (#131672)

Removes an explicit check that sysconfigdata naming is correct, in favor of reporting at
runtime with the default mechanisms.

7 months agogh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679)
Sam Gross [Mon, 24 Mar 2025 20:41:50 +0000 (16:41 -0400)] 
gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679)

The call to `with self.subTest(...)` was not thread-safe.

7 months agogh-130928: Fix error message during bytes formatting for the `'i'` flag (#130967)
Ageev Maxim [Mon, 24 Mar 2025 19:07:03 +0000 (22:07 +0300)] 
gh-130928: Fix error message during bytes formatting for the `'i'` flag (#130967)

7 months agogh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (#131682)
sobolevn [Mon, 24 Mar 2025 19:00:48 +0000 (22:00 +0300)] 
gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (#131682)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-111178: Fix function signature in pyexpat.c (#131674)
Victor Stinner [Mon, 24 Mar 2025 17:22:45 +0000 (18:22 +0100)] 
gh-111178: Fix function signature in pyexpat.c (#131674)

Move _Py_NO_SANITIZE_UNDEFINED macro from faulthandler.c to pyport.h.

7 months agoGH-131521: Uses correct build flags for zlib-ng on Windows (GH-131526)
Chris Eibl [Mon, 24 Mar 2025 16:21:57 +0000 (17:21 +0100)] 
GH-131521: Uses correct build flags for zlib-ng on Windows (GH-131526)

Do not enable AdvancedVectorExtensions2 for all *.c files, so that the resulting binary can be executed on older CPUs, too. Also enable AdvancedVectorExtensions512 where necessary, and add the ClangCL flags required to enable vector extensions.

7 months agogh-111178: fix UBSan for example code in `extending/newtypes_tutorial` docs (GH-131606)
Bénédikt Tran [Mon, 24 Mar 2025 16:15:32 +0000 (17:15 +0100)] 
gh-111178: fix UBSan for example code in `extending/newtypes_tutorial` docs (GH-131606)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
7 months agoGH-128520: pathlib ABCs: tighten up argument types (#131621)
Barney Gale [Mon, 24 Mar 2025 15:39:08 +0000 (15:39 +0000)] 
GH-128520: pathlib ABCs: tighten up argument types (#131621)

In `JoinablePath.full_match()` and `ReadablePath.glob()`, accept a `str`
pattern argument rather than `JoinablePath | str`.

In `ReadablePath.copy()` and `copy_into()`, accept a `WritablePath` target
argument rather than `WritablePath | str`.

7 months agogh-115684: Clarify datetime `replace` documentation (#116519)
David Lowry-Duda [Mon, 24 Mar 2025 15:33:16 +0000 (11:33 -0400)] 
gh-115684: Clarify datetime `replace` documentation (#116519)

* Clarify datetime `replace` documentation

In #115684, HopedForLuck noted that `datetime.date.replace()`
documentation was confusing because it looked like it would be changing
immutable objects.

This documentation change specifies that the `replace()` methods in
`datetime` return new objects. This uses similar wording to the
documentation for `datetime.combine()`, which specifies that a new
datetime is returned. This is also similar to wording for
`string.replace()`, except `string.replace()` emphasizes that a "copy"
is returned.

Resolves #115684.

* Include reviewer comments

Thanks Privat33r-dev for the comments!

---------

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
7 months agoGH-128520: pathlib ABCs: validate `magic_open()` arguments (#131617)
Barney Gale [Mon, 24 Mar 2025 15:13:18 +0000 (15:13 +0000)] 
GH-128520: pathlib ABCs: validate `magic_open()` arguments (#131617)

When `pathlib._os.magic_open()` is called to open a path in binary mode,
raise `ValueError` if any of the *encoding*, *errors* or *newline*
arguments are given. This matches the `open()` built-in.

7 months agoGH-128520: pathlib ABCs: reject empty pattern in `ReadablePath.glob()` (#127343)
Barney Gale [Mon, 24 Mar 2025 15:12:29 +0000 (15:12 +0000)] 
GH-128520: pathlib ABCs: reject empty pattern in `ReadablePath.glob()` (#127343)

For compatibility with `Path.glob()`, raise `ValueError` if an empty
pattern is given to `ReadablePath.glob()`.

7 months agoGH-131296: Remove unused variable from _wmimodule.cpp (GH-131587)
Chris Eibl [Mon, 24 Mar 2025 14:57:07 +0000 (15:57 +0100)] 
GH-131296: Remove unused variable from _wmimodule.cpp (GH-131587)

7 months agogh-111178: Fix function signatures for test_socket (#131667)
Victor Stinner [Mon, 24 Mar 2025 14:51:32 +0000 (15:51 +0100)] 
gh-111178: Fix function signatures for test_socket (#131667)

Add unicode_fsdecode() wrapper for PyUnicode_DecodeFSDefault() to use
the correct API for Py_BuildValue() converter API.

7 months agogh-111178: fix UBSan failures for `anextawaitableobject` (#131609)
Bénédikt Tran [Mon, 24 Mar 2025 14:43:48 +0000 (15:43 +0100)] 
gh-111178: fix UBSan failures for `anextawaitableobject` (#131609)

7 months agogh-111178: Skip tests which require deep stack if UBsan (#131669)
Victor Stinner [Mon, 24 Mar 2025 14:33:56 +0000 (15:33 +0100)] 
gh-111178: Skip tests which require deep stack if UBsan (#131669)

If Python is built with Undefined Behavior sanitizer, skip
test_repr_deep() of test_userdict and test_lru_recursion() of
test_functools.

7 months agogh-111178: Fix function signatures for test_capi (#131659)
Victor Stinner [Mon, 24 Mar 2025 14:04:45 +0000 (15:04 +0100)] 
gh-111178: Fix function signatures for test_capi (#131659)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-111178: Fix function signature for test_threading (#131663)
Victor Stinner [Mon, 24 Mar 2025 13:56:45 +0000 (14:56 +0100)] 
gh-111178: Fix function signature for test_threading (#131663)

7 months agogh-128421: Avoid TSAN warnings in `sys._current_frames()` (gh-131548)
Sam Gross [Mon, 24 Mar 2025 13:49:39 +0000 (09:49 -0400)] 
gh-128421: Avoid TSAN warnings in `sys._current_frames()` (gh-131548)

This tells TSAN not to sanitize `PyUnstable_InterpreterFrame_GetLine()`.
There's a possible data race on the access to the frame's `instr_ptr`
if the frame is currently executing. We don't really care about the
race. In theory, we could use relaxed atomics for every access to
`instr_ptr`, but that would create more code churn and current compilers
are overly conservative with optimizations around relaxed atomic
accesses.

We also don't sanitize `_PyFrame_IsIncomplete()` because it accesses
`instr_ptr` and is called from assertions within PyFrame_GetCode().

7 months agogh-111178: Fix function signatures for test_zoneinfo (#131664)
Victor Stinner [Mon, 24 Mar 2025 13:32:46 +0000 (14:32 +0100)] 
gh-111178: Fix function signatures for test_zoneinfo (#131664)

7 months agogh-111178: Fix function signatures for test_ctypes (#131660)
Victor Stinner [Mon, 24 Mar 2025 13:30:13 +0000 (14:30 +0100)] 
gh-111178: Fix function signatures for test_ctypes (#131660)

7 months agogh-128715: Expose ctypes.CField, with info attributes (GH-128950)
Petr Viktorin [Mon, 24 Mar 2025 13:18:34 +0000 (14:18 +0100)] 
gh-128715: Expose ctypes.CField, with info attributes (GH-128950)

- Restore max field size to sys.maxsize, as in Python 3.13 & below
- PyCField: Split out bit/byte sizes/offsets.
- Expose CField's size/offset data to Python code
- Add generic checks for all the test structs/unions, using the newly exposed attrs

7 months agogh-131311: Extract _replace_array_elements from PyCStructUnionType_update_stginfo...
Sergey Miryanov [Mon, 24 Mar 2025 12:55:09 +0000 (17:55 +0500)] 
gh-131311: Extract _replace_array_elements from PyCStructUnionType_update_stginfo (GH-131504)

7 months agogh-128485: ensure that dlmalloc initializes itself at import time in ctypes (#131633)
Kumar Aditya [Mon, 24 Mar 2025 12:44:25 +0000 (18:14 +0530)] 
gh-128485: ensure that dlmalloc initializes itself at import time in ctypes  (#131633)

7 months agogh-131311: Fix additional memory leaks in ctypes (GH-131429)
Sergey Miryanov [Mon, 24 Mar 2025 12:42:10 +0000 (17:42 +0500)] 
gh-131311: Fix additional memory leaks in ctypes (GH-131429)

* Visit keep in StructParam_traverse
* Decref swapped in PyCSimpleType_init
* Decref ob in make_funcptrtype_dict
* Check Pointer_item result while constructing result list in Pointer_subscript

* Fix align and size naming in PyCStructUnionType_update_stginfo
  - as discussed in previous PR

7 months agogh-131645: fix ResourceWarnings in `test_asyncio.test_events` (#131646)
Thomas Grainger [Mon, 24 Mar 2025 12:38:33 +0000 (12:38 +0000)] 
gh-131645: fix ResourceWarnings in `test_asyncio.test_events` (#131646)

7 months agogh-123909: Remove obsolete note in PyType_FromMetaclass docs (GH-131506)
Petr Viktorin [Mon, 24 Mar 2025 12:06:21 +0000 (13:06 +0100)] 
gh-123909: Remove obsolete note in PyType_FromMetaclass docs (GH-131506)

Docs of the other `PyType_From*` functions link to `PyType_FromMetaclass`,
which noted that they differ for backwards compatibility reasons.
The note is no longer relevant in 3.14.
The other functions have `versionchanged` blurbs.

7 months agogh-111178: fix UBSan failures for `Modules/_testcapimodule.c` (#131614)
Bénédikt Tran [Mon, 24 Mar 2025 10:14:22 +0000 (11:14 +0100)] 
gh-111178: fix UBSan failures for `Modules/_testcapimodule.c` (#131614)

Fix UBSan failures for various classes in `Modules/_testcapimodule.c`,
remove some redundant casts and add some `Py_UNUSED()` usages.

7 months agogh-111178: fix UBSan failures for `Modules/_testcapi/{buffer,monitoring}.c` (#131613)
Bénédikt Tran [Mon, 24 Mar 2025 10:06:37 +0000 (11:06 +0100)] 
gh-111178: fix UBSan failures for `Modules/_testcapi/{buffer,monitoring}.c` (#131613)

7 months agogh-111178: fix UBSan failures for `PyBytesObject` (#131603)
Bénédikt Tran [Mon, 24 Mar 2025 10:02:09 +0000 (11:02 +0100)] 
gh-111178: fix UBSan failures for `PyBytesObject` (#131603)

7 months agogh-111178: fix UBSan failures for `Python/legacy_tracing.c` (#131611)
Bénédikt Tran [Mon, 24 Mar 2025 10:00:32 +0000 (11:00 +0100)] 
gh-111178: fix UBSan failures for `Python/legacy_tracing.c` (#131611)

7 months agogh-111178: fix UBSan failures for `Modules/_testmultiphase.c` (#131615)
Bénédikt Tran [Mon, 24 Mar 2025 09:59:30 +0000 (10:59 +0100)] 
gh-111178: fix UBSan failures for `Modules/_testmultiphase.c` (#131615)

7 months agogh-111178: fix UBSan failures for `Python/instrumentation.c` (#131608)
Bénédikt Tran [Mon, 24 Mar 2025 09:58:33 +0000 (10:58 +0100)] 
gh-111178: fix UBSan failures for `Python/instrumentation.c` (#131608)

7 months agogh-111178: fix UBSan failures for `PyStdPrinter_Object` (#131607)
Bénédikt Tran [Mon, 24 Mar 2025 09:57:14 +0000 (10:57 +0100)] 
gh-111178: fix UBSan failures for `PyStdPrinter_Object` (#131607)

7 months agogh-111178: fix UBSan failures for `_PyExecutorObject` (#131610)
Bénédikt Tran [Mon, 24 Mar 2025 09:53:23 +0000 (10:53 +0100)] 
gh-111178: fix UBSan failures for `_PyExecutorObject` (#131610)

7 months agogh-111178: fix UBSan failures for `PyBufferWrapper` (#131616)
Bénédikt Tran [Mon, 24 Mar 2025 09:52:52 +0000 (10:52 +0100)] 
gh-111178: fix UBSan failures for `PyBufferWrapper` (#131616)

7 months agogh-111178: fix UBSan failures for `Modules/_testbuffer.c` (#131612)
Bénédikt Tran [Mon, 24 Mar 2025 09:46:25 +0000 (10:46 +0100)] 
gh-111178: fix UBSan failures for `Modules/_testbuffer.c` (#131612)

7 months agogh-111178: fix UBSan failures for `TaskStepMethWrapper` (#131602)
Bénédikt Tran [Sun, 23 Mar 2025 14:26:03 +0000 (15:26 +0100)] 
gh-111178: fix UBSan failures for `TaskStepMethWrapper` (#131602)

7 months agono-issue: Fix typo in importlib.metadata.rst (gh-131596)
Zsolt Dollenstein [Sun, 23 Mar 2025 14:01:29 +0000 (14:01 +0000)] 
no-issue: Fix typo in importlib.metadata.rst (gh-131596)

7 months agogh-130080: do not fold match case constants in unoptimized AST (#131577)
Irit Katriel [Sun, 23 Mar 2025 13:50:14 +0000 (13:50 +0000)] 
gh-130080: do not fold match case constants in unoptimized AST (#131577)

7 months agogh-130283: update deprecated links and examples in `urllib.request` docs (#130284)
Kanishk Pachauri [Sun, 23 Mar 2025 13:29:29 +0000 (13:29 +0000)] 
gh-130283: update deprecated links and examples in `urllib.request` docs (#130284)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-121529: Document `from_` parameter in `_mboxMMDF` public methods (#121530)
Sebb [Sun, 23 Mar 2025 12:10:47 +0000 (12:10 +0000)] 
gh-121529: Document `from_` parameter in `_mboxMMDF` public methods (#121530)

7 months agogh-131418: remove unused legacy typedefs in `{md5,sha1}module.c` (#131420)
Bénédikt Tran [Sun, 23 Mar 2025 11:19:26 +0000 (12:19 +0100)] 
gh-131418: remove unused legacy typedefs in `{md5,sha1}module.c` (#131420)

- Remove legacy typedefs `MD5_INT32` and `MD5_INT64` in `Modules/md5module.c`
- Remove legacy typedefs `SHA1_INT32` and `SHA1_INT64` in `Modules/sha1module.c`.

Those legacy typedefs were used to detect whether the host platform could
correctly implement MD5 and SHA-1, but this is no longer needed as we now
fallback to HACL* implementations.

7 months agogh-131357: Add a set of asserts to test.test_capi.test_bytearray (#131554)
Nybblista [Sun, 23 Mar 2025 07:20:40 +0000 (10:20 +0300)] 
gh-131357: Add a set of asserts to test.test_capi.test_bytearray (#131554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.

7 months agoGH-131296: fix clang-cl warning on Windows in semaphore.c (GH-131595)
Chris Eibl [Sat, 22 Mar 2025 22:44:56 +0000 (23:44 +0100)] 
GH-131296: fix clang-cl warning on Windows in semaphore.c (GH-131595)

fix clangcl warning

7 months agogh-131566: Skip `test_tracemalloc_track_race` under TSAN (gh-131567)
Sam Gross [Sat, 22 Mar 2025 15:46:36 +0000 (11:46 -0400)] 
gh-131566: Skip `test_tracemalloc_track_race` under TSAN (gh-131567)

The test has data race when setting the global "raw" memory allocator.

7 months agogh-131296: fix clang-cl warning in tracemalloc.c (#131514)
Victor Stinner [Sat, 22 Mar 2025 09:38:47 +0000 (10:38 +0100)] 
gh-131296: fix clang-cl warning in tracemalloc.c (#131514)

Always set MAX_NFRAME to UINT16_MAX.

Avoid the complicated code which emitted a compiler warning.

7 months agogh-131457: Fix typo in BNF description of function signatures (#131460)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Sat, 22 Mar 2025 07:54:48 +0000 (13:24 +0530)] 
gh-131457: Fix typo in BNF description of function signatures (#131460)

7 months agogh-131238: Add missing pycore_function.h includes for JIT compiler (#131571)
Victor Stinner [Fri, 21 Mar 2025 23:37:49 +0000 (00:37 +0100)] 
gh-131238: Add missing pycore_function.h includes for JIT compiler (#131571)

7 months agogh-130312: SET_ADD should not lock (#130136)
Dino Viehland [Fri, 21 Mar 2025 22:58:32 +0000 (15:58 -0700)] 
gh-130312: SET_ADD should not lock (#130136)

SET_ADD should not lock

7 months agogh-131238: Move _Py_VISIT_STACKREF() to pycore_stackref.h (#131560)
Victor Stinner [Fri, 21 Mar 2025 22:24:14 +0000 (23:24 +0100)] 
gh-131238: Move _Py_VISIT_STACKREF() to pycore_stackref.h (#131560)

* Move _Py_VISIT_STACKREF() from pycore_gc.h to pycore_stackref.h.
* Remove pycore_interpframe.h include from pycore_genobject.h.
* Remove now useless includes from C files.
* Add pycore_interpframe_structs.h to Makefile.pre.in and
  pythoncore.vcxproj.

7 months agoGH-128520: pathlib ABCs: allow tests to be run externally (#131315)
Barney Gale [Fri, 21 Mar 2025 22:18:20 +0000 (22:18 +0000)] 
GH-128520: pathlib ABCs: allow tests to be run externally (#131315)

Adjust the tests for the `pathlib.types` module so that they can be run
against the `pathlib-abc` PyPI package, which is a backport of the module
for older Python versions.

Specifically, we add a `.support.is_pypi` switch that is false in the
stdlib and true in the pathlib-abc package. This controls which package
we import, and whether or not we run tests against `PurePath` and `Path`.

For compatibility with older Python versions, we stop using
`zipfile.ZipFile.mkdir()` and `zipfile.ZipInfo._for_archive()`.

7 months agogh-117657: Skip some tests when running with TSAN (gh-131555)
Sam Gross [Fri, 21 Mar 2025 19:16:08 +0000 (15:16 -0400)] 
gh-117657: Skip some tests when running with TSAN (gh-131555)

The subinterpreter tests have data races (see gh-129824).

TSAN attempts to intercept some of the fatal signals, which can lead to
bogus reports. We could possibly handle these via TSAN_OPTIONS, but it's
simpler to just skip those tests -- they're not multithreaded anyways.

7 months agoGH-130415: Optimize constant comparison in JIT builds (GH-131489)
Savannah Ostrowski [Fri, 21 Mar 2025 18:23:12 +0000 (11:23 -0700)] 
GH-130415: Optimize constant comparison in JIT builds (GH-131489)

7 months agogh-117657: Fix TSAN data race in _PyEval_SetTrace assertion (gh-131561)
Sam Gross [Fri, 21 Mar 2025 18:22:37 +0000 (14:22 -0400)] 
gh-117657: Fix TSAN data race in _PyEval_SetTrace assertion (gh-131561)

The `sys_tracing_threads` variable should be read inside `LOCK_SETUP()`.

7 months agogh-131233: remove return-in-finally in multiprocessing/connection.py (#131416)
Irit Katriel [Fri, 21 Mar 2025 18:05:47 +0000 (18:05 +0000)] 
gh-131233: remove return-in-finally in multiprocessing/connection.py (#131416)

7 months agogh-131507: Refactor screen and cursor position calculations (GH-131547)
Łukasz Langa [Fri, 21 Mar 2025 17:27:35 +0000 (18:27 +0100)] 
gh-131507: Refactor screen and cursor position calculations (GH-131547)

This is based off #131509.

7 months agogh-131238: Add pycore_interpframe_structs.h header (#131553)
Victor Stinner [Fri, 21 Mar 2025 17:19:47 +0000 (18:19 +0100)] 
gh-131238: Add pycore_interpframe_structs.h header (#131553)

Add an explicit include to pycore_interpframe_structs.h in
pycore_runtime_structs.h to fix a dependency cycle.

7 months agogh-131238: Remove pycore_object_deferred.h from pycore_object.h (#131549)
Victor Stinner [Fri, 21 Mar 2025 16:44:10 +0000 (17:44 +0100)] 
gh-131238: Remove pycore_object_deferred.h from pycore_object.h (#131549)

Remove also pycore_function.h from pycore_typeobject.h.

7 months agogh-131238: Add pycore_interpframe.h to PYTHON_HEADERS (#131545)
Victor Stinner [Fri, 21 Mar 2025 15:24:15 +0000 (16:24 +0100)] 
gh-131238: Add pycore_interpframe.h to PYTHON_HEADERS (#131545)

Add pycore_interpframe.h to Makefile.pre.in and pythoncore.vcxproj.

7 months agogh-128421: Add locking to most frame object functions (gh-131479)
Sam Gross [Fri, 21 Mar 2025 15:10:07 +0000 (11:10 -0400)] 
gh-128421: Add locking to most frame object functions (gh-131479)

This makes more operations on frame objects thread-safe in the free
threaded build, which fixes some data races that occurred when passing
exceptions between threads.

However, accessing local variables from another thread while its running
is still not thread-safe and may crash the interpreter.

7 months agogh-131507: Clean up tests and type checking for `_pyrepl` (#131509)
Łukasz Langa [Fri, 21 Mar 2025 14:48:10 +0000 (15:48 +0100)] 
gh-131507: Clean up tests and type checking for `_pyrepl` (#131509)

7 months agoGH-131513: Cases generator: Allow dead inputs to be reassigned (GH-131515)
Mark Shannon [Fri, 21 Mar 2025 11:38:17 +0000 (11:38 +0000)] 
GH-131513: Cases generator: Allow dead inputs to be reassigned (GH-131515)

7 months agogh-131268: Implement thread names on OpenBSD (#131528)
Xavier G. [Fri, 21 Mar 2025 10:12:35 +0000 (11:12 +0100)] 
gh-131268: Implement thread names on OpenBSD (#131528)

7 months agogh-70647: Raise a more informative error for when date is out of range (GH-131335)
Stan Ulbrych [Fri, 21 Mar 2025 03:47:09 +0000 (03:47 +0000)] 
gh-70647: Raise a more informative error for when date is out of range (GH-131335)

More informative error messages mean less debugging what went wrong.

7 months agogh-120144: Disable the CALL event when possible to achieve zero overhead pdb (#131390)
Tian Gao [Fri, 21 Mar 2025 00:31:55 +0000 (20:31 -0400)] 
gh-120144: Disable the CALL event when possible to achieve zero overhead pdb (#131390)

7 months agoGH-131331: Rename "not" to "invert" (GH-131334)
Bénédikt Tran [Thu, 20 Mar 2025 23:59:41 +0000 (00:59 +0100)] 
GH-131331: Rename "not" to "invert" (GH-131334)

7 months agogh-131269: Minor optimization in random.py (#131270)
Sam Gross [Thu, 20 Mar 2025 22:10:33 +0000 (18:10 -0400)] 
gh-131269: Minor optimization in random.py (#131270)

7 months agogh-131435: random.randint optimization (gh-131436)
dgpb [Thu, 20 Mar 2025 22:07:28 +0000 (00:07 +0200)] 
gh-131435: random.randint optimization (gh-131436)

7 months agogh-131492, gh-131461: handle exceptions in GzipFile constructor while owning resource...
Thomas Grainger [Thu, 20 Mar 2025 17:06:21 +0000 (17:06 +0000)] 
gh-131492, gh-131461: handle exceptions in GzipFile constructor while owning resources (#131462)

Co-authored-by: Victor Stinner <vstinner@python.org>
7 months agogh-88887: Cleanup `multiprocessing.resource_tracker.ResourceTracker` upon deletion...
luccabb [Thu, 20 Mar 2025 16:44:37 +0000 (09:44 -0700)] 
gh-88887: Cleanup `multiprocessing.resource_tracker.ResourceTracker` upon deletion (#130429)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
7 months agogh-131453: Add additional constants to winsound module (GH-131454)
AN Long [Thu, 20 Mar 2025 16:35:52 +0000 (01:35 +0900)] 
gh-131453: Add additional constants to winsound module (GH-131454)

7 months agoGH-131296: fix clang-cl warnings in sysmodule.c (#131304)
Chris Eibl [Thu, 20 Mar 2025 16:29:21 +0000 (17:29 +0100)] 
GH-131296: fix clang-cl warnings in sysmodule.c (#131304)

7 months agogh-130080: fix warnings in tests (#131471)
Irit Katriel [Thu, 20 Mar 2025 16:11:04 +0000 (16:11 +0000)] 
gh-130080: fix warnings in tests (#131471)

7 months agoGH-127705: Don't call _Py_ForgetReference before _Py_Dealloc (GH-131508)
Mark Shannon [Thu, 20 Mar 2025 15:45:43 +0000 (15:45 +0000)] 
GH-127705: Don't call _Py_ForgetReference before _Py_Dealloc (GH-131508)

7 months agoGH-131498: Remove conditional stack effects (GH-131499)
Mark Shannon [Thu, 20 Mar 2025 15:39:38 +0000 (15:39 +0000)] 
GH-131498: Remove conditional stack effects (GH-131499)

* Adds some missing #includes

7 months agogh-127833: Use `productionlist` nodes to implement the `grammar-snippet` directive...
Adam Turner [Thu, 20 Mar 2025 15:35:20 +0000 (15:35 +0000)] 
gh-127833: Use `productionlist` nodes to implement the `grammar-snippet` directive (#130376)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
7 months agogh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990)
Peter Bierma [Thu, 20 Mar 2025 12:06:59 +0000 (08:06 -0400)] 
gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990)

Co-authored-by: Victor Stinner <vstinner@python.org>
7 months agoGH-130296: Remove `_PyOpcode_max_stack_effect` as it is no longer used (GH-131493)
Mark Shannon [Thu, 20 Mar 2025 11:42:54 +0000 (11:42 +0000)] 
GH-130296: Remove `_PyOpcode_max_stack_effect` as it is no longer used (GH-131493)

7 months agogh-131238: Remove includes from pycore_interp.h (#131495)
Victor Stinner [Thu, 20 Mar 2025 11:35:23 +0000 (12:35 +0100)] 
gh-131238: Remove includes from pycore_interp.h (#131495)

Remove also now unused includes in C files.

7 months agogh-111178: Fix function signatures for multiple tests (#131496)
Victor Stinner [Thu, 20 Mar 2025 11:27:03 +0000 (12:27 +0100)] 
gh-111178: Fix function signatures for multiple tests (#131496)

7 months agoFix Windows build warnings (#131487)
Victor Stinner [Thu, 20 Mar 2025 11:03:20 +0000 (12:03 +0100)] 
Fix Windows build warnings (#131487)

Fix the following warnings:

* Modules\_io\fileio.c(1296,13): unused variable 'self'
* Modules\_io\winconsoleio.c(334,9): unused variable 'fd_is_own'
* Modules\faulthandler.c(409,11): unused variable 'flags'
* Modules\posixmodule.c(5699,9): unused variable 'pathError'
* PC\winreg.c(2077,5): suggest braces around initialization of
  subobject
* PC\winreg.c(34,13): unused variable 'errNotAHandle'
* Python\fileutils.c(132,12): result of comparison of constant
  1114111 with expression of type 'wchar_t' (aka 'unsigned short') is
  always false
* Python\fileutils.c(58,21): unused variable 'INCOMPLETE_CHARACTER'
* Python\sysmodule.c(2534,21): unused variable 'perf_map_state'

7 months agogh-131441: Add a set of asserts to test.test_capi.test_list (#131442)
Nybblista [Thu, 20 Mar 2025 10:12:15 +0000 (13:12 +0300)] 
gh-131441: Add a set of asserts to test.test_capi.test_list (#131442)

7 months agogh-128421: add critical section around `traceback.tb_next` (#131322)
Kumar Aditya [Thu, 20 Mar 2025 06:33:54 +0000 (12:03 +0530)] 
gh-128421: add critical section around `traceback.tb_next` (#131322)

7 months agogh-131401: fix data races in exception handling (#131447)
Kumar Aditya [Thu, 20 Mar 2025 06:32:05 +0000 (12:02 +0530)] 
gh-131401: fix data races in exception handling (#131447)

7 months agoGH-123599: Deprecate duplicate `pathname2url()` implementation (#127380)
Barney Gale [Thu, 20 Mar 2025 00:54:36 +0000 (00:54 +0000)] 
GH-123599: Deprecate duplicate `pathname2url()` implementation (#127380)

Call `urllib.request.pathname2url()` from `pathlib.Path.as_uri()`, and
deprecate the duplicate implementation in `PurePath`.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months agogh-131238: Cleanup pycore_runtime.h includes (#131486)
Victor Stinner [Thu, 20 Mar 2025 00:47:30 +0000 (01:47 +0100)] 
gh-131238: Cleanup pycore_runtime.h includes (#131486)

7 months agogh-131238: Remove pycore_lock.h includes (#131483)
Victor Stinner [Wed, 19 Mar 2025 23:46:25 +0000 (00:46 +0100)] 
gh-131238: Remove pycore_lock.h includes (#131483)

PyMutex type is now part of <Python.h>, it's no longer needed to
include <pycore_lock.h> to get it.

7 months agogh-131238: Move pycore_obmalloc.h include to pycore_runtime_structs.h (#131482)
Victor Stinner [Wed, 19 Mar 2025 23:32:30 +0000 (00:32 +0100)] 
gh-131238: Move pycore_obmalloc.h include to pycore_runtime_structs.h (#131482)

Move pycore_obmalloc.h include from pycore_interp_structs.h to
pycore_runtime_structs.h.

Add also comment explaining the purpose of each include in
pycore_interp_structs.h, pycore_runtime_structs.h and
pycore_structs.h.

Remove <stdbool.h> and <stddef.h> from pycore_structs.h.

7 months agogh-131238: Use pycore_interp_structs.h header (#131481)
Victor Stinner [Wed, 19 Mar 2025 23:13:25 +0000 (00:13 +0100)] 
gh-131238: Use pycore_interp_structs.h header (#131481)

Replace pycore_runtime_structs.h include with pycore_interp_structs.h
include in internal headers.

7 months agogh-129598: ast: allow multi stmts for ast single with ';' (#129620)
Tomasz Pytel [Wed, 19 Mar 2025 22:29:40 +0000 (18:29 -0400)] 
gh-129598: ast: allow multi stmts for ast single with ';' (#129620)

7 months agogh-131238: Remove more includes from pycore_interp.h (#131480)
Victor Stinner [Wed, 19 Mar 2025 22:01:32 +0000 (23:01 +0100)] 
gh-131238: Remove more includes from pycore_interp.h (#131480)

7 months agoGH-123599: Remove duplicate `url2pathname()` implementation (#127237)
Barney Gale [Wed, 19 Mar 2025 21:08:32 +0000 (21:08 +0000)] 
GH-123599: Remove duplicate `url2pathname()` implementation (#127237)

Call `urllib.request.url2pathname()` from `pathlib.Path.from_uri()` rather
than re-implementing it. This paves the way for solving the main issue
(ignoring local authorities and rejecting non-local ones) in urllib, not
pathlib.

7 months agogh-126835: Move constant tuple folding from ast_opt to CFG (#130769)
Yan Yanchii [Wed, 19 Mar 2025 20:59:55 +0000 (21:59 +0100)] 
gh-126835: Move constant tuple folding from ast_opt to CFG (#130769)

7 months agoGH-131473: Add missing %(AdditionalOptions) reference to pythoncore.vcxproj (GH-131475)
Chris Eibl [Wed, 19 Mar 2025 19:50:04 +0000 (20:50 +0100)] 
GH-131473: Add missing %(AdditionalOptions) reference to pythoncore.vcxproj (GH-131475)

7 months agoGH-125866: Deprecate `nturl2path` module (#131432)
Barney Gale [Wed, 19 Mar 2025 19:33:01 +0000 (19:33 +0000)] 
GH-125866: Deprecate `nturl2path` module (#131432)

Deprecate the `nturl2path` module. Its functionality is merged into
`urllib.request`.

Add `tests.test_nturl2path` to exercise `nturl2path`, as it's no longer
covered by `test_urllib`.

7 months agoGH-130956: Only emit AArch64 trampolines for long jumps (GH-131041)
Diego Russo [Wed, 19 Mar 2025 19:19:21 +0000 (19:19 +0000)] 
GH-130956: Only emit AArch64 trampolines for long jumps (GH-131041)

7 months agogh-91349: Replace zlib with zlib-ng in Windows build (GH-131438)
Steve Dower [Wed, 19 Mar 2025 19:03:25 +0000 (19:03 +0000)] 
gh-91349: Replace zlib with zlib-ng in Windows build (GH-131438)