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.py do not allow leading (and trailing) space in values. #46055
Comments
I have some configuration params with leading space. And program This patch will solve it (it is against my OS, sorry no chance to --- /usr/lib/python2.4/ConfigParser.py.orig 2007-12-31
16:04:32.000000000 +0100
+++ /usr/lib/python2.4/ConfigParser.py 2007-12-31 16:06:50.000000000 +0100
@@ -472,6 +472,7 @@
if pos != -1 and optval[pos-1].isspace():
optval = optval[:pos]
optval = optval.strip()
+ optval = optval.strip('"')
# allow empty values
if optval == '""':
optval = '' |
Please provide a patch against 2.6 with an unit test and documentation |
Attached patch contain the added behavior, some unit tests to validate |
Here's an updated patch, taking in account akuchling and schmir suggestions. |
The cfgparser_doublequotes_r61014.patch works for me. I disagree wrapping a double quoted string with another double quote, it's PS: Like Jeremy Thurgood said in msg66523, this is almost the same of bpo-1524825. |
Btw, i ran all tests before write "works for me" message. |
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: