For unknown reasons some arguments for Tkinter binding can be created
as a 1-tuple containing a Tcl_Obj when wantobjects is 2.
(cherry picked from commit 5b88d95cc5)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
I honestly forgot this slipped into 3.13, but I think it's worth highlighting more, as it is a PEP-sized change that makes the type system significantly more powerful.
@Yhg1s I think it's also worth mentioning in your release announcements.
(cherry picked from commit ee13797dec)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-58933: Make pdb return to caller frame correctly when f_trace is not set (GH-118979)
(cherry picked from commit f526314194)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Fixes an AttributeError that occurs when checking if ns.temp is an absolute path during building from source on Windows.
(cherry picked from commit d8a82cca12)
Co-authored-by: I-Shen Leong <i-shenl@activestate.com>
gh-117655: Prevent `test_strptime` from raising a DeprecationWarning (GH-117668)
* Fix `test_strptime` raises a DeprecationWarning
* Ignore deprecation warnings where appropriate.
* Update Lib/test/datetimetester.py
This is follow on work to silence unnecessary warnings from the test suite that changes for https://github.com/python/cpython/issues/70647 added.
(cherry picked from commit abead548af)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
This ensures we don't lose races that occur in subprocesses or
interleave races from workers running in parallel.
Log files are collected and packaged into a zipfile that can be
downloaded from the "Artifacts" section of the workflow run.
(cherry picked from commit b88889e9ff)
Co-authored-by: mpage <mpage@meta.com>
The free-threaded build currently immortalizes some objects once the
first thread is started. This can lead to test failures depending on the
order in which tests are run. This PR addresses those failures by
suppressing immortalization or skipping the affected tests.
(cherry picked from commit b309c8ebff)
Co-authored-by: Sam Gross <colesbury@gmail.com>
`_Py_qsbr_unregister` is called when the PyThreadState is already
detached, so the access to `tstate->qsbr` isn't safe without locking the
shared mutex. Grab the `struct _qsbr_shared` from the interpreter
instead.
(cherry picked from commit 33d20199af)
Co-authored-by: Alex Turner <alexturner@meta.com>
Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst` (GH-118098)
Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst`.
(cherry picked from commit c444362c6e)
Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
gh-118789: Restore hidden `_PyWeakref_ClearRef` (GH-118797)
_PyWeakref_ClearRef was previously exposed in the public C-API, although
it begins with an underscore and is not documented. It's used by a few
C-API extensions. There is currently no alternative public API that can
replace its use.
_PyWeakref_ClearWeakRefsExceptCallbacks is the only thread-safe way to
use _PyWeakref_ClearRef in the free-threaded build. This exposes the C
symbol, but does not make the API public.
(cherry picked from commit db5af7da09)
Co-authored-by: Sam Gross <colesbury@gmail.com>
This reverts commit ad4f909e0e.
The API ended up not being used.
(cherry picked from commit 46c808172f)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Using `race:` filters out warnings if the function appears anywhere in
the stack trace. This can hide a lot of unrelated warnings, especially
for a function like `_PyEval_EvalFrameDefault`, which is somewhere on
the stack more often than not.
Change all free-threaded suppressions to `race_top:`, which only matches
the top frame, and add any new suppressions this exposes.
(cherry picked from commit 98ff3f65c0)
Co-authored-by: Brett Simmers <swtaarrs@users.noreply.github.com>
Avoid immortalizing objects in tests that verify garbage collection of
classes or modules.
This fixes test_ordered_dict and test_struct.
(cherry picked from commit 1b1db2fd9a)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Some embedders and extensions include parts of the internal API. The
pycore_mimalloc.h file is transitively include by a number of other
internal headers. This avoids include errors for code that was
already including those headers.
(cherry picked from commit 71cc0651e7)
Co-authored-by: Sam Gross <colesbury@gmail.com>
The `list_preallocate_exact` function did not zero initialize array
contents. In the free-threaded build, this could expose uninitialized
memory to concurrent readers between the call to
`list_preallocate_exact` and the filling of the array contents with
items.
(cherry picked from commit 2402715e10)
Co-authored-by: Sam Gross <colesbury@gmail.com>
gh-118849: Fix "code will never be executed" warning in `dictobject.c` (GH-118850)
(cherry picked from commit 82abe75e77)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
These methods are purely wrappers around `Semlock.{acquire,release}`,
which expect a critical section to be held.
(cherry picked from commit c30d8e5d6c)
Co-authored-by: mpage <mpage@meta.com>
Print only filename with lineno if linecache.getline() returns an empty string.
(cherry picked from commit 7c87ce777b)
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
gh-118033: Fix `__weakref__` not set for generic dataclasses (GH-118099)
(cherry picked from commit fa9b9cb113)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
[tests]: Mark ``test_statistics.test_kde_random`` with a ``requires_resource('cpu')`` decorator (GH-118801)
Mark test_kde_random with a requires_resource('cpu') decorator
(cherry picked from commit 027e6d88fb)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Use relaxed atomics when reading / writing to the field. There are still a
few places in the GC where we do not use atomics. Those should be safe as
the world is stopped.
(cherry picked from commit cb6f75a32c)
Co-authored-by: mpage <mpage@meta.com>
docs: module page titles should not start with a link to themselves (GH-117099)
(cherry picked from commit bcb435ee8f)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>