bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)

This commit is contained in:
Steve Dower 2018-06-04 13:25:00 -07:00 committed by GitHub
parent b609e687a0
commit 2a4a62ba4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -222,7 +222,10 @@ class BugsTestCase(unittest.TestCase):
# Create a deeply nested structure.
head = last = []
# The max stack depth should match the value in Python/marshal.c.
if os.name == 'nt' and hasattr(sys, 'gettotalrefcount'):
# BUG: https://bugs.python.org/issue33720
# Windows always limits the maximum depth on release and debug builds
#if os.name == 'nt' and hasattr(sys, 'gettotalrefcount'):
if os.name == 'nt':
MAX_MARSHAL_STACK_DEPTH = 1000
else:
MAX_MARSHAL_STACK_DEPTH = 2000