* The parser no longer changes temporarily during parsing.
* Default values are not processed twice.
* Required mutually exclusive groups containing positional arguments are
now supported.
* The missing arguments report now includes the names of all required
optional and positional arguments.
* Unknown options can be intermixed with positional arguments in
parse_known_intermixed_args().
(cherry picked from commit 759a54d28f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This includes a drive-by cleanup in _queues_init() and _queues_fini().
This change also applies to the _interpchannels module.
(cherry picked from commit 4848b0b92c, AKA gh-125803)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
The fix applies to the _interpchannels module as well.
I've also included a drive-by typo fix for _interpqueues.
(cherry picked from commit 44f841f01a, AKA gh-125802)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Use fixed timezone.
Skip roundtrip tests on locales with 2-digit year.
(cherry picked from commit 9dde4638e4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This is a follow up of GH-124974. Only Glibc needed a fix.
Now the returned value is a string consisting of semicolon-separated
symbols on all Posix platforms.
(cherry picked from commit dcc4fb2c90)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-125590: Allow FrameLocalsProxy to delete and pop keys from extra locals (GH-125616)
(cherry picked from commit 5b7a872b26)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
It looks like commit 43cf44ddcc
(gh-31501) accidentally moved the paragraph to the `tp_finalize`
section when the intent was to move it to the `tp_dealloc` section
(according to the commit message).
(cherry picked from commit d880c83ff7)
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
gh-125519: Improve traceback if `importlib.reload()` is called with a non-module object (GH-125520)
(cherry picked from commit c5c21fee7a)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-125378: Trigger a repeat for the full multi-line statement for empty line command (GH-125717)
(cherry picked from commit 8f5e39d5c8)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
gh-125620: Skip check_resource_tracker_death on NetBSD due to long wait for SIGKILL process termination (GH-125621)
* Skip test_resource_tracker_sigkill on NetBSD
(cherry picked from commit a0f5c8e627)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
gh-125667: Statically Initialize the Arg Converter Data Values in _interpqueuesmodule.c (gh-125668)
(cherry picked from commit 7cf2dbc3cb)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Fix time.strftime(), the strftime() method and formatting of the
datetime classes datetime, date and time.
* Characters not encodable in the current locale are now acceptable in
the format string.
* Surrogate pairs and sequence of surrogatescape-encoded bytes are no
longer recombinated.
* Embedded null character no longer terminates the format string.
This fixes also gh-78662 and gh-124531.
(cherry picked from commit ad3eac1963)
[3.13] gh-123370: Fix the canvas not clearing after running turtledemo.clock (GH-123457)
Rewriting the day and date every tick somehow prevented them from being removed either by clicking STOP or loading another example. The solution is to rewrite them only when they change.
(cherry picked from commit c124577ebe)
Co-authored-by: Wulian <xiguawulian@gmail.com>
There was a deadlock when `ProcessPoolExecutor` shuts down at the same
time that a queueing thread handles an error processing a task.
Don't use `_shutdown_lock` to protect the `_ThreadWakeup` pipes -- use
an internal lock instead. This fixes the ordering deadlock where the
`ExecutorManagerThread` holds the `_shutdown_lock` and joins the
queueing thread, while the queueing thread is attempting to acquire the
`_shutdown_lock` while closing the `_ThreadWakeup`.
(cherry picked from commit 760872efec)
Co-authored-by: Sam Gross <colesbury@gmail.com>
On Arm v5 it is not possible to get the thread ID via c13 register
hence the illegal instruction. The c13 register started to provide
thread ID since Arm v6K architecture variant. Other variants of
Arm v6 (T2, Z and base) don’t provide the thread ID via c13.
For the sake of simplicity we group v5 and v6 together and
consider that instructions for Arm v7 only.
(cherry picked from commit feda9aa73a)
Co-authored-by: Diego Russo <diego.russo@arm.com>
Lock `ZoneInfoType` to protect accesses to `ZONEINFO_STRONG_CACHE`.
Refactor the `tp_new` handler to use Argument Clinic so that we can just
use `@critical_section` annotations on the relevant functions.
Also use `PyDict_SetDefaultRef` instead of `PyDict_SetDefault` when
inserting into the `TIMEDELTA_CACHE`.
(cherry picked from commit f1d33dbddd)
Co-authored-by: Sam Gross <colesbury@gmail.com>
gh-58956: Set f_trace on frames with breakpoints after setting a new breakpoint (GH-124454)
(cherry picked from commit 12eaadc0ad)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
This fixes a crash when running the PyO3 test suite on the free-threaded
build. The `qsbr` field is initialized after the `PyThreadState` is
added to the interpreter's linked list -- it might still be NULL.
Instead, we "steal" the queue of to-be-freed memory blocks. This is
always initialized (possibly empty) and protected by the stop the world
pause.
(cherry picked from commit 54c6fcbefd)
Co-authored-by: Sam Gross <colesbury@gmail.com>
gh-125422: Don't set the caller's f_trace if it's botframe (GH-125427)
(cherry picked from commit 703227dd02)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
gh-124594: Create and reuse the same context for the entire asyncio REPL session (GH-124595)
(cherry picked from commit 67e01a430f)
Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>