From aa49c3cebd1ba8f6f78b977e6a331a0ec5b181f5 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 15 Aug 2017 12:23:09 +0300 Subject: [PATCH] Ignore encoding when scanning Fortran sources. --- mesonbuild/backend/ninjabackend.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 0587cff92..2d2c03478 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1833,7 +1833,9 @@ rule FORTRAN_DEP_HACK continue filename = s.absolute_path(self.environment.get_source_dir(), self.environment.get_build_dir()) - with open(filename) as f: + # Some Fortran editors save in weird encodings, + # but all the parts we care about are in ASCII. + with open(filename, errors='ignore') as f: for line in f: modmatch = modre.match(line) if modmatch is not None: