mirror of
https://github.com/python/cpython.git
synced 2025-10-22 17:33:55 +00:00
[3.13] gh-130941: Fix configparser
parsing values with allow_no_value
and interpolation
set (GH-130949) (#132588)
gh-130941: Fix `configparser` parsing values with `allow_no_value` and `interpolation` set (GH-130949)
(cherry picked from commit c35c7353eb
)
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
8128bcfa08
commit
ee8f681252
3 changed files with 45 additions and 0 deletions
|
@ -526,6 +526,8 @@ def _interpolate_some(self, parser, option, accum, rest, section, map,
|
|||
except (KeyError, NoSectionError, NoOptionError):
|
||||
raise InterpolationMissingOptionError(
|
||||
option, section, rawval, ":".join(path)) from None
|
||||
if v is None:
|
||||
continue
|
||||
if "$" in v:
|
||||
self._interpolate_some(parser, opt, accum, v, sect,
|
||||
dict(parser.items(sect, raw=True)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue