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
Traceback (most recent call last):
File "test.py", line 4, in <module>
config.get("dummy", "b")
File "python3.12/configparser.py", line 777, in get
return self._interpolation.before_get(self, section, option, value,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "python3.12/configparser.py", line 428, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "python3.12/configparser.py", line 481, in _interpolate_some
if "$" in v:
^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
Since the value of a is None the interpolation should convert the reference first to an empty string to keep interpolation alive.
Expected value for b would be an empty string.
…lue` 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 c35c735)
Co-authored-by: sobolevn <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
The configparser modules throws an Exception as:
when using:
config.ini
and following ConfigParser settings:
test.py
Since the value of a is None the interpolation should convert the reference first to an empty string to keep interpolation alive.
Expected value for b would be an empty string.
CPython versions tested on:
3.12, 3.13
Operating systems tested on:
Linux, Windows
Linked PRs
configparser
parsing values withallow_no_value
andinterpolation
set #130949configparser
parsing values withallow_no_value
andinterpolation
set (GH-130949) #132588The text was updated successfully, but these errors were encountered: