configure_file: Compare difference in binary mode
Otherwise Python will try to use string decode on the configured file and fail if it contains characters that can't be mapped to the current encoding.
This commit is contained in:
parent
11f1fc913d
commit
91d8784a04
|
@ -534,7 +534,7 @@ def replace_if_different(dst, dst_tmp):
|
||||||
# unnecessary rebuilds.
|
# unnecessary rebuilds.
|
||||||
different = True
|
different = True
|
||||||
try:
|
try:
|
||||||
with open(dst, 'r') as f1, open(dst_tmp, 'r') as f2:
|
with open(dst, 'rb') as f1, open(dst_tmp, 'rb') as f2:
|
||||||
if f1.read() == f2.read():
|
if f1.read() == f2.read():
|
||||||
different = False
|
different = False
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
|
Loading…
Reference in New Issue