diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 2c3925958d011b..9dc1228ae59ffe 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -127,7 +127,7 @@ Untagged_response = re.compile(br'\* (?P[A-Z-]+)( (?P.*))?') # Untagged_status is no longer used; kept for backward compatibility Untagged_status = re.compile( - br'\* (?P\d+) (?P[A-Z-]+)( (?P.*))?', re.ASCII) + br'\*[ ]{1,2}(?P\d+) (?P[A-Z-]+)( (?P.*))?', re.ASCII) # We compile these in _mode_xxx. _Literal = br'.*{(?P\d+)}$' _Untagged_status = br'\* (?P\d+) (?P[A-Z-]+)( (?P.*))?' diff --git a/Misc/NEWS.d/next/Library/2019-06-26-06-12-08.bpo-37407.Qc1pW1.rst b/Misc/NEWS.d/next/Library/2019-06-26-06-12-08.bpo-37407.Qc1pW1.rst new file mode 100644 index 00000000000000..3a8af6aa37b9ad --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-06-26-06-12-08.bpo-37407.Qc1pW1.rst @@ -0,0 +1,2 @@ +Allow one or two whitespaces after * in IMAP response. +Patch by Edward Smith.