Skip to content

Commit

Permalink
Use raw strings for backlashes
Browse files Browse the repository at this point in the history
  • Loading branch information
bryango committed May 24, 2024
1 parent 18490a0 commit 60890b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Mailnag/backends/imap.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def mark_as_seen(self, mails):
if folder != last_folder:
conn.select(f'"{folder}"', readonly = False)
last_folder = folder
status, data = conn.uid("STORE", m.flags['uid'], "+FLAGS", "(\Seen)")
status, data = conn.uid("STORE", m.flags['uid'], "+FLAGS", r"(\Seen)")
except:
logging.warning("Failed to set mail with uid %s to seen on server (account: '%s').", m.flags['uid'], acc.name)

Expand Down
8 changes: 4 additions & 4 deletions Mailnag/common/imaplib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,7 @@ def ParseFlags(resp):
('select', ('imaplib2_test2',)),
('search', (None, 'SUBJECT', '"IMAP4 test"')),
('fetch', ('1:*', '(FLAGS INTERNALDATE RFC822)')),
('store', ('1', 'FLAGS', '(\Deleted)')),
('store', ('1', 'FLAGS', r'(\Deleted)')),
('namespace', ()),
('expunge', ()),
('recent', ()),
Expand Down Expand Up @@ -2571,7 +2571,7 @@ def run(cmd, args, cb=True):
if not uid: continue
run('uid', ('FETCH', uid[-1],
'(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)'))
run('uid', ('STORE', uid[-1], 'FLAGS', '(\Deleted)'))
run('uid', ('STORE', uid[-1], 'FLAGS', r'(\Deleted)'))
run('expunge', ())

if 'IDLE' in M.capabilities:
Expand All @@ -2585,10 +2585,10 @@ def run(cmd, args, cb=True):
dat = run('fetch', (num, '(FLAGS INTERNALDATE RFC822)'), cb=False)
M._mesg('fetch %s => %s' % (num, repr(dat)))
run('idle', (2,))
run('store', (num, '-FLAGS', '(\Seen)'), cb=False),
run('store', (num, '-FLAGS', r'(\Seen)'), cb=False),
dat = run('fetch', (num, '(FLAGS INTERNALDATE RFC822)'), cb=False)
M._mesg('fetch %s => %s' % (num, repr(dat)))
run('uid', ('STORE', num, 'FLAGS', '(\Deleted)'))
run('uid', ('STORE', num, 'FLAGS', r'(\Deleted)'))
run('expunge', ())
if idle_intr:
M._mesg('HIT CTRL-C to interrupt IDLE')
Expand Down

0 comments on commit 60890b8

Please sign in to comment.