From ea8c0c6f3eba54766c0f54b02bbbd05132007914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sun, 30 Aug 2020 19:12:14 +0200 Subject: [PATCH] __generate_randomheader uses now string This patch converts the string to bytes to use crc32. We can remore the fffffff because in python3 is always positive value. In other patch. --- offlineimap/folder/IMAP.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 2f409b2..b8c9829 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -373,7 +373,7 @@ class IMAPFolder(BaseFolder): # Compute unsigned crc32 of 'content' as unique hash. # NB: crc32 returns unsigned only starting with python 3.0. - headervalue = str(binascii.crc32(content) & 0xffffffff) + '-' + headervalue = str(binascii.crc32(str.encode(content)) & 0xffffffff) + '-' headervalue += str(self.randomgenerator.randint(0, 9999999999)) return headername, headervalue