IMAP.py should use encoding to read the file

This patch includes the word "encoding" to select the right argument in remotepassfile.
This commit is contained in:
Rodolfo García Peñas (kix) 2020-10-31 15:53:45 +01:00
parent cbbeebbf44
commit 5033340c2f

View File

@ -398,7 +398,7 @@ class IMAPRepository(BaseRepository):
# 3. Read password from file specified in Repository 'remotepassfile'. # 3. Read password from file specified in Repository 'remotepassfile'.
passfile = self.getconf('remotepassfile', None) passfile = self.getconf('remotepassfile', None)
if passfile is not None: if passfile is not None:
fd = open(os.path.expanduser(passfile), 'r', 'utf-8') fd = open(os.path.expanduser(passfile), 'r', encoding='utf-8')
password = fd.readline().strip() password = fd.readline().strip()
fd.close() fd.close()
return password.encode('UTF-8') return password.encode('UTF-8')