From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 12 Apr 2026 00:52:21 +0000 (+0200) Subject: [3.14] gh-148208: Fix recursion depth leak in `PyObject_Print` (GH-148209) (#148412) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9d122fb0547ee0f97cd3034fbd8bb5ca1e5800b;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-148208: Fix recursion depth leak in `PyObject_Print` (GH-148209) (#148412) gh-148208: Fix recursion depth leak in `PyObject_Print` (GH-148209) (cherry picked from commit e2fa10e04d3fed4c248881d69411fc208d05ad6b) Co-authored-by: Wulian233 <1055917385@qq.com> --- 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 index 000000000000..b8ae19f5877a --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-07-20-21-44.gh-issue-148208.JAxpDU.rst @@ -0,0 +1 @@ +Fix recursion depth leak in :c:func:`PyObject_Print` diff --git a/Objects/object.c b/Objects/object.c index 62e45f96bfae..6a17f71886ed 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -686,6 +686,8 @@ PyObject_Print(PyObject *op, FILE *fp, int flags) ret = -1; } } + + _Py_LeaveRecursiveCall(); return ret; }