mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 14:30:11 +01:00
Don't crash if a magic number can't be used
This should fix the anki build crashing.
This commit is contained in:
parent
0283fa0aa6
commit
5167e3d771
@ -1460,7 +1460,10 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||
if toignore(fd):
|
||||
continue
|
||||
|
||||
mime = magic.from_file(fp, mime=True) if ms is None else ms.file(fp)
|
||||
try:
|
||||
mime = magic.from_file(fp, mime=True) if ms is None else ms.file(fp)
|
||||
except UnicodeError:
|
||||
warnproblem('malformed magic number', fd, fp)
|
||||
|
||||
if mime == 'application/x-sharedlib':
|
||||
count += handleproblem('shared library', fd, fp)
|
||||
|
Loading…
Reference in New Issue
Block a user