]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-148208: Fix recursion depth leak in `PyObject_Print` (GH-148209) (#148412)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 12 Apr 2026 00:52:21 +0000 (02:52 +0200)
committerGitHub <noreply@github.com>
Sun, 12 Apr 2026 00:52:21 +0000 (00:52 +0000)
gh-148208: Fix recursion depth leak in `PyObject_Print` (GH-148209)
(cherry picked from commit e2fa10e04d3fed4c248881d69411fc208d05ad6b)

Co-authored-by: Wulian233 <1055917385@qq.com>
Misc/NEWS.d/next/Core_and_Builtins/2026-04-07-20-21-44.gh-issue-148208.JAxpDU.rst [new file with mode: 0644]
Objects/object.c

diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-04-07-20-21-44.gh-issue-148208.JAxpDU.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-07-20-21-44.gh-issue-148208.JAxpDU.rst
new file mode 100644 (file)
index 0000000..b8ae19f
--- /dev/null
@@ -0,0 +1 @@
+Fix recursion depth leak in :c:func:`PyObject_Print`
index 62e45f96bfae39c571a726290dfe1cb69fe84b28..6a17f71886ed96de2cf691f3a74592458923949d 100644 (file)
@@ -686,6 +686,8 @@ PyObject_Print(PyObject *op, FILE *fp, int flags)
             ret = -1;
         }
     }
+
+    _Py_LeaveRecursiveCall();
     return ret;
 }