This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2007年12月31日 15:30 by msuchy, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| cfgparser_doublequotes_r61014.patch | quentin.gallet-gilles, 2008年02月23日 22:40 | |||
| Messages (6) | |||
|---|---|---|---|
| msg59060 - (view) | Author: Miroslav Suchy (msuchy) | Date: 2007年12月31日 15:30 | |
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 = ''
|
|||
| msg59777 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2008年01月12日 02:44 | |
Please provide a patch against 2.6 with an unit test and documentation updates. |
|||
| msg60186 - (view) | Author: Quentin Gallet-Gilles (quentin.gallet-gilles) | Date: 2008年01月19日 16:09 | |
Attached patch contain the added behavior, some unit tests to validate it and updated documentation. |
|||
| msg62826 - (view) | Author: Quentin Gallet-Gilles (quentin.gallet-gilles) | Date: 2008年02月23日 22:40 | |
Here's an updated patch, taking in account akuchling and schmir suggestions. |
|||
| msg66582 - (view) | Author: Jonatas Oliveira (jonatasoliveira) | Date: 2008年05月10日 20:17 | |
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 issue 1524825. |
|||
| msg66591 - (view) | Author: Jonatas Oliveira (jonatasoliveira) | Date: 2008年05月10日 22:22 | |
Btw, i ran all tests before write "works for me" message. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:29 | admin | set | github: 46055 |
| 2010年07月10日 05:41:57 | terry.reedy | set | status: open -> closed resolution: duplicate superseder: ConfigParser: accept leading whitespace on options+comments versions: + Python 3.2, - Python 2.6 |
| 2008年05月10日 22:22:13 | jonatasoliveira | set | messages: + msg66591 |
| 2008年05月10日 20:17:40 | jonatasoliveira | set | nosy:
+ jonatasoliveira messages: + msg66582 |
| 2008年03月25日 16:14:00 | schmir | set | nosy: + schmir |
| 2008年03月25日 14:54:08 | quentin.gallet-gilles | set | files: - cfgparser_doublequotes.patch |
| 2008年03月06日 19:10:55 | draghuram | set | nosy: + draghuram |
| 2008年02月23日 22:40:21 | quentin.gallet-gilles | set | files:
+ cfgparser_doublequotes_r61014.patch keywords: + patch messages: + msg62826 |
| 2008年02月23日 20:42:22 | akuchling | set | assignee: akuchling nosy: + akuchling |
| 2008年01月19日 16:09:00 | quentin.gallet-gilles | set | files:
+ cfgparser_doublequotes.patch nosy: + quentin.gallet-gilles messages: + msg60186 |
| 2008年01月12日 02:44:38 | christian.heimes | set | components: + Library (Lib), - Extension Modules |
| 2008年01月12日 02:44:25 | christian.heimes | set | priority: low keywords: + easy messages: + msg59777 nosy: + christian.heimes versions: + Python 2.6, - Python 2.4 |
| 2007年12月31日 15:30:01 | msuchy | create | |