-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Order of configparser.ConfigParser.read() arguments #96765
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
Comments
I believe this is documented here: https://docs.python.org/3/library/configparser.html
|
Indeed. Sorry about that. Still, I think this piece of information needs to be moved or copied from Quick Start to the configparser.ConfigParser.read documentation. |
#121664) Co-authored-by: Łukasz Langa <[email protected]>
…example (pythonGH-121664) (cherry picked from commit fc21781) Co-authored-by: Timon Viola <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
…example (pythonGH-121664) (cherry picked from commit fc21781) Co-authored-by: Timon Viola <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
… example (GH-121664) (GH-121688) (cherry picked from commit fc21781) Co-authored-by: Timon Viola <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
… example (GH-121664) (GH-121687) (cherry picked from commit fc21781) Co-authored-by: Timon Viola <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
…example (python#121664) Co-authored-by: Łukasz Langa <[email protected]>
…example (python#121664) Co-authored-by: Łukasz Langa <[email protected]>
Bug report
When multiple INI configuration files with identical section(s) and key(s) are fed to
configparser.ConfigParser.read
, the result is undefined / not documented. Actually the last file containing a given section/key takes precedence over previous files, as I would have expected from a straightforward implementation. However:Perhaps this behaviour should be changed, and the first file take precedence over subsequent files. In practice that would break compatibility, but since the result is currently undocumented, that may be OK.Example
Here are two INI files:
1.ini
2.ini
And here is the order of the filenames changes the result:
Your environment
Linked PRs
The text was updated successfully, but these errors were encountered: