Message127193
It is often desirable to be able to write a section with spaces around the header, as in "[ default ]" instead of "[default]" for the sake of readability of configuration file. I am not sure if this is the "standard" format of configuration files.
The following (attached) patch will achieve the desired result. It is also backward-compatible. Kindly arrange for the patch to be applied to the repository or to a future release.
Original Code Location: http://svn.python.org/view/*checkout*/python/branches/release27-maint/Lib/ConfigParser.py?revision=84443
Index: Lib/ConfigParser.py
===================================================================
--- Lib/ConfigParser.py (revision 84443)
+++ Lib/ConfigParser.py (working copy)
@@ -432,7 +432,7 @@
#
SECTCRE = re.compile(
r'\[' # [
- r'(?P<header>[^]]+)' # very permissive!
+ r'\s*(?P<header>[^]]+)\s*' # very permissive!
r'\]' # ]
)
OPTCRE = re.compile( |
|
Date |
User |
Action |
Args |
2011-01-27 14:37:05 | Kunjesh.Kaushik | set | recipients:
+ Kunjesh.Kaushik |
2011-01-27 14:37:05 | Kunjesh.Kaushik | set | messageid: <1296139025.05.0.619488294513.issue11027@psf.upfronthosting.co.za> |
2011-01-27 14:37:04 | Kunjesh.Kaushik | link | issue11027 messages |
2011-01-27 14:37:04 | Kunjesh.Kaushik | create | |
|