New submission from Miroslav Suchy:

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 = ''

----------
components: Extension Modules
messages: 59060
nosy: msuchy
severity: normal
status: open
title: ConfigParser.py do not allow leading (and trailing) space in values.
type: behavior
versions: Python 2.4

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1714>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to