From 8a95afb6d7a2255f5e5b270a0e21193911877ad7 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 3 Dec 2025 08:17:23 -0600 Subject: [PATCH 1/2] gh-140125: Increase recursion depth for `test_json` from 200k to 500k --- Lib/test/test_json/test_recursion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_json/test_recursion.py b/Lib/test/test_json/test_recursion.py index 5d7b56ff9ad285..3110ce746b80f9 100644 --- a/Lib/test/test_json/test_recursion.py +++ b/Lib/test/test_json/test_recursion.py @@ -71,7 +71,7 @@ def default(self, o): @support.skip_emscripten_stack_overflow() @support.skip_wasi_stack_overflow() def test_highly_nested_objects_decoding(self): - very_deep = 200000 + very_deep = 500000 # test that loading highly-nested objects doesn't segfault when C # accelerations are used. See #12017 with self.assertRaises(RecursionError): @@ -90,7 +90,7 @@ def test_highly_nested_objects_decoding(self): def test_highly_nested_objects_encoding(self): # See #12051 l, d = [], {} - for x in range(200_000): + for x in range(500_000): l, d = [l], {'k':d} with self.assertRaises(RecursionError): with support.infinite_recursion(5000): From 3394248c6d1611e23d38cb489f69f76e5b29f520 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 5 Dec 2025 13:30:41 -0600 Subject: [PATCH 2/2] Use `_` consistently Co-authored-by: Victor Stinner --- Lib/test/test_json/test_recursion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_json/test_recursion.py b/Lib/test/test_json/test_recursion.py index 3110ce746b80f9..40a0baa53f0c3b 100644 --- a/Lib/test/test_json/test_recursion.py +++ b/Lib/test/test_json/test_recursion.py @@ -71,7 +71,7 @@ def default(self, o): @support.skip_emscripten_stack_overflow() @support.skip_wasi_stack_overflow() def test_highly_nested_objects_decoding(self): - very_deep = 500000 + very_deep = 500_000 # test that loading highly-nested objects doesn't segfault when C # accelerations are used. See #12017 with self.assertRaises(RecursionError):