aioimaplib icon indicating copy to clipboard operation
aioimaplib copied to clipboard

Response lines starts with '* ' after FETCH containing quoted string with unmatched parens

Open filiphanes opened this issue 5 years ago • 2 comments

Counting matching parens in FetchCommand.wait_data() may not be good idea. fix is coming ...

filiphanes avatar Jul 24 '20 16:07 filiphanes

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 *.

lllama avatar Nov 25 '21 11:11 lllama

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:])))

bamthomas avatar Dec 31 '21 17:12 bamthomas