aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2022-07-06 23:12:43 +0300
committerNirbheek Chauhan <nirbheek@centricular.com>2022-08-08 19:10:00 +0530
commite06506e68ed479ada7b1a30263bece8d7caae7f7 (patch)
tree39cf002a88e25795b60c813d81f72874ab30cc37
parentff6e6e10974262afe42af5fae5ea266c7dfeb1e7 (diff)
downloadmeson-e06506e68ed479ada7b1a30263bece8d7caae7f7.zip
meson-e06506e68ed479ada7b1a30263bece8d7caae7f7.tar.gz
meson-e06506e68ed479ada7b1a30263bece8d7caae7f7.tar.bz2
Ignore encoding errors when scanning. Closes #10571.
In Fortran and C++ all the bits we care about are in ASCII. 8-bit characters can only occur in comments and string literals and we don't parse those.
-rw-r--r--mesonbuild/scripts/depscan.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/scripts/depscan.py b/mesonbuild/scripts/depscan.py
index 6f92715..5fa30cb 100644
--- a/mesonbuild/scripts/depscan.py
+++ b/mesonbuild/scripts/depscan.py
@@ -62,7 +62,7 @@ class DependencyScanner:
def scan_fortran_file(self, fname: str) -> None:
fpath = pathlib.Path(fname)
modules_in_this_file = set()
- for line in fpath.read_text(encoding='utf-8').split('\n'):
+ for line in fpath.read_text(encoding='utf-8', errors='ignore').split('\n'):
import_match = FORTRAN_USE_RE.match(line)
export_match = FORTRAN_MODULE_RE.match(line)
submodule_export_match = FORTRAN_SUBMOD_RE.match(line)
@@ -112,7 +112,7 @@ class DependencyScanner:
def scan_cpp_file(self, fname: str) -> None:
fpath = pathlib.Path(fname)
- for line in fpath.read_text(encoding='utf-8').split('\n'):
+ for line in fpath.read_text(encoding='utf-8', errors='ignore').split('\n'):
import_match = CPP_IMPORT_RE.match(line)
export_match = CPP_EXPORT_RE.match(line)
if import_match: