diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-27 07:36:13 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-27 07:36:13 +0530 |
commit | 5ef9a880877fdbd82f052c1340c00f5507f54542 (patch) | |
tree | 3d130e1f7f52cd5a5bb146b7a4e538970b26e75a | |
parent | 11f1fc913d32adfd15b4d65cb25f06183361781b (diff) | |
download | meson-configure-file-compare-binary.tar.gz |
configure_file: Compare difference in binary modeconfigure-file-compare-binary
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.
-rw-r--r-- | mesonbuild/mesonlib.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 686f7d93f..a35345b1b 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -534,7 +534,7 @@ def replace_if_different(dst, dst_tmp): # unnecessary rebuilds. different = True 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(): different = False except FileNotFoundError: |