[issue11027] Allow spaces around section header in ConfigParser

Raymond Hettinger report at bugs.python.org
Thu Jan 27 19:55:40 CET 2011


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

There's a case to be made that the current regex is buggy.  It already accepts whitespace around the header name but doesn't strip it.  ISTM, this is undesirable:  [ section header ]  --> ' section header ' instead of 'section header'.

>>> import configparser
>>> r = configparser.ConfigParser.SECTCRE
>>> r.match('[ section header ]').group('header')
' section header '

That result is not want people would usually want or expect.  I don't see any advantage to deferring this to 3.3.

----------
keywords: +easy -patch
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11027>
_______________________________________


More information about the Python-bugs-list mailing list