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.

Author Kunjesh.Kaushik
Recipients Kunjesh.Kaushik, lukasz.langa, r.david.murray, rhettinger
Date 2011-01-27.19:33:07
SpamBayes Score 2.7216129e-06
Marked as misclassified No
Message-id <1296156788.38.0.833026038793.issue11027@psf.upfronthosting.co.za>
In-reply-to
Content
Mr. Raymond has raised a valid point. On second thought, I think the submitted patch won't resolve the issue.

>>> import re
>>> r = re.compile(r'\[\s*(?P<header>[^]]+)\s*\]') # as in the patch
>>> r.match('[ section header ]').group('header')  # still has issues
'section header '

ISTM, the only solution to this problem is to strip the section headers while parsing the file. Subsequent access mechanism should also follow suit. IMHO, section headers should be made case-insensitive as well -- similar to option keys.
History
Date User Action Args
2011-01-27 19:33:08Kunjesh.Kaushiksetrecipients: + Kunjesh.Kaushik, rhettinger, r.david.murray, lukasz.langa
2011-01-27 19:33:08Kunjesh.Kaushiksetmessageid: <1296156788.38.0.833026038793.issue11027@psf.upfronthosting.co.za>
2011-01-27 19:33:07Kunjesh.Kaushiklinkissue11027 messages
2011-01-27 19:33:07Kunjesh.Kaushikcreate