|
|
@ -819,8 +819,8 @@ def changedetection_app(config=None, datastore_o=None):
|
|
|
|
# Read as binary and force decode as UTF-8
|
|
|
|
# Read as binary and force decode as UTF-8
|
|
|
|
# Windows may fail decode in python if we just use 'r' mode (chardet decode exception)
|
|
|
|
# Windows may fail decode in python if we just use 'r' mode (chardet decode exception)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
with open(newest_file, 'rb') as f:
|
|
|
|
with open(newest_file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
|
|
newest_version_file_contents = f.read().decode('utf-8')
|
|
|
|
newest_version_file_contents = f.read()
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
newest_version_file_contents = "Unable to read {}.\n".format(newest_file)
|
|
|
|
newest_version_file_contents = "Unable to read {}.\n".format(newest_file)
|
|
|
|
|
|
|
|
|
|
|
@ -832,8 +832,8 @@ def changedetection_app(config=None, datastore_o=None):
|
|
|
|
previous_file = history[dates[-2]]
|
|
|
|
previous_file = history[dates[-2]]
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
with open(previous_file, 'rb') as f:
|
|
|
|
with open(previous_file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
|
|
previous_version_file_contents = f.read().decode('utf-8')
|
|
|
|
previous_version_file_contents = f.read()
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
previous_version_file_contents = "Unable to read {}.\n".format(previous_file)
|
|
|
|
previous_version_file_contents = "Unable to read {}.\n".format(previous_file)
|
|
|
|
|
|
|
|
|
|
|
@ -909,7 +909,7 @@ def changedetection_app(config=None, datastore_o=None):
|
|
|
|
timestamp = list(watch.history.keys())[-1]
|
|
|
|
timestamp = list(watch.history.keys())[-1]
|
|
|
|
filename = watch.history[timestamp]
|
|
|
|
filename = watch.history[timestamp]
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
with open(filename, 'r') as f:
|
|
|
|
with open(filename, 'r', encoding='utf-8', errors='ignore') as f:
|
|
|
|
tmp = f.readlines()
|
|
|
|
tmp = f.readlines()
|
|
|
|
|
|
|
|
|
|
|
|
# Get what needs to be highlighted
|
|
|
|
# Get what needs to be highlighted
|
|
|
|