You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ConfigParser.py do not allow leading (and trailing) space in values. #46055
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:
assignee='https://github.com/akuchling'closed_at=<Date2010-07-10.05:41:57.548>created_at=<Date2007-12-31.15:30:01.301>labels= ['easy', 'type-bug', 'library']
title='ConfigParser.py do not allow leading (and trailing) space in values.'updated_at=<Date2010-07-10.05:41:57.546>user='https://bugs.python.org/msuchy'
I have some configuration params with leading space. And program
(getmail4) which use ConfigParser.py. ConfigParser strip all leading
(and trailing) spaces from values. This is very often the most wanted
result. But if I want value with leading space I have no option to put
it there.
Therefore I suggest to optionaly write string value as
key = "value"
This patch will solve it (it is against my OS, sorry no chance to
checkout svn).
Here's an updated patch, taking in account akuchling and schmir suggestions.
jonatasoliveira commented on May 10, 2008
jonatasoliveiramannequin
Mannequin
More actions
The cfgparser_doublequotes_r61014.patch works for me.
I disagree wrapping a double quoted string with another double quote, it's
more elegant using single quote like python's string behavior, but I don't
know if is acceptable for a .ini file.
PS: Like Jeremy Thurgood said in msg66523, this is almost the same of bpo-1524825.
jonatasoliveira commented on May 10, 2008
jonatasoliveiramannequin
Mannequin
More actions
Btw, i ran all tests before write "works for me" message.
Activity
msuchy commentedon Dec 31, 2007
I have some configuration params with leading space. And program
(getmail4) which use ConfigParser.py. ConfigParser strip all leading
(and trailing) spaces from values. This is very often the most wanted
result. But if I want value with leading space I have no option to put
it there.
Therefore I suggest to optionaly write string value as
key = "value"
This patch will solve it (it is against my OS, sorry no chance to
checkout svn).
tiran commentedon Jan 12, 2008
Please provide a patch against 2.6 with an unit test and documentation
updates.
quentingallet-gilles commentedon Jan 19, 2008
Attached patch contain the added behavior, some unit tests to validate
it and updated documentation.
quentingallet-gilles commentedon Feb 23, 2008
Here's an updated patch, taking in account akuchling and schmir suggestions.
jonatasoliveira commentedon May 10, 2008
The cfgparser_doublequotes_r61014.patch works for me.
I disagree wrapping a double quoted string with another double quote, it's
more elegant using single quote like python's string behavior, but I don't
know if is acceptable for a .ini file.
PS: Like Jeremy Thurgood said in msg66523, this is almost the same of bpo-1524825.
jonatasoliveira commentedon May 10, 2008
Btw, i ran all tests before write "works for me" message.