aioimaplib
aioimaplib copied to clipboard
Response lines starts with '* ' after FETCH containing quoted string with unmatched parens
Counting matching parens in FetchCommand.wait_data() may not be good idea. fix is coming ...
Just a plus one on this issue. A simple reproduction is if the email has an opening ( in its subject. All subsequent lines will start with *.
weird, for now I can reproduce with a real test, activating debug. But I can't with a unit test : data is in bytearrays and is not concerned by the parenthesis matching :
def wait_data(self) -> bool:
last_fetch_index = 0
for index, line in enumerate(self._resp_lines):
if isinstance(line, bytes) and self.FETCH_MESSAGE_DATA_RE.match(line):
last_fetch_index = index
return not matched_parenthesis(b''.join(filter(lambda l: isinstance(l, bytes),
self.response.lines[last_fetch_index:])))