New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configparser.DuplicateOptionError leaves ConfigParser instance in bad state #116957
Labels
type-bug
An unexpected behavior, bug, or error
Comments
This behaviour is because Lines 1059 to 1062 in 43c9d61
|
drothlis
added a commit
to drothlis/cpython
that referenced
this issue
Mar 18, 2024
…OptionError 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.
drothlis
added a commit
to drothlis/cpython
that referenced
this issue
Mar 18, 2024
serhiy-storchaka
pushed a commit
that referenced
this issue
Mar 19, 2024
…Error (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.
drothlis
added a commit
to drothlis/cpython
that referenced
this issue
Mar 19, 2024
…plicateOptionError (pythonGH-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. (cherry picked from commit b1bc375) Co-authored-by: David Röthlisberger <david@rothlis.net>
drothlis
added a commit
to drothlis/cpython
that referenced
this issue
Mar 19, 2024
…plicateOptionError (pythonGH-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. (cherry picked from commit b1bc375) Co-authored-by: David Röthlisberger <david@rothlis.net>
ambv
pushed a commit
that referenced
this issue
Mar 19, 2024
…eOptionError (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 b1bc375)
ambv
pushed a commit
that referenced
this issue
Mar 19, 2024
…eOptionError (GH-116958) (GH-117012) 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 b1bc375)
vstinner
pushed a commit
to vstinner/cpython
that referenced
this issue
Mar 20, 2024
…OptionError (pythonGH-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.
adorilson
pushed a commit
to adorilson/cpython
that referenced
this issue
Mar 25, 2024
…OptionError (pythonGH-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.
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
…OptionError (pythonGH-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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
If you catch
configparser.Error
when reading a config file (the intention is to skip invalid config files) and then attempt to use the ConfigParser instance, you can get really weird errors. In the following example,read
raises DuplicateOptionError from the 2nd section, but attempting toget
a value from the first section fails in the interpolation code, because somehow the value has been stored as a list instead of a string!Disabling interpolation can read the value from the 1st section but it's a list, not a str!
CPython versions tested on:
3.10, 3.12, CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: