gh-116957: configparser: Do post-process values after DuplicateOptionError#116958
gh-116957: configparser: Do post-process values after DuplicateOptionError#116958serhiy-storchaka merged 2 commits intopython:mainfrom
Conversation
…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.
|
This diff is best viewed with "ignore whitespace changes". |
|
Without this fix, the new test fails like this: |
|
Thanks @drothlis for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
|
Thanks @drothlis for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
Sorry, @drothlis and @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @drothlis and @serhiy-storchaka, I could not cleanly backport this to |
…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>
|
GH-117012 is a backport of this pull request to the 3.11 branch. |
…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>
|
GH-117013 is a backport of this pull request to the 3.12 branch. |
…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)
…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)
…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.
…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.
…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.
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
getcalls would raise "AttributeError: 'list' object has no attribute 'find'" from somewhere deep in the interpolation code.Fixes #116957.