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>
gh-125269: Use `AC_LINK_IF_ELSE` to detect if `-latomic` is needed (GH-125416)
We previously used `AC_RUN_IF_ELSE` with a short test program to detect
if `-latomic` is needed, but that requires choosing a specific default
value when cross-compiling because the test program is not run.
Some cross compilation targets like `wasm32-emscripten` do not support
`-latomic`, while other cross compilation targets, like
`arm-linux-gnueabi` require it.
(cherry picked from commit 8d42e2d915)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Fix idlelib typos (GH-125484)
Propagate fixes in Doc/library/idle.rst to help.html.
Change 'interruptable' to 'interruptible' in run.py.
The latter was reported by ember91 in PR 125473.
(cherry picked from commit 3fea1d000e)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL (#124999)
Co-authored-by: Wulian <xiguawulian@gmail.com>
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 6a08a753b7)
Fixed most locales that use non-ASCII digits, like Persian, Burmese,
Odia and Shan.
(cherry picked from commit 5f4e5b598c)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-125461: Remove Python 2 from identifiers in doc (GH-125462)
Remove Python 2 from identifiers in doc
(cherry picked from commit 5dac0dceda)
Co-authored-by: Paul Hoffman <phoffman@proper.com>
gh-112088: aclocal version is updated to 1.16.5 in docs (GH-125457)
(cherry picked from commit 45df264f3f)
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
(cherry picked from commit cfc27bc50f)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
`PurePath.__init__()` incorrectly uses the `_raw_paths` of a given
`PurePath` object with a different flavour, even though the procedure to
join path segments can differ between flavours.
This change makes the `_raw_paths`-enabled deferred joining apply _only_
when the path flavours match.
(cherry picked from commit cb8e5995d8)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-125383: Update `fib` function comment for accuracy (GH-125386)
`Doc/tutorial/controlflow.rst`: fix comment for `fib` function
(cherry picked from commit 283ea5f3b2)
Co-authored-by: Wulian <xiguawulian@gmail.com>
In aeca373b3 (PR gh-12011, issue gh-71500), test_identify() was changed to expect different results on Darwin. Ned's fix was later adjusted by e52f9bee8. This workaround is only needed for some variants of Tk/Tcl on macOS, so we now allow both the workaround and the generic results for these tests.
(cherry picked from commit 4197a796ec)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Doc: Fix suggested usage of `-X gil=0` in the glossary (GH-125366)
Currently, the "global interpreter lock" entry in the glossary mentions
that `-X gil 0` can be used to disable the GIL [1]. However, this is
invalid; the correct usage should be `-X gil=0`.
$ python -X gil 0 -c 'print("Hello, world")'
Fatal Python error: config_read_gil: PYTHON_GIL / -X gil must be "0" or "1"
Python runtime state: preinitialized
$ python -X gil=0 -c 'print("Hello, world")'
Hello, world
[1]: https://docs.python.org/3/using/cmdline.htmlGH-cmdoption-X
(cherry picked from commit a8fa4ad9e9)
Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
Co-authored-by: Ruoyu Zhong <zhongruoyu@outlook.com>
gh-125289: Update sample code in asyncio-task.rst (GH-125292)
* Update sample code in asyncio-task.rst
This will change **coroutines** sample code in the **Awaitables** section and make the example clearer.
* Update Doc/library/asyncio-task.rst
Revert the added print
* Update Doc/library/asyncio-task.rst
---------
(cherry picked from commit fa52b82c91)
Co-authored-by: Ghorban M. Tavakoly <58617996+galmyk@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
In some locales (like French or Hebrew) the full or abbreviated names of
the default month and weekday used in __calc_date_time can be part of
other name or constant part of the %c format. The month name can also
match %m with constant suffix (like in Japanese). So the code failed to
correctly distinguish formats %a, %A, %b, %B and %m.
Cycle all month and all days of the week to find the variable part
and distinguish %a from %A and %b from %B or %m.
Fixed locales for the following languges:
Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish,
Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol,
Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi,
Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese.
(cherry picked from commit c05f9dde8a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Eli Bendersky <eliben@gmail.com>
This was a regression introduced in gh-58573. It was only tested for the
case when the ambiguous option is the last argument in the command line.
(cherry picked from commit 63cf4e914f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc: Fix a typo in "Function Examples" in the control-flow tutorial (GH-125338)
(cherry picked from commit 5a074aab84)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>