-
Notifications
You must be signed in to change notification settings - Fork 93
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
Restore the ability to use inline comments in config files #461
Restore the ability to use inline comments in config files #461
Conversation
4f7e021
to
e671acd
Compare
Hi, one clarification: you titled "restore" but when did we drop the ability to use inline comments? (in which commit?). |
e7ce6a5
to
6ebc711
Compare
Here I see this:
Also keep in mind that inline comments may cause interpolation errors. Example here: #443 (comment). Um, don't know if restoring this would be a good idea... |
I suspect that #443 is actually a result of the problem this PR is trying to fix, because the comments won't have been treated as comments in any Python 3 version of whipper: they'll just have been part of the value. In other words, re-enabling inline comments would prevent that problem. Without this PR, inline comments won't be possible at all, but they're used liberally in whipper's documentation and examples, so those places would all need to be updated. However, more importantly, I expect many people (like me) have existing config files with comments in them that were used with a Python 2 version of whipper, and now whipper dies with a strange error message about boolean values whenever they try to run it. |
I'm not sure what you meant by the quote from the Python 2 documentation. That if we do re-enable comments we should allow only |
Hi, after some tests I've verified that:
I agree this is a regression so I'm going to merge this pull request but first I need you to edit it to remove character Cheers, †
|
The ability was lost in the switch to Python 3, because the config parser module in the standard library changed its defaults. [Python 2][2]: > Comments may appear on their own in an otherwise empty line, or > may be entered in lines holding values or section names. [Python 3][3]: > Inline comments can be harmful because they prevent users > from using the delimiting characters as parts of values. > That being said, this can be customized. [2]: https://docs.python.org/2/library/configparser.html#module-ConfigParser [3]: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure Signed-off-by: Neil Mayhew <[email protected]>
6ebc711
to
dca9fcb
Compare
Yes, I agree it's best to match the original behaviour exactly. Done. |
Merged, thanks! |
This change is