From be4531ffbc35123e31f84b8c70e1a53e4a7577c1 Mon Sep 17 00:00:00 2001 From: Vadim Lebedev Date: Tue, 9 Aug 2022 23:26:54 +0200 Subject: [PATCH] More python3 fixes --- tests.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests.py b/tests.py index 5abcba5..5135362 100644 --- a/tests.py +++ b/tests.py @@ -269,10 +269,11 @@ ITEM_NAME='test.txt' class TestPasswordProtection(unittest.TestCase): def setUp(self): - with open(ZIPPATH, mode='w') as f: - if PY3: - f.write(base64.b64decode(ZIP_CONTENT).decode('latin1')) - else: + if PY3: + with open(ZIPPATH, mode='wb') as f: + f.write(base64.b64decode(ZIP_CONTENT)) + else: + with open(ZIPPATH, mode='w') as f: f.write(base64.b64decode(ZIP_CONTENT))