https://github.com/python/cpython/commit/e2fa10e04d3fed4c248881d69411fc208d05ad6b
commit: e2fa10e04d3fed4c248881d69411fc208d05ad6b
branch: main
author: Wulian233 <[email protected]>
committer: gpshead <[email protected]>
date: 2026-04-11T17:26:18-07:00
summary:
gh-148208: Fix recursion depth leak in `PyObject_Print` (GH-148209)
files:
A
Misc/NEWS.d/next/Core_and_Builtins/2026-04-07-20-21-44.gh-issue-148208.JAxpDU.rst
M 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
index 00000000000000..b8ae19f5877a7d
--- /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 4db22f372ec3f7..3166254f6f640b 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -688,6 +688,8 @@ PyObject_Print(PyObject *op, FILE *fp, int flags)
ret = -1;
}
}
+
+ _Py_LeaveRecursiveCall();
return ret;
}
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]