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). --- /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 = ''
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 , this is almost the same of issue 1524825.