diff --git a/Lib/configparser.py b/Lib/configparser.py --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -406,7 +406,9 @@ rawval = parser.get(section, option, raw=True, fallback=rest) if depth > MAX_INTERPOLATION_DEPTH: raise InterpolationDepthError(option, section, rawval) - while rest: + _rest = rest + del rest + for rest in _rest: p = rest.find("%") if p < 0: accum.append(rest) @@ -467,7 +469,9 @@ rawval = parser.get(section, option, raw=True, fallback=rest) if depth > MAX_INTERPOLATION_DEPTH: raise InterpolationDepthError(option, section, rawval) - while rest: + _rest = rest + del rest + for rest in _rest: p = rest.find("$") if p < 0: accum.append(rest)