From c8cfb02e86a6e066da11ce77a351cbdf3f50f693 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Wed, 15 Jan 2025 15:47:52 +0000 Subject: [PATCH] Fix invalid escape sequences using r-strings --- aioimaplib/imap_testing_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aioimaplib/imap_testing_server.py b/aioimaplib/imap_testing_server.py index 6fe8c3c..22550d9 100644 --- a/aioimaplib/imap_testing_server.py +++ b/aioimaplib/imap_testing_server.py @@ -340,8 +340,8 @@ def examine(self, tag, *args): mailbox_name = args[0] self.server_state.create_mailbox_if_not_exists(self.user_login, mailbox_name) mailbox = self.server_state.get_mailbox_messages(self.user_login, mailbox_name) - self.send_untagged_line('FLAGS (\Answered \Flagged \Deleted \Seen \Draft)') - self.send_untagged_line('OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.') + self.send_untagged_line(r'FLAGS (\Answered \Flagged \Deleted \Seen \Draft)') + self.send_untagged_line(r'OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.') self.send_untagged_line('{nb_messages} EXISTS'.format(nb_messages=len(mailbox))) self.send_untagged_line('{nb_messages} RECENT'.format(nb_messages=0)) self.send_untagged_line('OK [UIDVALIDITY {uidvalidity}] UIDs valid'.format(uidvalidity=self.uidvalidity)) @@ -433,7 +433,7 @@ def fetch(self, tag, *args): if (by_uid and message.uid in fetch_range) or (not by_uid and message.id in fetch_range): response = self._build_fetch_response(message, parts, by_uid=by_uid) if 'BODY.PEEK' not in parts_str and ('BODY[]' in parts_str or 'RFC822' in parts_str): - message.flags.append('\Seen') + message.flags.append(r'\Seen') self.send_raw_untagged_line(response) self.send_tagged_line(tag, 'OK FETCH completed.')