You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ConfigParser does not handle square brackets in section name #67490
bpo-20923: [doc] Explain ConfigParser 'valid section name' and .SECTCRE
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2015-01-22.16:06:52.188>created_at=<Date2015-01-22.15:58:05.320>labels= ['type-bug', 'library']
title='ConfigParser does not handle square brackets in section name'updated_at=<Date2015-01-22.16:06:52.186>user='https://github.com/xflr6'
ConfigParser parses section lines containing square brackets like '[spam [eggs] spam]' up to the first instead of the last occurrence of ']' preventing roundtrips:
This is a duplicate of bpo-20923 (#65122), which was rejected. To argue against the rejection you probably need to provide evidence that this is something that is actually supported by other common ini parsers. And that evidence should be posted to bpo-20923.
Activity
xflr6 commentedon Jan 22, 2015
ConfigParser parses section lines containing square brackets like '[spam [eggs] spam]' up to the first instead of the last occurrence of ']' preventing roundtrips:
Potential fix: change the second line of SECTCRE from r'(?P<header>[^]]+)' to r'(?P<header>.+?)'.
If the parsing behaviour cannot be changed, the user should at least be warned about supplying data that breaks the roundtrip.
bitdancer commentedon Jan 22, 2015
This is a duplicate of bpo-20923 (#65122), which was rejected. To argue against the rejection you probably need to provide evidence that this is something that is actually supported by other common ini parsers. And that evidence should be posted to bpo-20923.