summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorDavid Röthlisberger <david@rothlis.net>2024-03-19 09:59:08 (GMT)
committerGitHub <noreply@github.com>2024-03-19 09:59:08 (GMT)
commitb1bc37597f0d36084c4dcb15977fe6d4b9322cd4 (patch)
tree18d75aee9e613b36f202090b8ac370e80c529307 /Misc
parenta8e93d3dca086896e668b88b6c5450eaf644c0e7 (diff)
downloadcpython-b1bc37597f0d36084c4dcb15977fe6d4b9322cd4.zip
cpython-b1bc37597f0d36084c4dcb15977fe6d4b9322cd4.tar.gz
cpython-b1bc37597f0d36084c4dcb15977fe6d4b9322cd4.tar.bz2
gh-116957: configparser: Do post-process values after DuplicateOptionError (GH-116958)
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2024-03-18-14-36-50.gh-issue-116957.dTCs4f.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2024-03-18-14-36-50.gh-issue-116957.dTCs4f.rst b/Misc/NEWS.d/next/Library/2024-03-18-14-36-50.gh-issue-116957.dTCs4f.rst
new file mode 100644
index 0000000..51fe049
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-03-18-14-36-50.gh-issue-116957.dTCs4f.rst
@@ -0,0 +1,3 @@
+configparser: Don't leave ConfigParser values in an invalid state (stored as
+a list instead of a str) after an earlier read raised DuplicateSectionError
+or DuplicateOptionError.