diff --git a/Lib/configparser.py b/Lib/configparser.py index 924cc56a3f150d..209e8abd07d386 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -563,7 +563,7 @@ class RawConfigParser(MutableMapping): # Regular expressions for parsing section headers and options _SECT_TMPL = r""" \[ # [ - (?P
[^]]+) # very permissive! + (?P
.*) # very permissive! \] # ] """ _OPT_TMPL = r""" diff --git a/Misc/NEWS.d/next/Library/2019-11-08-06-08-42.bpo-38741.pShzDL.rst b/Misc/NEWS.d/next/Library/2019-11-08-06-08-42.bpo-38741.pShzDL.rst new file mode 100644 index 00000000000000..f5f55891f42c35 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-11-08-06-08-42.bpo-38741.pShzDL.rst @@ -0,0 +1,3 @@ +in example header is "[i love [python] lang]" +parse as "i love [python", only up to the first character ']'. +now saving works correctly, but reading does not \ No newline at end of file