]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-143880: Fix data race in `functools.partial` in free threading build (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Mar 2026 21:31:46 +0000 (22:31 +0100)
committerGitHub <noreply@github.com>
Mon, 2 Mar 2026 21:31:46 +0000 (21:31 +0000)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Misc/NEWS.d/next/Library/2026-01-15-13-03-22.gh-issue-143880.sWoLsf.rst [new file with mode: 0644]
Modules/_functoolsmodule.c

diff --git a/Misc/NEWS.d/next/Library/2026-01-15-13-03-22.gh-issue-143880.sWoLsf.rst b/Misc/NEWS.d/next/Library/2026-01-15-13-03-22.gh-issue-143880.sWoLsf.rst
new file mode 100644 (file)
index 0000000..b77f86e
--- /dev/null
@@ -0,0 +1 @@
+Fix data race in :func:`functools.partial` in the :term:`free threading` build.
index cbbba322a1825cd970bf89e3ad9c066777d96b57..40c573b3fdf7b642c09581749327587d1ee73fdc 100644 (file)
@@ -220,7 +220,9 @@ partial_vectorcall_fallback(PyThreadState *tstate, partialobject *pto,
                             PyObject *const *args, size_t nargsf,
                             PyObject *kwnames)
 {
+#ifndef Py_GIL_DISABLED
     pto->vectorcall = NULL;
+#endif
     Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
     return _PyObject_MakeTpCall(tstate, (PyObject *)pto,
                                 args, nargs, kwnames);