From 5033340c2fd1145248d8526fcbaab8d625276d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sat, 31 Oct 2020 15:53:45 +0100 Subject: [PATCH] IMAP.py should use encoding to read the file This patch includes the word "encoding" to select the right argument in remotepassfile. --- offlineimap/repository/IMAP.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 36348ab..61a0076 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -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')