]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-111802: set a low recursion limit for `test_bad_getattr()` in `test.pickletester...
authorBrett Cannon <brett@python.org>
Fri, 12 Jan 2024 22:14:09 +0000 (14:14 -0800)
committerGitHub <noreply@github.com>
Fri, 12 Jan 2024 22:14:09 +0000 (14:14 -0800)
Lib/test/pickletester.py
Misc/NEWS.d/next/Tests/2024-01-12-12-45-24.gh-issue-111802.gN41vt.rst [new file with mode: 0644]

index 74b82caf742f200d12368a147ac89cfc7c4ce072..93e7dbbd10393423717cc7cc2fe77133c6521972 100644 (file)
@@ -2437,7 +2437,7 @@ class AbstractPickleTests:
         # 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)
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 (file)
index 0000000..7ebcbff
--- /dev/null
@@ -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.