]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-116957: configparser: Do post-process values after DuplicateOptionError...
authorDavid Röthlisberger <david@rothlis.net>
Tue, 19 Mar 2024 17:18:50 +0000 (17:18 +0000)
committerGitHub <noreply@github.com>
Tue, 19 Mar 2024 17:18:50 +0000 (18:18 +0100)
commit0fc8ae4e284a3766b6275b71bf36f0b5cc38904f
tree1da09103ed40f02477f9792581a6325ff3463133
parent688623d402097a2559fb135ce30384c884d9c78f
[3.12] gh-116957: configparser: Do post-process values after DuplicateOptionError (GH-116958) (GH-117013)

If you catch DuplicateOptionError / DuplicateSectionError when reading a
config file (the intention is to skip invalid config files) and then
attempt to use the ConfigParser instance, any values it *had* read
successfully so far, were stored as a list instead of string! Later
`get` calls would raise "AttributeError: 'list' object has no attribute
'find'" from somewhere deep in the interpolation code.

(cherry picked from commit b1bc37597f0d36084c4dcb15977fe6d4b9322cd4)
Lib/configparser.py
Lib/test/test_configparser.py
Misc/NEWS.d/next/Library/2024-03-18-14-36-50.gh-issue-116957.dTCs4f.rst [new file with mode: 0644]