Skip to content

Commit

Permalink
Fix invalid escape sequences using r-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardBetts authored and bamthomas committed Jan 16, 2025
1 parent b5461cc commit c8cfb02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aioimaplib/imap_testing_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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.')

Expand Down

0 comments on commit c8cfb02

Please sign in to comment.