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'.
passfile = self.getconf('remotepassfile', 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()
fd.close()
return password.encode('UTF-8')