From 23746df60b83db782a1760b5a785e7c97e4643ff Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 12 Jan 2024 12:41:53 -0800 Subject: [PATCH 1/2] GH-111802: set a low recursion limit for `test_bad_getattr()` in `test.pickletester` --- Lib/test/pickletester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 74b82caf742f20..93e7dbbd103934 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -2437,7 +2437,7 @@ def test_bad_getattr(self): # Issue #3514: crash when there is an infinite loop in __getattr__ x = BadGetattr() for proto in range(2): - with support.infinite_recursion(): + with support.infinite_recursion(25): self.assertRaises(RuntimeError, self.dumps, x, proto) for proto in range(2, pickle.HIGHEST_PROTOCOL + 1): s = self.dumps(x, proto) From 36877fe9c33e3bf9af0913d80cfd663156471e93 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 12 Jan 2024 12:45:51 -0800 Subject: [PATCH 2/2] Add news entry --- .../next/Tests/2024-01-12-12-45-24.gh-issue-111802.gN41vt.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2024-01-12-12-45-24.gh-issue-111802.gN41vt.rst diff --git a/Misc/NEWS.d/next/Tests/2024-01-12-12-45-24.gh-issue-111802.gN41vt.rst b/Misc/NEWS.d/next/Tests/2024-01-12-12-45-24.gh-issue-111802.gN41vt.rst new file mode 100644 index 00000000000000..7ebcbff1b9b80d --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2024-01-12-12-45-24.gh-issue-111802.gN41vt.rst @@ -0,0 +1,3 @@ +Specify a low recursion depth for ``test_bad_getattr()`` in +``test.pickletester`` to avoid exhausting the stack under a pydebug build +for WASI.