Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive replacement when getdict('setenv') #288

Closed
pytoxbot opened this issue Sep 17, 2016 · 1 comment
Closed

Recursive replacement when getdict('setenv') #288

pytoxbot opened this issue Sep 17, 2016 · 1 comment

Comments

@pytoxbot
Copy link

The thing is that when config.py module replaces
macros in setenv dict, it calls getdict('setenv')
which recursively tries to replace macros.
So, python reports 'maximum recursion depth exceeded' error.

This patch fixes the issue

--- a/tox/config.py Wed Nov 11 15:58:33 2015 +0100
+++ b/tox/config.py Fri Nov 20 10:45:40 2015 +0300
@@ -835,8 +835,8 @@
             return []
         return [x.strip() for x in s.split(sep) if x.strip()]

-    def getdict(self, name, default=None, sep="\n"):
-        s = self.getstring(name, None)
+    def getdict(self, name, default=None, sep="\n", replace=True):
+        s = self.getstring(name, None, replace=replace)
         if s is None:
             return default or {}

@@ -910,7 +910,7 @@
         return '\n'.join(filter(None, map(factor_line, lines)))

     def _replace_env(self, match):
-        env_list = self.getdict('setenv')
+        env_list = self.getdict('setenv', replace=False)
         match_value = match.group('substitution_value')
         if not match_value:
             raise tox.exception.ConfigError(

@pytoxbot
Copy link
Author

Original comment by @kozhukalov

Duplicate of #285.

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant