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
{{ message }}
Repository navigation
ExtendedInterpolation drops user-defined 'vars' during _interpolate_some() recursion #70999
In Python 3.5.1, configparser.ExtendedInterpolation will drop the user-defined 'vars' passed in via ConfigParser.get(vars=...) due to a bug when recursing beyond depth 1 in ExtendedInterpolation._interpolate_some(). Line 509 of configparser.py currently reads: 'dict(parser.items(sect, raw=True))' This appears to be a mistake and should instead be: 'map', which includes the user-defined vars.
The following code will trigger an InterpolationMissingOptionError without the fix, and runs as expected with the fix:
Activity
yab-arz commentedon Apr 21, 2016
In Python 3.5.1, configparser.ExtendedInterpolation will drop the user-defined 'vars' passed in via ConfigParser.get(vars=...) due to a bug when recursing beyond depth 1 in ExtendedInterpolation._interpolate_some(). Line 509 of configparser.py currently reads: 'dict(parser.items(sect, raw=True))' This appears to be a mistake and should instead be: 'map', which includes the user-defined vars.
The following code will trigger an InterpolationMissingOptionError without the fix, and runs as expected with the fix:
ambv commentedon May 2, 2016
This is true. Care to author a patch?
yab-arz commentedon May 3, 2016
Sure, patch attached.
pythongh-70999: Preserve caller vars in ExtendedInterpolation nested …
Merge branch 'main' into pythongh-70999-extendedinterpolation-vars
pythongh-70999: Preserve caller vars in ExtendedInterpolation nested …
pythongh-70999: trim verbose test comments per review
pythongh-70999: shorten the nested-vars test comment to one line
Merge remote-tracking branch 'origin/main' into pythongh-70999-extend…
Merge remote-tracking branch 'origin/main' into pythongh-70999-extend…