mirror of
https://github.com/powerline/powerline.git
synced 2025-07-31 01:35:40 +02:00
Fix Unicode issues with mail segment
This commit is contained in:
parent
4cda38e214
commit
ea32006715
@ -242,7 +242,7 @@ def email_imap_alert(username, password, server='imap.gmail.com', port=993, fold
|
|||||||
try:
|
try:
|
||||||
mail = imaplib.IMAP4_SSL(server, port)
|
mail = imaplib.IMAP4_SSL(server, port)
|
||||||
mail.login(username, password)
|
mail.login(username, password)
|
||||||
rc, message = mail.status(folder, '(UNSEEN)')
|
rc, message = mail.status(folder, '(UNSEEN)').decode('utf-8')
|
||||||
unread_count = int(re.search('UNSEEN (\d+)', message[0]).group(1))
|
unread_count = int(re.search('UNSEEN (\d+)', message[0]).group(1))
|
||||||
except (imaplib.IMAP4.error, AttributeError):
|
except (imaplib.IMAP4.error, AttributeError):
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user