-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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.items returns items present in vars #77432
Comments
The documentation for ConfigParser.items(section, raw=False, vars=None) says the following:
https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.items However, this does not seem to be the case. The keys from vars are present in the output. Tested on 3.6.5. This example shows the issue: import configparser
config = configparser.ConfigParser()
config.add_section('example')
config.set('example', 'name', 'timster %(suffix)s')
data = config.items('example', vars={'suffix': 'user'})
print(data) Expected output:
Actual output:
|
Hm. The documentation change was done in bpo-12036 but it seems this was actually never the case, contrary to what the conversation on that other issue there states. I wouldn't change it for 3.6.6 anymore since it's pretty late in the release cycle. This looks like an interesting bug fix for 3.7. |
Well, now that I think about it, this is not even a *bug* fix since it's behavior that configparser had since 1997. So that will have to go straight to 3.8. |
What *actually* was changed in 3.2? |
In terms of this issue, nothing. That piece of documentation was put without proper testing, based purely on a comment that somebody put on bpo-12036. My mistake. |
@ambv The issue seems to have been resolved. Can we close the issue? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: