]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
16 months agogh-121096: Ignore dlopen() leaks in Valgrind suppression file (#121097)
Victor Stinner [Fri, 28 Jun 2024 11:10:11 +0000 (13:10 +0200)] 
gh-121096: Ignore dlopen() leaks in Valgrind suppression file (#121097)

16 months agogh-107803: add whatsnew for asyncio double linked list implementation (#120995)
Kumar Aditya [Fri, 28 Jun 2024 09:03:31 +0000 (14:33 +0530)] 
gh-107803: add whatsnew for asyncio double linked list implementation (#120995)

16 months agogh-120837: Update _Py_DumpExtensionModules to be async-signal-safe (gh-121051)
Donghee Na [Thu, 27 Jun 2024 21:46:46 +0000 (06:46 +0900)] 
gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe (gh-121051)

16 months agogh-121035: Update logging flow chart to include the lastResort handler. (GH-121036)
Alexander Bessman [Thu, 27 Jun 2024 21:11:40 +0000 (23:11 +0200)] 
gh-121035: Update logging flow chart to include the lastResort handler. (GH-121036)

16 months agogh-121065: Temporarily skip flaky test on free-threaded build (#121100)
Sam Gross [Thu, 27 Jun 2024 18:03:09 +0000 (14:03 -0400)] 
gh-121065: Temporarily skip flaky test on free-threaded build (#121100)

16 months agogh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887)
Craig Robson [Thu, 27 Jun 2024 16:44:40 +0000 (09:44 -0700)] 
gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887)

The check for whether the log file is a real file is expensive on NFS
filesystems.  This commit reorders the rollover condition checking to
not do the file type check if the expected file size is less than the
rotation threshold.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
16 months agogh-115986 Improve pprint docs formatting (GH-117401)
Kerim Kabirov [Thu, 27 Jun 2024 14:32:50 +0000 (16:32 +0200)] 
gh-115986 Improve pprint docs formatting (GH-117401)

* Move pprinter parameters description to the table

The change improves readability.
Suggested in the GH#116085 PR discussion.

* Make pprint doc with params markup

* Fix formatting
Indentation of code blocks made them nested
"Version changed" is better placed after the code block

* Fix formatting for tests

* fix code indentation for autotests

* Fix identation for autotests

* Remove duplication of the parameters' description

* Rearrange parameters description in a correct order

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
16 months agogh-121027: Add a future warning in functools.partial.__get__ (#121086)
Serhiy Storchaka [Thu, 27 Jun 2024 11:47:20 +0000 (14:47 +0300)] 
gh-121027: Add a future warning in functools.partial.__get__ (#121086)

16 months agogh-121082: Fix build failure when the developer use `--enable-pystats` arguments...
Nadeshiko Manju [Thu, 27 Jun 2024 11:35:25 +0000 (19:35 +0800)] 
gh-121082: Fix build failure when the developer use `--enable-pystats` arguments in configuration command after #118450 (#121083)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
16 months agogh-120593: Check -Wcast-qual flag in test_cext (#121081)
Victor Stinner [Thu, 27 Jun 2024 10:22:48 +0000 (12:22 +0200)] 
gh-120593: Check -Wcast-qual flag in test_cext (#121081)

Check the usage of the 'const' qualifier in the Python C API in
test_cext.

16 months agogh-120686: remove unused internal c api functions (#120687)
Irit Katriel [Thu, 27 Jun 2024 10:09:30 +0000 (11:09 +0100)] 
gh-120686: remove unused internal c api functions (#120687)

16 months agogh-121040: Use __attribute__((fallthrough)) (#121044)
Victor Stinner [Thu, 27 Jun 2024 09:58:44 +0000 (11:58 +0200)] 
gh-121040: Use __attribute__((fallthrough)) (#121044)

Fix warnings when using -Wimplicit-fallthrough compiler flag.

Annotate explicitly "fall through" switch cases with a new
_Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if
available. Replace "fall through" comments with _Py_FALLTHROUGH.

Add _Py__has_attribute() macro. No longer define __has_attribute()
macro if it's not defined. Move also _Py__has_builtin() at the top
of pyport.h.

Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
16 months agogh-120888: Bump bundled pip to 24.1.1 (#120889)
Pradyun Gedam [Thu, 27 Jun 2024 09:09:54 +0000 (10:09 +0100)] 
gh-120888: Bump bundled pip to 24.1.1 (#120889)

Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
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>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
16 months agogh-119521: Remove _IncompleteInputError from the docs (GH-120993)
Petr Viktorin [Thu, 27 Jun 2024 07:09:22 +0000 (09:09 +0200)] 
gh-119521: Remove _IncompleteInputError from the docs (GH-120993)

16 months agogh-120868: Fix breaking change in `logging.config` when using `QueueHandler` (GH...
Janek Nouvertné [Thu, 27 Jun 2024 07:09:01 +0000 (09:09 +0200)] 
gh-120868: Fix breaking change in `logging.config` when using `QueueHandler` (GH-120872)

16 months agogh-113433: Automatically Clean Up Subinterpreters in Py_Finalize() (gh-121060)
Eric Snow [Wed, 26 Jun 2024 21:17:26 +0000 (15:17 -0600)] 
gh-113433: Automatically Clean Up Subinterpreters in Py_Finalize() (gh-121060)

This change makes things a little less painful for some users.  It also fixes a failing assert (gh-120765), by making sure all subinterpreters are destroyed before the main interpreter.  As part of that, we make sure Py_Finalize() always runs with the main interpreter active.

16 months agogh-120937: Reference weakref from the `__del__` documentation (#120940)
chaen [Wed, 26 Jun 2024 20:07:09 +0000 (22:07 +0200)] 
gh-120937: Reference weakref from the `__del__` documentation (#120940)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
16 months agogh-117139: Convert the evaluation stack to stack refs (#118450)
Ken Jin [Wed, 26 Jun 2024 19:10:43 +0000 (03:10 +0800)] 
gh-117139: Convert the evaluation stack to stack refs (#118450)

This PR sets up tagged pointers for CPython.

The general idea is to create a separate struct _PyStackRef for everything on the evaluation stack to store the bits. This forces the C compiler to warn us if we try to cast things or pull things out of the struct directly.

Only for free threading: We tag the low bit if something is deferred - that means we skip incref and decref operations on it. This behavior may change in the future if Mark's plans to defer all objects in the interpreter loop pans out.

This implies a strict stack reference discipline is required. ALL incref and decref operations on stackrefs must use the stackref variants. It is unsafe to untag something then do normal incref/decref ops on it.

The new incref and decref variants are called dup and close. They mimic a "handle" API operating on these stackrefs.

Please read Include/internal/pycore_stackref.h for more information!

---------

Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com>
16 months agogh-118908: Use __main__ for the default PyREPL namespace (#121054)
Łukasz Langa [Wed, 26 Jun 2024 19:01:10 +0000 (15:01 -0400)] 
gh-118908: Use __main__ for the default PyREPL namespace (#121054)

16 months agogh-120593: Fix const qualifier in _PyLong_CompactValue() (#121053)
Victor Stinner [Wed, 26 Jun 2024 18:11:21 +0000 (20:11 +0200)] 
gh-120593: Fix const qualifier in _PyLong_CompactValue() (#121053)

Remove the const qualifier of the argument of functions:

* _PyLong_IsCompact()
* _PyLong_CompactValue()

Py_TYPE() argument is not const.

Fix the compiler warning:

  Include/cpython/longintrepr.h: In function ‘_PyLong_CompactValue’:
  Include/pyport.h:19:31: error: cast discards ‘const’ qualifier from
  pointer target type [-Werror=cast-qual]
    (...)
  Include/cpython/longintrepr.h:133:30: note: in expansion of macro
  ‘Py_TYPE’
    assert(PyType_HasFeature(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS));

16 months agogh-120593: Fix const qualifier in pyatomic.h (#121055)
Victor Stinner [Wed, 26 Jun 2024 18:10:47 +0000 (20:10 +0200)] 
gh-120593: Fix const qualifier in pyatomic.h (#121055)

16 months agogh-121008: Fix idlelib.run tests (#121046)
Victor Stinner [Wed, 26 Jun 2024 13:41:16 +0000 (15:41 +0200)] 
gh-121008: Fix idlelib.run tests (#121046)

When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.

16 months agogh-119786: move frames documentation to InternalDocs and add details (#121009)
Irit Katriel [Wed, 26 Jun 2024 12:18:20 +0000 (13:18 +0100)] 
gh-119786: move frames documentation to InternalDocs and add details (#121009)

16 months agogh-120642: Move private PyCode APIs to the internal C API (#120643)
Victor Stinner [Wed, 26 Jun 2024 11:54:03 +0000 (13:54 +0200)] 
gh-120642: Move private PyCode APIs to the internal C API (#120643)

* Move _Py_CODEUNIT and related functions to pycore_code.h.
* Move _Py_BackoffCounter to pycore_backoff.h.
* Move Include/cpython/optimizer.h content to pycore_optimizer.h.
* Remove Include/cpython/optimizer.h.
* Remove PyUnstable_Replace_Executor().

Rename functions:

* PyUnstable_GetExecutor() => _Py_GetExecutor()
* PyUnstable_GetOptimizer() => _Py_GetOptimizer()
* PyUnstable_SetOptimizer() => _Py_SetTier2Optimizer()
* PyUnstable_Optimizer_NewCounter() => _PyOptimizer_NewCounter()
* PyUnstable_Optimizer_NewUOpOptimizer() => _PyOptimizer_NewUOpOptimizer()

16 months agogh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (#121017)
devdanzin [Wed, 26 Jun 2024 10:39:07 +0000 (07:39 -0300)] 
gh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (#121017)

16 months agogh-121040: Remove fallthrough warnings compiler option (gh-121041)
Nate Ohlson [Wed, 26 Jun 2024 10:21:21 +0000 (05:21 -0500)] 
gh-121040: Remove fallthrough warnings compiler option (gh-121041)

Remove fallthrough warnings

16 months agogh-73991: Skip permission test if running as *nix superuser (GH-120994)
Petr Viktorin [Wed, 26 Jun 2024 09:36:09 +0000 (11:36 +0200)] 
gh-73991: Skip permission test if running as *nix superuser (GH-120994)

16 months agogh-121025: Improve partialmethod.__repr__ (GH-121033)
Bénédikt Tran [Wed, 26 Jun 2024 09:08:27 +0000 (11:08 +0200)] 
gh-121025: Improve partialmethod.__repr__ (GH-121033)

It no longer contains redundant commas and spaces.

16 months agogh-121026: Include -Werror with new compiler flag checks to ensure compatibility...
Nate Ohlson [Wed, 26 Jun 2024 08:45:55 +0000 (03:45 -0500)] 
gh-121026: Include -Werror with new compiler flag checks to ensure compatibility (gh-121030)

16 months agogh-121018: Ensure ArgumentParser.parse_args with exit_on_error=False raises instead...
blhsing [Wed, 26 Jun 2024 07:41:51 +0000 (15:41 +0800)] 
gh-121018: Ensure ArgumentParser.parse_args with exit_on_error=False raises instead of exiting when given unrecognized arguments (GH-121019)

16 months agogh-107803: fix thread safety issue in double linked list implementation (#121007)
Kumar Aditya [Wed, 26 Jun 2024 05:11:32 +0000 (10:41 +0530)] 
gh-107803: fix thread safety issue in double linked list implementation  (#121007)

16 months agogh-112301: Enable compiler flags with low performance impact and no warnings (gh...
Nate Ohlson [Wed, 26 Jun 2024 03:11:05 +0000 (22:11 -0500)] 
gh-112301: Enable compiler flags with low performance impact and no warnings (gh-120975)

16 months agogh-120838: Add _PyThreadState_WHENCE_FINI (gh-121010)
Eric Snow [Tue, 25 Jun 2024 20:35:12 +0000 (14:35 -0600)] 
gh-120838: Add _PyThreadState_WHENCE_FINI (gh-121010)

We also add _PyThreadState_NewBound() and drop _PyThreadState_SetWhence().

This change only affects internal API.

16 months agogh-120155: Fix Coverity issue in parse_string() (#120997)
Victor Stinner [Tue, 25 Jun 2024 16:53:24 +0000 (18:53 +0200)] 
gh-120155: Fix Coverity issue in parse_string() (#120997)

16 months agogh-114053: Fix another edge case involving `get_type_hints`, PEP 695 and PEP 563...
Alex Waygood [Tue, 25 Jun 2024 15:53:18 +0000 (16:53 +0100)] 
gh-114053: Fix another edge case involving `get_type_hints`, PEP 695 and PEP 563 (#120272)

16 months agoGH-120982: Add stack check assertions to generated interpreter code (GH-120992)
Mark Shannon [Tue, 25 Jun 2024 15:42:29 +0000 (16:42 +0100)] 
GH-120982: Add stack check assertions to generated interpreter code (GH-120992)

16 months agogh-120108: Fix deepcopying of AST trees with .parent attributes (#120114)
Jelle Zijlstra [Tue, 25 Jun 2024 15:12:11 +0000 (08:12 -0700)] 
gh-120108: Fix deepcopying of AST trees with .parent attributes (#120114)

16 months agoDoc/README: Document 'make htmllive' (#120692)
Hugo van Kemenade [Tue, 25 Jun 2024 09:08:55 +0000 (03:08 -0600)] 
Doc/README: Document 'make htmllive' (#120692)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
16 months agoAdd fast path in count_elements (gh-120983)
Raymond Hettinger [Tue, 25 Jun 2024 08:10:00 +0000 (03:10 -0500)] 
Add fast path in count_elements (gh-120983)

16 months agogh-120661: improve example for basic type hints (#120934)
Bénédikt Tran [Tue, 25 Jun 2024 07:59:56 +0000 (09:59 +0200)] 
gh-120661: improve example for basic type hints (#120934)

16 months agogh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (#120822)
Michael Allwright [Tue, 25 Jun 2024 07:48:48 +0000 (09:48 +0200)] 
gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (#120822)

Add missing space in AS_VAR_APPEND() on CFLAGS.

16 months agoAdd --with-lto back to Linux JIT CI (GH-120921)
Savannah Ostrowski [Mon, 24 Jun 2024 20:16:22 +0000 (13:16 -0700)] 
Add --with-lto back to Linux JIT CI (GH-120921)

16 months agoGH-119054: Add "Permissions and ownership" section to pathlib docs. (#120505)
Barney Gale [Mon, 24 Jun 2024 19:05:24 +0000 (20:05 +0100)] 
GH-119054: Add "Permissions and ownership" section to pathlib docs. (#120505)

Add dedicated subsection for `pathlib.owner()`, `group()`, `chmod()` and
`lchmod()`.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
16 months agogh-120858: PyDict_Next should not lock the dict (#120859)
Sam Gross [Mon, 24 Jun 2024 18:15:15 +0000 (14:15 -0400)] 
gh-120858: PyDict_Next should not lock the dict (#120859)

PyDict_Next no longer locks the dictionary in the free-threaded build. Locking
around individual PyDict_Next calls is not sufficient because the function
returns borrowed references and because it allows concurrent modifications
during the iteraiton loop.

The internal locking also interferes with correct external synchronization
because it may suspend outer critical sections created by the caller.

16 months agogh-120860: Fix a few bugs in `type_setattro` error paths. (#120861)
Sam Gross [Mon, 24 Jun 2024 18:08:23 +0000 (14:08 -0400)] 
gh-120860: Fix a few bugs in `type_setattro` error paths. (#120861)

Moves the logic to update the type's dictionary to its own function in order
to make the lock scoping more clear.

Also, ensure that `name` is decref'd on the error path.

16 months agoFix typos in comments (#120821)
Xie Yanbo [Mon, 24 Jun 2024 17:47:00 +0000 (01:47 +0800)] 
Fix typos in comments (#120821)

16 months agogh-120834: fix over-allocation in PyGenObject, PyCoroObject, PyAsyncGenObject. (...
Irit Katriel [Mon, 24 Jun 2024 17:41:53 +0000 (18:41 +0100)] 
gh-120834: fix over-allocation in PyGenObject, PyCoroObject, PyAsyncGenObject. (#120941)

16 months agogh-120956: Avoid comparison of int to Py_ssize_t in parser (#120959)
Lysandros Nikolaou [Mon, 24 Jun 2024 16:13:02 +0000 (18:13 +0200)] 
gh-120956: Avoid comparison of int to Py_ssize_t in parser (#120959)

16 months agoFixes loop variables to be the same types as their limit (GH-120958)
Steve Dower [Mon, 24 Jun 2024 16:11:47 +0000 (17:11 +0100)] 
Fixes loop variables to be the same types as their limit (GH-120958)

16 months agogh-119182: Add PyUnicodeWriter_WriteUCS4() function (#120849)
Victor Stinner [Mon, 24 Jun 2024 15:40:39 +0000 (17:40 +0200)] 
gh-119182: Add PyUnicodeWriter_WriteUCS4() function (#120849)

16 months agoGH-117062: Make _JUMP_TO_TOP a general absolute jump (GH-120854)
Brandt Bucher [Mon, 24 Jun 2024 15:35:10 +0000 (08:35 -0700)] 
GH-117062: Make _JUMP_TO_TOP a general absolute jump (GH-120854)

16 months agogh-119521: Use `PyAPI_DATA`, not `extern`, for `_PyExc_IncompleteInputError` (GH...
Petr Viktorin [Mon, 24 Jun 2024 15:30:29 +0000 (17:30 +0200)] 
gh-119521: Use `PyAPI_DATA`, not `extern`, for `_PyExc_IncompleteInputError` (GH-120955)

16 months agogh-70278: Fix PyUnicode_FromFormat() with precision for %s and %V (GH-120365)
Serhiy Storchaka [Mon, 24 Jun 2024 15:07:07 +0000 (18:07 +0300)] 
gh-70278: Fix PyUnicode_FromFormat() with precision for %s and %V (GH-120365)

PyUnicode_FromFormat() no longer produces the ending \ufffd
character for truncated C string when use precision with %s and %V.
It now truncates the string before the start of truncated multibyte sequences.

16 months agodocs: puremagic.what() as replacement for imghdr.what() (#120871)
Christian Clauss [Mon, 24 Jun 2024 13:32:13 +0000 (15:32 +0200)] 
docs: puremagic.what() as replacement for imghdr.what() (#120871)

16 months agogh-120373: Mark test_audit.test_http as requiring the network resource (#120374)
Itamar Oren [Mon, 24 Jun 2024 13:18:46 +0000 (06:18 -0700)] 
gh-120373: Mark test_audit.test_http as requiring the network resource (#120374)

16 months agogh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from publi...
Pablo Galindo Salgado [Mon, 24 Jun 2024 12:08:12 +0000 (13:08 +0100)] 
gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
16 months agogh-120834: fix type of *_iframe field in _PyGenObject_HEAD declaration (#120835)
Irit Katriel [Mon, 24 Jun 2024 09:23:38 +0000 (10:23 +0100)] 
gh-120834: fix type of *_iframe field in _PyGenObject_HEAD declaration (#120835)

16 months agogh-119614: Fix truncation of strings with embedded null characters in Tkinter (GH...
Serhiy Storchaka [Mon, 24 Jun 2024 09:17:25 +0000 (12:17 +0300)] 
gh-119614: Fix truncation of strings with embedded null characters in Tkinter (GH-120909)

Now the null character is always represented as \xc0\x80 for
Tcl_NewStringObj().

16 months agogh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implica...
Alek Kowalczyk [Mon, 24 Jun 2024 08:35:02 +0000 (10:35 +0200)] 
gh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implications. (#112191)

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
16 months agogh-120683: Fix an error in logging.LogRecord timestamp (GH-120709)
Serhiy Storchaka [Mon, 24 Jun 2024 06:50:39 +0000 (09:50 +0300)] 
gh-120683: Fix an error in logging.LogRecord timestamp (GH-120709)

The integer part of the timestamp can be rounded up, while the millisecond
calculation truncates, causing the log timestamp to be wrong by up to 999 ms
(affected roughly 1 in 8 million timestamps).

16 months agoUse _PyLong_IsNegative instead of _PyLong_Sign if appropriate. (GH-120493)
Serhiy Storchaka [Mon, 24 Jun 2024 06:49:01 +0000 (09:49 +0300)] 
Use _PyLong_IsNegative instead of _PyLong_Sign if appropriate. (GH-120493)

It is faster and more obvious.

16 months agoGH-73991: Add `pathlib.Path.copytree()` (#120718)
Barney Gale [Sun, 23 Jun 2024 21:01:12 +0000 (22:01 +0100)] 
GH-73991: Add `pathlib.Path.copytree()` (#120718)

Add `pathlib.Path.copytree()` method, which recursively copies one
directory to another.

This differs from `shutil.copytree()` in the following respects:

1. Our method has a *follow_symlinks* argument, whereas shutil's has a
   *symlinks* argument with an inverted meaning.
2. Our method lacks something like a *copy_function* argument. It always
   uses `Path.copy()` to copy files.
3. Our method lacks something like a *ignore_dangling_symlinks* argument.
   Instead, users can filter out danging symlinks with *ignore*, or
   ignore exceptions with *on_error*
4. Our *ignore* argument is a callable that accepts a single path object,
   whereas shutil's accepts a path and a list of child filenames.
5. We add an *on_error* argument, which is a callable that accepts
   an `OSError` instance. (`Path.walk()` also accepts such a callable).

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
16 months agoDocs makefile/RTD: Use uv if installed (#120711)
Hugo van Kemenade [Sun, 23 Jun 2024 19:23:27 +0000 (13:23 -0600)] 
Docs makefile/RTD: Use uv if installed (#120711)

16 months agogh-120910: Fix issue resolving relative paths outside site-packages. (#120911)
Jason R. Coombs [Sun, 23 Jun 2024 17:06:07 +0000 (13:06 -0400)] 
gh-120910: Fix issue resolving relative paths outside site-packages. (#120911)

Incorporates changes from importlib_metadata 7.2.1.

16 months agoTyping docs: normalize some indents in code examples (#120912)
Nyakku Shigure [Sun, 23 Jun 2024 16:15:12 +0000 (00:15 +0800)] 
Typing docs: normalize some indents in code examples (#120912)

16 months agogh-101830: Fix Tcl_Obj to string conversion (GH-120884)
Serhiy Storchaka [Sun, 23 Jun 2024 13:34:14 +0000 (16:34 +0300)] 
gh-101830: Fix Tcl_Obj to string conversion (GH-120884)

Accessing the Tkinter object's string representation no longer converts
the underlying Tcl object to a string on Windows.

16 months agoGH-120804: add docs for removal for asyncio child watchers (#120895)
Kumar Aditya [Sun, 23 Jun 2024 13:14:12 +0000 (18:44 +0530)] 
GH-120804: add docs for removal for asyncio child watchers (#120895)

Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
16 months agoGH-120804: Remove `PidfdChildWatcher`, `ThreadedChildWatcher` and `AbstractChildWatch...
Kumar Aditya [Sun, 23 Jun 2024 13:08:50 +0000 (18:38 +0530)] 
GH-120804: Remove `PidfdChildWatcher`, `ThreadedChildWatcher` and `AbstractChildWatcher` from asyncio APIs (#120893)

16 months agogh-120896: Fix typo in version changed note of `urllib.parse.urlparse()` (#120898)
Nice Zombies [Sun, 23 Jun 2024 12:30:23 +0000 (14:30 +0200)] 
gh-120896: Fix typo in version changed note of `urllib.parse.urlparse()` (#120898)

16 months agoGH-120804: Remove `get_child_watcher` and `set_child_watcher` from asyncio (#120818)
Kumar Aditya [Sun, 23 Jun 2024 04:23:23 +0000 (09:53 +0530)] 
GH-120804: Remove `get_child_watcher` and `set_child_watcher` from asyncio (#120818)

16 months agoGH-107803: double linked list implementation for asyncio tasks (GH-107804)
Kumar Aditya [Sat, 22 Jun 2024 17:58:35 +0000 (23:28 +0530)] 
GH-107803: double linked list implementation for asyncio tasks (GH-107804)

* linked list

* add tail optmiization to linked list

* wip

* wip

* wip

* more fixes

* finally it works

* add tests

* remove weakreflist

* add some comments

* reduce code duplication in _asynciomodule.c

* address some review comments

* add invariants about the state of the linked list

* add better explanation

* clinic regen

* reorder branches for better branch prediction

* Update Modules/_asynciomodule.c

* Apply suggestions from code review

Co-authored-by: Itamar Oren <itamarost@gmail.com>
* fix capturing of eager tasks

* add comment to task finalization

* fix tests and couple c implmentation to c task

improved linked-list logic and more comments

* fix test

---------

Co-authored-by: Itamar Oren <itamarost@gmail.com>
16 months agogh-119182: Add checks to PyUnicodeWriter APIs (#120870)
Victor Stinner [Sat, 22 Jun 2024 15:25:55 +0000 (17:25 +0200)] 
gh-119182: Add checks to PyUnicodeWriter APIs (#120870)

16 months agogh-120873: Add tests for new widget options in Tk 8.7 (GH-120877)
Serhiy Storchaka [Sat, 22 Jun 2024 13:19:42 +0000 (16:19 +0300)] 
gh-120873: Add tests for new widget options in Tk 8.7 (GH-120877)

16 months agogh-120873: Add test for "state" option in ttk.Scale (GH-120874)
Serhiy Storchaka [Sat, 22 Jun 2024 11:18:04 +0000 (14:18 +0300)] 
gh-120873: Add test for "state" option in ttk.Scale (GH-120874)

Also refactor the "state" option tests for other ttk widgets.

16 months agogh-119182: Use PyUnicodeWriter_WriteWideChar() (#120851)
Victor Stinner [Sat, 22 Jun 2024 06:58:22 +0000 (08:58 +0200)] 
gh-119182: Use PyUnicodeWriter_WriteWideChar() (#120851)

Use PyUnicodeWriter_WriteWideChar() in PyUnicode_FromFormat()

16 months agogh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824)
Serhiy Storchaka [Sat, 22 Jun 2024 06:53:24 +0000 (09:53 +0300)] 
gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824)

The tests are now passed with the current version of Tcl/Tk under
development (8.7b1+ and 9.0b3+).

The following changes were also made to make the tests more flexible:

* Helper methods like checkParam() now interpret the expected error message
  as a regular expression instead of a literal.
* Add support of new arguments in checkEnumParam():
  - allow_empty=True skips testing with empty string;
  - fullname= specifies the name for error message if it differs from the
    option name;
  - sort=True sorts values for error message.
* Add support of the allow_empty argument in checkReliefParam():
  allow_empty=True adds an empty string to the list of accepted values.
* Attributes _clip_highlightthickness, _clip_pad and  _clip_borderwidth
  specify how negative values of options -highlightthickness, -padx, -pady
  and -borderwidth are handled.
* Use global variables for some common error messages.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
16 months agogh-119344: Make critical section API public (#119353)
Sam Gross [Fri, 21 Jun 2024 19:50:18 +0000 (15:50 -0400)] 
gh-119344: Make critical section API public (#119353)

This makes the following macros public as part of the non-limited C-API for
locking a single object or two objects at once.

* `Py_BEGIN_CRITICAL_SECTION(op)` / `Py_END_CRITICAL_SECTION()`
* `Py_BEGIN_CRITICAL_SECTION2(a, b)` / `Py_END_CRITICAL_SECTION2()`

The supporting functions and structs used by the macros are also exposed for
cases where C macros are not available.

16 months agogh-120838: Add a Note in the Docs About Expectations for Py_Finalize() (gh-120839)
Eric Snow [Fri, 21 Jun 2024 19:05:53 +0000 (13:05 -0600)] 
gh-120838: Add a Note in the Docs About Expectations for Py_Finalize() (gh-120839)

16 months agogh-119003: Clarify slice assignments (#119935)
Nice Zombies [Fri, 21 Jun 2024 18:30:50 +0000 (20:30 +0200)] 
gh-119003: Clarify slice assignments (#119935)

16 months agoAmend categories of @nineteendo's news entries (#120735)
Nice Zombies [Fri, 21 Jun 2024 18:20:13 +0000 (20:20 +0200)] 
Amend categories of @nineteendo's news entries (#120735)

16 months agogh-119182: Rewrite PyUnicodeWriter tests in Python (#120845)
Victor Stinner [Fri, 21 Jun 2024 18:15:06 +0000 (20:15 +0200)] 
gh-119182: Rewrite PyUnicodeWriter tests in Python (#120845)

16 months agogh-119182: Add PyUnicodeWriter_DecodeUTF8Stateful() (#120639)
Victor Stinner [Fri, 21 Jun 2024 17:33:15 +0000 (19:33 +0200)] 
gh-119182: Add PyUnicodeWriter_DecodeUTF8Stateful() (#120639)

Add PyUnicodeWriter_WriteWideChar() and
PyUnicodeWriter_DecodeUTF8Stateful() functions.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
16 months agogh-120811: Fix reference leak upon `_PyContext_Exit` failure (#120812)
Peter [Fri, 21 Jun 2024 17:28:19 +0000 (12:28 -0500)] 
gh-120811: Fix reference leak upon `_PyContext_Exit` failure (#120812)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
16 months agogh-120782: Update internal type cache when reloading datetime (#120829)
neonene [Fri, 21 Jun 2024 17:09:33 +0000 (02:09 +0900)] 
gh-120782: Update internal type cache when reloading datetime (#120829)

16 months agogh-113993: Allow interned strings to be mortal, and fix related issues (GH-120520)
Petr Viktorin [Fri, 21 Jun 2024 15:19:31 +0000 (17:19 +0200)] 
gh-113993: Allow interned strings to be mortal, and fix related issues (GH-120520)

* Add an InternalDocs file describing how interning should work and how to use it.

* Add internal functions to *explicitly* request what kind of interning is done:
  - `_PyUnicode_InternMortal`
  - `_PyUnicode_InternImmortal`
  - `_PyUnicode_InternStatic`

* Switch uses of `PyUnicode_InternInPlace` to those.

* Disallow using `_Py_SetImmortal` on strings directly.
  You should use `_PyUnicode_InternImmortal` instead:
  - Strings should be interned before immortalization, otherwise you're possibly
    interning a immortalizing copy.
  - `_Py_SetImmortal` doesn't handle the `SSTATE_INTERNED_MORTAL` to
    `SSTATE_INTERNED_IMMORTAL` update, and those flags can't be changed in
    backports, as they are now part of public API and version-specific ABI.

* Add private `_only_immortal` argument for `sys.getunicodeinternedsize`, used in refleak test machinery.

* Make sure the statically allocated string singletons are unique. This means these sets are now disjoint:
  - `_Py_ID`
  - `_Py_STR` (including the empty string)
  - one-character latin-1 singletons

  Now, when you intern a singleton, that exact singleton will be interned.

* Add a `_Py_LATIN1_CHR` macro, use it instead of `_Py_ID`/`_Py_STR` for one-character latin-1 singletons everywhere (including Clinic).

* Intern `_Py_STR` singletons at startup.

* For free-threaded builds, intern `_Py_LATIN1_CHR` singletons at startup.

* Beef up the tests. Cover internal details (marked with `@cpython_only`).

* Add lots of assertions

Co-Authored-By: Eric Snow <ericsnowcurrently@gmail.com>
16 months agogh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and `bytearray...
Bénédikt Tran [Fri, 21 Jun 2024 12:22:38 +0000 (14:22 +0200)] 
gh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and `bytearray` objects in protocol version 5. (GH-120422)

16 months agogh-120773: document introspective attributes of an async generator object in the...
blhsing [Fri, 21 Jun 2024 10:55:36 +0000 (18:55 +0800)] 
gh-120773: document introspective attributes of an async generator object in the inspect module (#120778)

16 months agogh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (#120442)
Nikita Sobolev [Fri, 21 Jun 2024 10:48:38 +0000 (13:48 +0300)] 
gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (#120442)

16 months agoGH-120804: Remove SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher from...
Kumar Aditya [Fri, 21 Jun 2024 04:53:10 +0000 (10:23 +0530)] 
GH-120804: Remove SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher from asyncio (#120805)

Remove SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher from asyncio. These child watchers have been deprecated since Python 3.12. The tests are also removed and some more tests will be added after the rewrite of child watchers.

16 months agogh-111259: Document idiomatic RE pattern (?s:.) that matches any character (GH-120745)
Serhiy Storchaka [Thu, 20 Jun 2024 21:03:49 +0000 (00:03 +0300)] 
gh-111259: Document idiomatic RE pattern (?s:.) that matches any character (GH-120745)

16 months agogh-119182: Use public PyUnicodeWriter in contextvar_tp_repr() (#120809)
Victor Stinner [Thu, 20 Jun 2024 19:56:47 +0000 (21:56 +0200)] 
gh-119182: Use public PyUnicodeWriter in contextvar_tp_repr() (#120809)

The public PyUnicodeWriter API enables overallocation by default and
so is more efficient. It also makes the code simpler and shorter.

16 months agogh-119182: Optimize PyUnicode_FromFormat() (#120796)
Victor Stinner [Thu, 20 Jun 2024 19:06:16 +0000 (21:06 +0200)] 
gh-119182: Optimize PyUnicode_FromFormat() (#120796)

Use strchr() and ucs1lib_find_max_char() to optimize the code path
formatting sub-strings between '%' formats.

16 months agogh-120801: Refactor importlib.metadata fixtures. (#120803)
Jason R. Coombs [Thu, 20 Jun 2024 19:00:39 +0000 (15:00 -0400)] 
gh-120801: Refactor importlib.metadata fixtures. (#120803)

These changes released with importlib_metadata 7.2.0.

16 months agogh-119182: Use public PyUnicodeWriter API in union_repr() (#120797)
Victor Stinner [Thu, 20 Jun 2024 18:39:34 +0000 (20:39 +0200)] 
gh-119182: Use public PyUnicodeWriter API in union_repr() (#120797)

The public PyUnicodeWriter API enables overallocation by default and
so is more efficient.

Benchmark:

python -m pyperf timeit \
    -s 't = int | float | complex | str | bytes | bytearray' \
       ' | memoryview | list | dict' \
    'str(t)'

Result:

1.29 us +- 0.02 us -> 1.00 us +- 0.02 us: 1.29x faster

16 months agogh-119182: Use public PyUnicodeWriter API in ga_repr() (#120799)
Victor Stinner [Thu, 20 Jun 2024 18:35:35 +0000 (20:35 +0200)] 
gh-119182: Use public PyUnicodeWriter API in ga_repr() (#120799)

The public PyUnicodeWriter API enables overallocation by default and
so is more efficient.

Benchmark:

python -m pyperf timeit \
    -s 't = list[int, float, complex, str, bytes, bytearray, ' \
                 'memoryview, list, dict]' \
    'str(t)'

Result:

1.49 us +- 0.03 us -> 1.10 us +- 0.02 us: 1.35x faster

16 months agogh-120769: Add pdb meta command to print frame status. (#120770)
Tian Gao [Thu, 20 Jun 2024 17:38:07 +0000 (10:38 -0700)] 
gh-120769: Add pdb meta command to print frame status. (#120770)

16 months agogh-117511: Make PyMutex public in the non-limited API (#117731)
Sam Gross [Thu, 20 Jun 2024 15:29:08 +0000 (11:29 -0400)] 
gh-117511: Make PyMutex public in the non-limited API (#117731)

16 months agogh-120780: Show attribute name for LOAD_SPECIAL in dis output (#120781)
Jelle Zijlstra [Thu, 20 Jun 2024 14:07:24 +0000 (07:07 -0700)] 
gh-120780: Show attribute name for LOAD_SPECIAL in dis output (#120781)

16 months agogh-98442: fix locations of with statement's cleanup instructions (#120763)
Irit Katriel [Thu, 20 Jun 2024 08:32:06 +0000 (09:32 +0100)] 
gh-98442: fix locations of with statement's cleanup instructions (#120763)

gh-98442: fix location of with statement's cleanup instructions

16 months agogh-111259: Optimize complementary character sets in RE (GH-120742)
Serhiy Storchaka [Thu, 20 Jun 2024 07:19:32 +0000 (10:19 +0300)] 
gh-111259: Optimize complementary character sets in RE (GH-120742)

Patterns like "[\s\S]" or "\s|\S" which match any character are now compiled
to the same effective code as a dot with the DOTALL modifier ("(?s:.)").