1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Merge branch 'master' into 'master'

Scanner: handle utf8 errors more gracefully

Don't throw an error without any info which file caused it.

Fixes #226

See merge request !180
This commit is contained in:
Hans-Christoph Steiner 2016-11-02 17:18:02 +00:00
commit 7d0bd345d1

View File

@ -199,7 +199,7 @@ def scan_source(build_dir, root_dir, build):
elif ext == 'java':
if not os.path.isfile(fp):
continue
with open(fp, 'r', encoding='utf8') as f:
with open(fp, 'r', encoding='utf8', errors='replace') as f:
for line in f:
if 'DexClassLoader' in line:
count += handleproblem('DexClassLoader', fd, fp)
@ -208,7 +208,7 @@ def scan_source(build_dir, root_dir, build):
elif ext == 'gradle':
if not os.path.isfile(fp):
continue
with open(fp, 'r', encoding='utf8') as f:
with open(fp, 'r', encoding='utf8', errors='replace') as f:
lines = f.readlines()
for i, line in enumerate(lines):
if is_used_by_gradle(line):