diff options
-rw-r--r-- | mesonbuild/mesonlib.py | 6 |
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_]+)@') |