From 436022883afab9040964221a8998a52514e12070 Mon Sep 17 00:00:00 2001 From: Emmanuel Cazenave Date: Tue, 4 Feb 2020 17:26:51 +0100 Subject: [PATCH] open file in binary mode (#39533) --- atreal_openads/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atreal_openads/utils.py b/atreal_openads/utils.py index f8c3059..ccd6828 100644 --- a/atreal_openads/utils.py +++ b/atreal_openads/utils.py @@ -94,7 +94,7 @@ def normalize(value): def get_file_data(path, b64=True): """Return the content of a file as a string, in base64 if specified.""" - with open(path, 'r') as file_pt: + with open(path, 'rb') as file_pt: if b64: return base64.b64encode(file_pt.read()) return file_pt.read()