Skip to content

Commit 0096298

Browse files
Update imaplib.py to account for additional padding
Regex for imaplib should account for IMAP servers which return one or two whitespaces after the * in responses. Updated the regex check to account for this
1 parent d006800 commit 0096298

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/imaplib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
Untagged_response = re.compile(br'\* (?P<type>[A-Z-]+)( (?P<data>.*))?')
125125
# Untagged_status is no longer used; kept for backward compatibility
126126
Untagged_status = re.compile(
127-
br'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?', re.ASCII)
127+
br'\*[ ]{1,2}(?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?', re.ASCII)
128128
# We compile these in _mode_xxx.
129129
_Literal = br'.*{(?P<size>\d+)}$'
130130
_Untagged_status = br'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?'

0 commit comments

Comments
 (0)