From f379dda13d7b9059835bdfb725dc92f986191adc Mon Sep 17 00:00:00 2001 From: Brandon Wees Date: Sun, 17 Jul 2022 11:59:20 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: dgtlmoon --- changedetectionio/store.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changedetectionio/store.py b/changedetectionio/store.py index 7f1216dd7..44ebc1461 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -540,9 +540,9 @@ class ChangeDetectionStore: # Check if the previous.txt exists if not os.path.exists(os.path.join(self.datastore_path, uuid, "previous.txt")): # Generate a previous.txt - with open(os.path.join(self.datastore_path, uuid, "previous.txt"), "w") as f: + with open(os.path.join(self.datastore_path, uuid, "previous.txt"), "wb") as f: # Fill it with the latest history latest_file_name = watch.history[watch.newest_history_key] - with open(latest_file_name, "r") as f2: + with open(latest_file_name, "rb") as f2: f.write(f2.read()) \ No newline at end of file