You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When expanding long strings with many environment variables, a RecursionError occurs.
See a minimal reproducible error here:
# This causes 'RecursionError: maximum recursion depth exceeded'
import expandvars
long_string = " ".join("$VAR" for _ in range(1000))
expandvars.expand(long_string)
Manually increasing the Python recursion limit can increase how many environment variables can be expanded:
# No exception
import expandvars
import sys
sys.setrecursionlimit(2000)
long_string = " ".join("$VAR" for _ in range(1000))
expandvars.expand(long_string)
It seems like internal expand() and expand_vars() functions call each other recursively, causing the issue.
The text was updated successfully, but these errors were encountered:
When expanding long strings with many environment variables, a RecursionError occurs.
See a minimal reproducible error here:
Manually increasing the Python recursion limit can increase how many environment variables can be expanded:
It seems like internal
expand()
andexpand_vars()
functions call each other recursively, causing the issue.The text was updated successfully, but these errors were encountered: