aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-10-23 00:10:50 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-10-23 04:38:54 -0700
commit5f20b38d444542f3538c0732cfa54afacea9ec89 (patch)
tree20088fbc38a482e24741fe63b627e211f7602196
parentf7a60099f6c00d86eefdef13e154a4f57d4fcdaf (diff)
downloadmeson-5f20b38d444542f3538c0732cfa54afacea9ec89.zip
meson-5f20b38d444542f3538c0732cfa54afacea9ec89.tar.gz
meson-5f20b38d444542f3538c0732cfa54afacea9ec89.tar.bz2
Force configure input files to be utf-8. Closes #927.
-rw-r--r--mesonbuild/mesonlib.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 067c620..8133c48 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -273,10 +273,10 @@ def do_mesondefine(line, confdata):
def do_conf_file(src, dst, confdata):
try:
- with open(src) as f:
+ with open(src, encoding='utf-8') as f:
data = f.readlines()
- except Exception:
- raise MesonException('Could not read input file %s.' % src)
+ except Exception as e:
+ raise MesonException('Could not read input file %s: %s' % (src, str(e)))
# Only allow (a-z, A-Z, 0-9, _, -) as valid characters for a define
# Also allow escaping '@' with '\@'
regex = re.compile(r'[^\\]?@([-a-zA-Z0-9_]+)@')