]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
22 months ago[pprint]: Add docstring about `PrettyPrinter.underscore_numbers` parameter (#112963)
Sequew [Wed, 13 Dec 2023 12:04:17 +0000 (15:04 +0300)] 
[pprint]: Add docstring about `PrettyPrinter.underscore_numbers` parameter (#112963)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
22 months agogh-112962: in dis module, put cache information in the Instruction instead of creatin...
Irit Katriel [Wed, 13 Dec 2023 12:00:21 +0000 (12:00 +0000)] 
gh-112962: in dis module, put cache information in the Instruction instead of creating fake Instructions to represent it (#113016)

22 months agogh-101100: Fix Sphinx warning in references with asterisks (#113029)
Hugo van Kemenade [Wed, 13 Dec 2023 07:24:55 +0000 (09:24 +0200)] 
gh-101100: Fix Sphinx warning in references with asterisks (#113029)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
22 months agogh-101336: Add keep_alive keyword arg for asyncio create_server() (#112485)
beavailable [Wed, 13 Dec 2023 03:23:29 +0000 (11:23 +0800)] 
gh-101336: Add keep_alive keyword arg for asyncio create_server() (#112485)

22 months agogh-112622: Pass name to loop create_task method (#112623)
Jamie [Wed, 13 Dec 2023 01:26:40 +0000 (12:26 +1100)] 
gh-112622: Pass name to loop create_task method (#112623)

This affects task creation through either `asyncio.create_task()` or `TaskGroup.create_task()` -- the redundant call to `task.set_name()` is skipped. We still call `set_name()` when a task factory is involved, because the task factory call signature (unfortunately) doesn't take a `name` argument.

22 months agogh-76785: Avoid Pickled TracebackException for Propagated Subinterpreter Exceptions...
Eric Snow [Wed, 13 Dec 2023 00:31:30 +0000 (17:31 -0700)] 
gh-76785: Avoid Pickled TracebackException for Propagated Subinterpreter Exceptions (gh-113036)

We need the TracebackException of uncaught exceptions for a single purpose: the error display.  Thus we only need to pass the formatted error display between interpreters.  Passing a pickled TracebackException is overkill.

22 months agogh-112989: asyncio: Reduce overhead to connect sockets with SelectorEventLoop (#112991)
J. Nick Koston [Wed, 13 Dec 2023 00:29:21 +0000 (14:29 -1000)] 
gh-112989: asyncio: Reduce overhead to connect sockets with SelectorEventLoop (#112991)

_ensure_fd_no_transport had a KeyError in the success path

22 months agogh-112723: Call `PyThreadState_Clear()` from the correct interpreter (#112776)
Sam Gross [Wed, 13 Dec 2023 00:20:21 +0000 (19:20 -0500)] 
gh-112723: Call `PyThreadState_Clear()` from the correct interpreter (#112776)

The `PyThreadState_Clear()` function must only be called with the GIL
held and must be called from the same interpreter as the passed in
thread state. Otherwise, any Python objects on the thread state may be
destroyed using the wrong interpreter, leading to memory corruption.

This is also important for `Py_GIL_DISABLED` builds because free lists
will be associated with PyThreadStates and cleared in
`PyThreadState_Clear()`.

This fixes two places that called `PyThreadState_Clear()` from the wrong
interpreter and adds an assertion to `PyThreadState_Clear()`.

22 months agogh-76785: Show the Traceback for Uncaught Subinterpreter Exceptions (gh-113034)
Eric Snow [Wed, 13 Dec 2023 00:00:54 +0000 (17:00 -0700)] 
gh-76785: Show the Traceback for Uncaught Subinterpreter Exceptions (gh-113034)

When an exception is uncaught in Interpreter.exec_sync(), it helps to show that exception's error display if uncaught in the calling interpreter.  We do so here by generating a TracebackException in the subinterpreter and passing it between interpreters using pickle.

22 months agogh-112320: Implement on-trace confidence tracking for branches (#112321)
Guido van Rossum [Tue, 12 Dec 2023 21:43:08 +0000 (13:43 -0800)] 
gh-112320: Implement on-trace confidence tracking for branches (#112321)

We track the confidence as a scaled int.

22 months agogh-113010: Don't decrement deferred in pystats (#113032)
Michael Droettboom [Tue, 12 Dec 2023 21:17:08 +0000 (16:17 -0500)] 
gh-113010: Don't decrement deferred in pystats (#113032)

This fixes a recently introduced bug where the deferred count is being unnecessarily decremented to counteract an increment elsewhere that is no longer happening. This caused the values to flip around to "very large" 64-bit numbers.

22 months agogh-101100: Further improve docs on function attributes (#113001)
Alex Waygood [Tue, 12 Dec 2023 20:21:12 +0000 (20:21 +0000)] 
gh-101100: Further improve docs on function attributes (#113001)

22 months agoGH-108866: Guarantee forward progress in executors. (GH-113006)
Mark Shannon [Tue, 12 Dec 2023 19:02:24 +0000 (19:02 +0000)] 
GH-108866: Guarantee forward progress in executors. (GH-113006)

22 months agogh-76785: Add Interpreter.prepare_main() (gh-113021)
Eric Snow [Tue, 12 Dec 2023 18:06:06 +0000 (11:06 -0700)] 
gh-76785: Add Interpreter.prepare_main() (gh-113021)

This is one of the last pieces to get test.support.interpreters in sync with PEP 734.

22 months agogh-76785: More Fixes for test.support.interpreters (gh-113012)
Eric Snow [Tue, 12 Dec 2023 17:43:30 +0000 (10:43 -0700)] 
gh-76785: More Fixes for test.support.interpreters (gh-113012)

This brings the module (along with the associated extension modules) mostly in sync with PEP 734.  There are only a few small things to wrap up.

22 months agogh-76785: Fix test_threading on Non-Subinterpreter Builds (gh-113014)
Eric Snow [Tue, 12 Dec 2023 16:54:39 +0000 (09:54 -0700)] 
gh-76785: Fix test_threading on Non-Subinterpreter Builds (gh-113014)

gh-112982 broke test_threading on one of the s390 buildbots (Fedora Clang Installed).  Apparently ImportError is raised (rather than ModuleNotFoundError) for the name part of "from" imports.  This fixes that by catching ImportError in test_threading.py.

22 months agogh-112999: Replace the outdated "deprecated" directives with "versionchanged" (GH...
Serhiy Storchaka [Tue, 12 Dec 2023 16:31:04 +0000 (18:31 +0200)] 
gh-112999: Replace the outdated "deprecated" directives with "versionchanged" (GH-113000)

22 months agoUpdate pre-commit to fix Sphinx Lint (#113015)
Hugo van Kemenade [Tue, 12 Dec 2023 16:29:08 +0000 (18:29 +0200)] 
Update pre-commit to fix Sphinx Lint (#113015)

22 months agogh-76785: Fixes for test.support.interpreters (gh-112982)
Eric Snow [Tue, 12 Dec 2023 15:24:31 +0000 (08:24 -0700)] 
gh-76785: Fixes for test.support.interpreters (gh-112982)

This involves a number of changes for PEP 734.

22 months agogh-51944: fix type and missing addition in gh-112823 (#112996)
Ronald Oussoren [Tue, 12 Dec 2023 12:57:45 +0000 (13:57 +0100)] 
gh-51944: fix type and missing addition in gh-112823 (#112996)

Fix the defition of VDSUSP and add CCTS_OFLOW (which
was mentioned in NEWS, but not actually addded)

22 months agoGH-111485: Factor out tier 2 code generation from the rest of the interpreter code...
Mark Shannon [Tue, 12 Dec 2023 12:12:17 +0000 (12:12 +0000)] 
GH-111485: Factor out tier 2 code generation from the rest of the interpreter code generator (GH-112968)

22 months agogh-112970: Detect and use closefrom() when available (#112969)
Sam James [Tue, 12 Dec 2023 10:25:27 +0000 (10:25 +0000)] 
gh-112970: Detect and use closefrom() when available (#112969)

glibc-2.34 implements closefrom(3) using the same semantics as on BSD.
Check for closefrom() in configure and use the check result in
fileutils.c, rather than hardcoding a FreeBSD check.

Some implementations of closefrom() return an int. Explicitly discard
the return value by casting it to void, to avoid future compiler
warnings.

Signed-off-by: Sam James <sam@gentoo.org>
22 months agogh-87286: Add a number of LOG_* constants to syslog (#24432)
Ronald Oussoren [Tue, 12 Dec 2023 09:25:51 +0000 (10:25 +0100)] 
gh-87286: Add a number of LOG_* constants to syslog (#24432)

* bpo-43120: Add a number of LOG_* constants to syslog

This adds a number of syslog facilities to the syslogmodule.c.
These values are available on macOS.

* Switch contant documentation to the data directive

This fixes a CI warning and matches the pattern
used in the documentation for ``os``.

* Update Doc/library/syslog.rst

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
22 months agogh-112953: Rename idlelib/NEWS.txt to News3.txt and update (#112988)
Terry Jan Reedy [Tue, 12 Dec 2023 06:00:51 +0000 (01:00 -0500)] 
gh-112953: Rename idlelib/NEWS.txt to News3.txt and update (#112988)

22 months agogh-112983: Add the known magic value of 3495 for Python 3.11 bytecode (#112985)
wim glenn [Tue, 12 Dec 2023 01:47:12 +0000 (19:47 -0600)] 
gh-112983: Add the known magic value of 3495 for Python 3.11 bytecode (#112985)

Add the known magic value of 3495 for Python 3.11 bytecode

22 months agoA smattering of cleanups in uop debug output and lltrace (#112980)
Guido van Rossum [Tue, 12 Dec 2023 00:42:30 +0000 (16:42 -0800)] 
A smattering of cleanups in uop debug output and lltrace (#112980)

* Include destination T1 opcode in Error debug message
* Include destination T1 opcode in DEOPT debug message
* Remove obsolete comment from remove_unneeded_uops
* Change lltrace_instruction() to print caller's opcode/oparg

22 months agogh-112532: Require mimalloc in `--disable-gil` builds (gh-112883)
Sam Gross [Tue, 12 Dec 2023 00:04:48 +0000 (19:04 -0500)] 
gh-112532: Require mimalloc in `--disable-gil` builds (gh-112883)

22 months agogh-112978: Remove redundant condition inside `take_gil` (gh-112979)
Yan Yanchii [Mon, 11 Dec 2023 23:23:41 +0000 (00:23 +0100)] 
gh-112978: Remove redundant condition inside `take_gil` (gh-112979)

22 months agogh-71383: Update Tcl/Tk version in Windows to our patched build containing a targeted...
Steve Dower [Mon, 11 Dec 2023 21:54:17 +0000 (21:54 +0000)] 
gh-71383: Update Tcl/Tk version in Windows to our patched build containing a targeted upstream fix (GH-112973)

22 months agoGH-83162: Rename re.error for better clarity. (#101677)
achhina [Mon, 11 Dec 2023 20:45:08 +0000 (15:45 -0500)] 
GH-83162: Rename re.error for better clarity. (#101677)

Renamed re.error for clarity, and kept re.error for backward compatibility.
Updated idlelib files at TJR's request.
---------

Co-authored-by: Matthias Bussonnier <mbussonnier@ucmerced.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
22 months agogh-90350: Optimize builtin functions min() and max() (GH-30286)
colorfulappl [Mon, 11 Dec 2023 19:27:06 +0000 (03:27 +0800)] 
gh-90350: Optimize builtin functions min() and max() (GH-30286)

Builtin functions min() and max() now use METH_FASTCALL

22 months agogh-112529: Use atomic operations for `gcstate->collecting` (#112533)
Sam Gross [Mon, 11 Dec 2023 18:33:21 +0000 (13:33 -0500)] 
gh-112529: Use atomic operations for `gcstate->collecting` (#112533)

* gh-112529: Use atomic operations for `gcstate->collecting`

The `collecting` field in `GCState` is used to prevent overlapping garbage
collections within the same interpreter. This is updated to use atomic
operations in order to be thread-safe in `--disable-gil` builds.

The GC code is refactored a bit to support this. More of the logic is pushed
down to `gc_collect_main()` so that we can safely order the logic setting
`collecting`, the selection of the generation, and the invocation of callbacks
with respect to the atomic operations and the (future) stop-the-world pauses.

The change uses atomic operations for both `--disable-gil` and the default
build (with the GIL) to avoid extra `#ifdef` guards and ease the maintenance
burden.

22 months agogh-108303: Move `double_const` to `test_import` where it belongs (#112108)
Nikita Sobolev [Mon, 11 Dec 2023 18:29:43 +0000 (21:29 +0300)] 
gh-108303: Move `double_const` to `test_import` where it belongs (#112108)

22 months agogh-112507: Detect Cygwin and MSYS with `uname` instead of `$OSTYPE` (GH-112508)
James Morris [Mon, 11 Dec 2023 17:27:15 +0000 (12:27 -0500)] 
gh-112507: Detect Cygwin and MSYS with `uname` instead of `$OSTYPE` (GH-112508)

Detect Cygwin and MSYS with `uname` instead of `$OSTYPE`

`$OSTYPE` is not defined by POSIX and may not be present in other shells.
`uname` is always available in any shell.

22 months agogh-111178: Avoid calling functions from incompatible pointer types in memoryobject...
Christopher Chavez [Mon, 11 Dec 2023 16:43:07 +0000 (10:43 -0600)] 
gh-111178: Avoid calling functions from incompatible pointer types in memoryobject.c (GH-112863)

* Make memory_clear() compatible with inquiry
* Make memory_traverse() compatible with traverseproc
* Make memory_dealloc() compatible with destructor
* Make memory_repr() compatible with reprfunc
* Make memory_hash() compatible with hashfunc
* Make memoryiter_next() compatible with iternextfunc
* Make memoryiter_traverse() compatible with traverseproc
* Make memoryiter_dealloc() compatible with destructor
* Make several functions compatible with getter
* Make a few functions compatible with getter
* Make memory_item() compatible with ssizeargfunc
* Make memory_subscript() compatible with binaryfunc
* Make memory_length() compatible with lenfunc
* Make memory_ass_sub() compatible with objobjargproc
* Make memory_releasebuf() compatible with releasebufferproc
* Make memory_getbuf() compatible with getbufferproc
* Make mbuf_clear() compatible with inquiry
* Make mbuf_traverse() compatible with traverseproc
* Make mbuf_dealloc() compatible with destructor

22 months agogh-94606: Fix error when message with Unicode surrogate not surrogateescaped string...
Sidney Markowitz [Mon, 11 Dec 2023 16:21:18 +0000 (05:21 +1300)] 
gh-94606: Fix error when message with Unicode surrogate not surrogateescaped string (GH-94641)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
22 months agogh-112898: warn about unsaved files when quitting IDLE on macOS (#112939)
Ronald Oussoren [Mon, 11 Dec 2023 14:22:36 +0000 (15:22 +0100)] 
gh-112898: warn about unsaved files when quitting IDLE on macOS (#112939)

* gh-112898: warn about unsaved files when quitting IDLE on macOS

Implement the TK function ``::tk::mac::Quit`` on macOS to
ensure that IDLE asks about saving unsaved files when
quitting IDLE.

Co-authored-by: Christopher Chavez chrischavez@gmx.us
22 months agoGH-111485: Factor out generation of uop IDs from cases generator. (GH-112877)
Mark Shannon [Mon, 11 Dec 2023 14:14:36 +0000 (14:14 +0000)] 
GH-111485: Factor out generation of uop IDs from cases generator. (GH-112877)

22 months agoFix SyntaxWarning in test_syntax.py (GH-112944)
Anthony Sottile [Mon, 11 Dec 2023 11:48:52 +0000 (06:48 -0500)] 
Fix SyntaxWarning in test_syntax.py (GH-112944)

22 months agogh-112943: Correctly compute end offsets for multiline tokens in the tokenize module...
Pablo Galindo Salgado [Mon, 11 Dec 2023 11:44:22 +0000 (11:44 +0000)] 
gh-112943: Correctly compute end offsets for multiline tokens in the tokenize module (#112949)

22 months agogh-101100: Improve documentation on function attributes (#112933)
Alex Waygood [Mon, 11 Dec 2023 10:00:42 +0000 (10:00 +0000)] 
gh-101100: Improve documentation on function attributes (#112933)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
22 months agoGH-101986: Support translation for Limited/Unstable API & Stable ABI (#107680)
Adam Turner [Sun, 10 Dec 2023 19:17:07 +0000 (19:17 +0000)] 
GH-101986: Support translation for Limited/Unstable API & Stable ABI (#107680)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
22 months agoDoc: c-api: fix order of PyMemberDef fields (#112879)
Inada Naoki [Sun, 10 Dec 2023 17:43:17 +0000 (02:43 +0900)] 
Doc: c-api: fix order of PyMemberDef fields (#112879)

22 months agoAdd a fuzzer for `Py_CompileStringExFlags` (#111721)
Brad Larsen [Sun, 10 Dec 2023 17:16:15 +0000 (12:16 -0500)] 
Add a fuzzer for `Py_CompileStringExFlags` (#111721)

22 months agoArgument Clinic: fix bare "type" in annotations (#112915)
Jelle Zijlstra [Sun, 10 Dec 2023 15:30:02 +0000 (07:30 -0800)] 
Argument Clinic: fix bare "type" in annotations (#112915)

Bare "type" in annotations should be equivalent to "type[Any]"; see
https://discuss.python.org/t/inconsistencies-between-type-and-type/37404
and python/mypy#16366. It's better to use "type[object]", which is
safer and unambiguous.

22 months agogh-110686: Test pattern matching with `runtime_checkable` protocols (#110687)
Nikita Sobolev [Sun, 10 Dec 2023 15:21:20 +0000 (18:21 +0300)] 
gh-110686: Test pattern matching with `runtime_checkable` protocols (#110687)

22 months agogh-101100: Fix Sphinx warning in library/http.cookies.rst (#112908)
Hugo van Kemenade [Sun, 10 Dec 2023 12:53:26 +0000 (14:53 +0200)] 
gh-101100: Fix Sphinx warning in library/http.cookies.rst (#112908)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
22 months agogh-109980: Fix test_tarfile_vs_tar on macOS (#112905)
Ronald Oussoren [Sun, 10 Dec 2023 11:38:49 +0000 (12:38 +0100)] 
gh-109980: Fix test_tarfile_vs_tar on macOS (#112905)

On recentish macOS versions the system tar
command includes system metadata (ACLs, extended attributes
and resource forks) in the tar archive, which
shutil.make_archive will not do. This can cause
spurious test failures.

22 months agoDocs: Use 'f-strings' as header (#112888)
Hugo van Kemenade [Sun, 10 Dec 2023 08:39:51 +0000 (10:39 +0200)] 
Docs: Use 'f-strings' as header (#112888)

22 months agoIDLE: Tweak iomenu.IOBinding.maybesave (#112914)
Terry Jan Reedy [Sun, 10 Dec 2023 02:29:40 +0000 (21:29 -0500)] 
IDLE: Tweak iomenu.IOBinding.maybesave  (#112914)

Add docstring, use f-string, simplify code.

22 months agoGH-112906: Fix performance regression in pathlib path initialisation (#112907)
Barney Gale [Sun, 10 Dec 2023 00:06:27 +0000 (00:06 +0000)] 
GH-112906: Fix performance regression in pathlib path initialisation (#112907)

This was caused by 76929fdeeb, specifically its use of `super()` and its
packing/unpacking `*args`.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
22 months agogh-101100: Improve documentation of `TracebackType` attributes (#112884)
Alex Waygood [Sat, 9 Dec 2023 22:43:53 +0000 (22:43 +0000)] 
gh-101100: Improve documentation of `TracebackType` attributes (#112884)

22 months agogh-101100: Fix Sphinx nitpicks in `library/tempfile.rst` (#112886)
Alex Waygood [Sat, 9 Dec 2023 22:08:01 +0000 (22:08 +0000)] 
gh-101100: Fix Sphinx nitpicks in `library/tempfile.rst` (#112886)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
22 months agogh-112867: fix for WITH_PYMALLOC_RADIX_TREE=0 (GH-112885)
Neil Schemenauer [Sat, 9 Dec 2023 21:50:48 +0000 (13:50 -0800)] 
gh-112867: fix for WITH_PYMALLOC_RADIX_TREE=0 (GH-112885)

The _obmalloc_usage structure is only defined if the obmalloc radix tree
is enabled.

23 months agogh-110109: Fix installed buildbots now `pathlib` is a package (#112901)
Alex Waygood [Sat, 9 Dec 2023 18:05:33 +0000 (18:05 +0000)] 
gh-110109: Fix installed buildbots now `pathlib` is a package (#112901)

23 months agoGH-110109: Move pathlib ABCs to new `pathlib._abc` module. (#112881)
Barney Gale [Sat, 9 Dec 2023 15:07:40 +0000 (15:07 +0000)] 
GH-110109: Move pathlib ABCs to new `pathlib._abc` module. (#112881)

Move `_PurePathBase` and `_PathBase` to a new `pathlib._abc` module, and
drop the underscores from the class names.

Tests are mostly left alone in this commit, but they'll be similarly split
in a subsequent commit.

The `pathlib._abc` module will be published as an independent PyPI package
(similar to how `zipfile._path` is published as `zipp`), to be refined
and stabilised prior to its possible addition to the standard library.

23 months agogh-112720: Move instruction formatting from the dis.Instruction class to a new class...
Irit Katriel [Sat, 9 Dec 2023 10:03:02 +0000 (10:03 +0000)] 
gh-112720: Move instruction formatting from the dis.Instruction class to a new class dis.InstructionFormatter. Add the ArgResolver class. (#112722)

23 months agogh-112334: Regression test that vfork is used when expected. (#112734)
Gregory P. Smith [Sat, 9 Dec 2023 00:18:35 +0000 (16:18 -0800)] 
gh-112334: Regression test that vfork is used when expected. (#112734)

Regression test that vfork is used when expected by subprocess.

This is written integration test style, it uses strace if it is present and appears to work to find out what system call actually gets used in different scenarios.

Test coverage is added for the default behavior and that of each of the specific arguments that must disable the use of vfork.  obviously not an entire test matrix, but it covers the most important aspects.

If there are ever issues with this test being flaky or failing on new platforms, rather than try and adapt it for all possible platforms, feel free to narrow the range it gets tested on when appropriate. That is not likely to reduce coverage.

23 months agogh-112758: Updated pathlib documentation for PurePath.match (#112814)
Taylor Packard [Fri, 8 Dec 2023 18:13:17 +0000 (13:13 -0500)] 
gh-112758: Updated pathlib documentation for PurePath.match (#112814)

23 months agogh-112540: Support zero inputs in geometric_mean() (gh-112880)
Raymond Hettinger [Fri, 8 Dec 2023 18:05:56 +0000 (12:05 -0600)] 
gh-112540: Support zero inputs in geometric_mean() (gh-112880)

23 months agoGH-110109: Add `pathlib._PurePathBase` (#110670)
Barney Gale [Fri, 8 Dec 2023 17:39:04 +0000 (17:39 +0000)] 
GH-110109: Add `pathlib._PurePathBase` (#110670)

Add private `pathlib._PurePathBase` class: a private superclass of both `PurePath` and `_PathBase`. Unlike `PurePath`, it does not define any of these special methods: `__fspath__`, `__bytes__`, `__reduce__`, `__hash__`, `__eq__`, `__lt__`, `__le__`, `__gt__`, `__ge__`. Its initializer and path joining methods accept only strings, not os.PathLike objects more broadly.

This is important for supporting *virtual paths*: user subclasses of `_PathBase` that provide access to archive files, FTP servers, etc. In these classes, the above methods should be implemented by users only as appropriate, with due consideration for the hash/equality of any backing objects, such as file objects or sockets.

23 months agogh-112278: In _wmi, treat initialization timeout separately from connection timeout...
AN Long [Fri, 8 Dec 2023 16:52:22 +0000 (00:52 +0800)] 
gh-112278: In _wmi, treat initialization timeout separately from connection timeout (GH-112878)

23 months agogh-112779: Check 1-byte atomics in configure (gh-112819)
Sam Gross [Fri, 8 Dec 2023 16:31:32 +0000 (11:31 -0500)] 
gh-112779: Check 1-byte atomics in configure (gh-112819)

23 months agogh-112535: Update _Py_ThreadId() to support s390/s390x (gh-112751)
Donghee Na [Fri, 8 Dec 2023 14:28:07 +0000 (14:28 +0000)] 
gh-112535: Update _Py_ThreadId() to support s390/s390x (gh-112751)

23 months agogh-112302: Annotate SBOM file as generated in .gitattributes (#112854)
Seth Michael Larson [Fri, 8 Dec 2023 13:46:19 +0000 (07:46 -0600)] 
gh-112302: Annotate SBOM file as generated in .gitattributes (#112854)

Annotate SBOM file as generated in .gitattributes

23 months agogh-101100: Improve documentation for attributes on instance methods (#112832)
Alex Waygood [Fri, 8 Dec 2023 13:18:53 +0000 (13:18 +0000)] 
gh-101100: Improve documentation for attributes on instance methods (#112832)

23 months agogh-101100: Fix Sphinx nits in `library/contextlib.rst` (#112870)
Alex Waygood [Fri, 8 Dec 2023 13:17:57 +0000 (13:17 +0000)] 
gh-101100: Fix Sphinx nits in `library/contextlib.rst` (#112870)

23 months agogh-101100: Fix Sphinx nitpicks in `library/shelve.rst` (#112836)
Alex Waygood [Fri, 8 Dec 2023 12:31:11 +0000 (12:31 +0000)] 
gh-101100: Fix Sphinx nitpicks in `library/shelve.rst` (#112836)

23 months agoGH-111485: Factor out opcode ID generator from the main cases generator. (GH-112831)
Mark Shannon [Fri, 8 Dec 2023 11:48:30 +0000 (11:48 +0000)] 
GH-111485: Factor out opcode ID generator from the main cases generator. (GH-112831)

23 months agogh-110820: Make sure processor specific defines are correct for Universal 2 build...
Ronald Oussoren [Fri, 8 Dec 2023 09:09:34 +0000 (10:09 +0100)] 
gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS (#112828)

* gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS

A number of processor specific defines are different for x86-64 and
arm64, and need to be adjusted in pymacconfig.h.

* remove debug stuf

23 months agoAdd a versionchanged directive for gh-94692 (GH-112846)
Serhiy Storchaka [Fri, 8 Dec 2023 08:18:15 +0000 (10:18 +0200)] 
Add a versionchanged directive for gh-94692 (GH-112846)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
23 months agoGH-112675: Move path joining tests into `test_posixpath` and `test_ntpath` (#112676)
Barney Gale [Thu, 7 Dec 2023 21:45:40 +0000 (21:45 +0000)] 
GH-112675: Move path joining tests into `test_posixpath` and `test_ntpath` (#112676)

In `test_pathlib`, the `check_drive_root_parts` test methods evaluated
both joining and parsing/normalisation of paths. This dates from a time
when pathlib implemented both functions itself, but nowadays path joining
is done with `posixpath.join()` and `ntpath.join()`.

This commit moves the joining-related test cases into `test_posixpath` and
`test_ntpath`.

23 months agogh-101100: Silence Sphinx warnings when `ntpath` or `posixpath` are referenced (...
Alex Waygood [Thu, 7 Dec 2023 20:57:30 +0000 (20:57 +0000)] 
gh-101100: Silence Sphinx warnings when `ntpath` or `posixpath` are referenced (#112833)

23 months agogh-112826: Add a "What's New" Entry About _thread._is_main_interpreter (gh-112853)
Eric Snow [Thu, 7 Dec 2023 20:22:15 +0000 (13:22 -0700)] 
gh-112826: Add a "What's New" Entry About _thread._is_main_interpreter (gh-112853)

As of gh-112661, the threading module expects the _thread module to have a _is_main_interpreter(), which is used in the internal threading._shutdown().  This change causes a problem for anyone that replaces the _thread module with a custom one (only if they don't provide _is_main_interpreter()).  They need to be sure to add it for 3.13+, thus this PR is adding a note in "What's New".

This also forward-ports the "What's New" entry from 3.12 (gh-112850).  Note that we do not also forward-port the fix in that PR.  The fix is there only due to a regression from 3.12.0. There is no regression in 3.13+.

23 months agogh-111924: Use PyMutex for Runtime-global Locks. (gh-112207)
Sam Gross [Thu, 7 Dec 2023 19:33:40 +0000 (14:33 -0500)] 
gh-111924: Use PyMutex for Runtime-global Locks. (gh-112207)

This replaces some usages of PyThread_type_lock with PyMutex, which does not require memory allocation to initialize.

This simplifies some of the runtime initialization and is also one step towards avoiding changing the default raw memory allocator during initialize/finalization, which can be non-thread-safe in some circumstances.

23 months agogh-112538: Add internal-only _PyThreadStateImpl "wrapper" for PyThreadState (gh-112560)
Sam Gross [Thu, 7 Dec 2023 19:11:45 +0000 (14:11 -0500)] 
gh-112538: Add internal-only _PyThreadStateImpl "wrapper" for PyThreadState (gh-112560)

Every PyThreadState instance is now actually a _PyThreadStateImpl.
It is safe to cast from `PyThreadState*` to `_PyThreadStateImpl*` and back.
The _PyThreadStateImpl will contain fields that we do not want to expose
in the public C API.

23 months agogh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (#112834)
Ronald Oussoren [Thu, 7 Dec 2023 18:41:27 +0000 (19:41 +0100)] 
gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (#112834)

Test test_stress_modifying_handlers in test_signal can crash
the interpreter due to a bug in macOS. Filed as FB13453490
with Apple.

23 months agogh-112278: Disable WMI queries on Windows after they time out (GH-112658)
AN Long [Thu, 7 Dec 2023 17:26:29 +0000 (01:26 +0800)] 
gh-112278: Disable WMI queries on Windows after they time out (GH-112658)

23 months agogh-79325: Fix recursion error in TemporaryDirectory cleanup on Windows (GH-112762)
Serhiy Storchaka [Thu, 7 Dec 2023 17:21:36 +0000 (19:21 +0200)] 
gh-79325: Fix recursion error in TemporaryDirectory cleanup on Windows (GH-112762)

23 months agogh-87319: Simplify TemporaryDirectory cleanup using os.path.isjunction() (GH-112791)
Serhiy Storchaka [Thu, 7 Dec 2023 16:32:10 +0000 (18:32 +0200)] 
gh-87319: Simplify TemporaryDirectory cleanup using os.path.isjunction() (GH-112791)

23 months agogh-91133: tempfile.TemporaryDirectory: fix symlink bug in cleanup (GH-99930)
Søren Løvborg [Thu, 7 Dec 2023 16:04:06 +0000 (17:04 +0100)] 
gh-91133: tempfile.TemporaryDirectory: fix symlink bug in cleanup (GH-99930)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
23 months agogh-112302: Add Software Bill-of-Materials (SBOM) tracking for dependencies (#112303)
Seth Michael Larson [Thu, 7 Dec 2023 16:01:58 +0000 (10:01 -0600)] 
gh-112302: Add Software Bill-of-Materials (SBOM) tracking for dependencies (#112303)

23 months agogh-111962: Make dtoa thread-safe in `--disable-gil` builds. (#112049)
Sam Gross [Thu, 7 Dec 2023 13:47:55 +0000 (08:47 -0500)] 
gh-111962: Make dtoa thread-safe in `--disable-gil` builds. (#112049)

This updates `dtoa.c` to avoid using the Bigint free-list in --disable-gil builds and
to pre-computes the needed powers of 5 during interpreter initialization.

* gh-111962: Make dtoa thread-safe in `--disable-gil` builds.

This avoids using the Bigint free-list in `--disable-gil` builds
and pre-computes the needed powers of 5 during interpreter initialization.

* Fix size of cached powers of 5 array.

We need the powers of 5 up to 5**512 because we only jump straight to
underflow when the exponent is less than -512 (or larger than 308).

* Rename Py_NOGIL to Py_GIL_DISABLED

* Changes from review

* Fix assertion placement

23 months agogh-110190: Temporarily skip new test introduced in gh-112604 on PPC64LE (#112818)
Łukasz Langa [Thu, 7 Dec 2023 13:29:15 +0000 (14:29 +0100)] 
gh-110190: Temporarily skip new test introduced in gh-112604 on PPC64LE (#112818)

23 months agobpo-42519: Remove outdated sentence in comment (#112822)
Christopher Chavez [Thu, 7 Dec 2023 13:24:11 +0000 (07:24 -0600)] 
bpo-42519: Remove outdated sentence in comment (#112822)

Update objimpl.h

23 months agogh-112125: Fix None.__ne__(None) returning NotImplemented instead of False (#112504)
andrewluotechnologies [Thu, 7 Dec 2023 12:56:01 +0000 (04:56 -0800)] 
gh-112125: Fix None.__ne__(None) returning NotImplemented instead of False (#112504)

23 months agoGH-111485: Separate out parsing, analysis and code-gen phases of tier 1 code generato...
Mark Shannon [Thu, 7 Dec 2023 12:49:40 +0000 (12:49 +0000)] 
GH-111485: Separate out parsing, analysis and code-gen phases of tier 1 code generator (GH-112299)

23 months agogh-102980: Redirect output of pdb's `interact` command, add tests and improve docs...
Tian Gao [Thu, 7 Dec 2023 11:19:33 +0000 (02:19 -0900)] 
gh-102980: Redirect output of pdb's `interact` command, add tests and improve docs (#111194)

23 months agogh-51944: Add missing macOS constants to termios (#112823)
Ronald Oussoren [Thu, 7 Dec 2023 10:27:30 +0000 (11:27 +0100)] 
gh-51944: Add missing macOS constants to termios (#112823)

* gh-51944: Add some macOS constants to termios

This changeset adds all public constants in <termio.h>
and <sys/termios.h> on macOS that weren't present
already.

Based on the macOS 14.2 SDK

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
23 months agogh-74616: Raise ValueError in case of null character in input prompt (GH-1738)
Kushal Das [Thu, 7 Dec 2023 10:22:52 +0000 (11:22 +0100)] 
gh-74616: Raise ValueError in case of null character in input prompt (GH-1738)

If the input prompt to the builtin input function on terminal has any null
character, then raise ValueError instead of silently truncating it.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
23 months agogh-112660: Do not clear arbitrary errors on import (GH-112661)
Serhiy Storchaka [Thu, 7 Dec 2023 10:19:43 +0000 (12:19 +0200)] 
gh-112660: Do not clear arbitrary errors on import (GH-112661)

Previously arbitrary errors could be cleared during formatting error
messages for ImportError or AttributeError for modules. Now all
unexpected errors are reported.

23 months agogh-109981: Fix support.fd_count() on macOS 14 (#112797)
Ronald Oussoren [Thu, 7 Dec 2023 09:30:15 +0000 (10:30 +0100)] 
gh-109981: Fix support.fd_count() on macOS 14 (#112797)

Use scanning "/dev/fd/" on macOS in support.fd_count(). That's both more efficient than scanning all possible file descriptors, and avoids crashing the interpreter when there are open "guarded" file descriptors.

"Guarded" file descriptors are a macOS feature where file descriptors used by system libraries are marked and cause hard crashes when used by "user" code.

Co-authored-by: Victor Stinner <vstinner@python.org>
23 months agogh-112730: Use color to highlight error locations (gh-112732)
Pablo Galindo Salgado [Wed, 6 Dec 2023 22:29:54 +0000 (22:29 +0000)] 
gh-112730: Use color to highlight error locations (gh-112732)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
23 months agogh-101100: Fix Sphinx nitpicks in `library/reprlib.rst` (#112811)
Alex Waygood [Wed, 6 Dec 2023 20:16:12 +0000 (20:16 +0000)] 
gh-101100: Fix Sphinx nitpicks in `library/reprlib.rst` (#112811)

23 months agogh-101100: Improve documentation of code object attributes (#112781)
Alex Waygood [Wed, 6 Dec 2023 20:15:46 +0000 (20:15 +0000)] 
gh-101100: Improve documentation of code object attributes (#112781)

23 months agogh-111178: Define `visitproc` callback functions properly and remove unnecessary...
Christopher Chavez [Wed, 6 Dec 2023 15:30:37 +0000 (09:30 -0600)] 
gh-111178: Define `visitproc` callback functions properly and remove unnecessary casts in gcmodule.c (#112687)

23 months agogh-75666: Tkinter: "unbind(sequence, funcid)" now only unbinds "funcid" (GH-111322)
Serhiy Storchaka [Wed, 6 Dec 2023 14:42:15 +0000 (16:42 +0200)] 
gh-75666: Tkinter: "unbind(sequence, funcid)" now only unbinds "funcid" (GH-111322)

Previously, "widget.unbind(sequence, funcid)" destroyed the current binding
for "sequence", leaving "sequence" unbound, and deleted the "funcid"
command.

Now it removes only "funcid" from the binding for "sequence", keeping
other commands, and deletes the "funcid" command.
It leaves "sequence" unbound only if "funcid" was the last bound command.

Co-authored-by: GiovanniL <13402461+GiovaLomba@users.noreply.github.com>
23 months agogh-111545: Add Py_HashPointer() function (#112096)
Victor Stinner [Wed, 6 Dec 2023 14:09:22 +0000 (15:09 +0100)] 
gh-111545: Add Py_HashPointer() function (#112096)

* Implement _Py_HashPointerRaw() as a static inline function.
* Add Py_HashPointer() tests to test_capi.test_hash.
* Keep _Py_HashPointer() function as an alias to Py_HashPointer().

23 months agogh-108223: Refer to PEP 703 as Free Threading (#112780)
Victor Stinner [Wed, 6 Dec 2023 11:55:58 +0000 (12:55 +0100)] 
gh-108223: Refer to PEP 703 as Free Threading (#112780)

23 months agogh-111178: Docs: fix `traverseproc`, `inquiry`, and `destructor` parameters in slot...
Christopher Chavez [Wed, 6 Dec 2023 09:44:41 +0000 (03:44 -0600)] 
gh-111178: Docs: fix `traverseproc`, `inquiry`, and `destructor` parameters in slot typedefs table (GH-112742)

In the slot typedefs table, the parameter of `destructor`
and the first parameter of `traverseproc` should both be
`PyObject *` rather than `void *`.
Same for `inquiry`.