Skip to content

Commit 3a28667

Browse files
ziadhanyTG1999
authored andcommitted
Try and except for UnicodeError
Signed-off-by: ziadhany <[email protected]>
1 parent fe1e94c commit 3a28667

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vulnerabilities/importers/fireeye.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ def advisory_data(self) -> Iterable[AdvisoryData]:
3232
for file in files:
3333
if Path(file).stem == "README":
3434
continue
35-
with open(file, encoding="ISO-8859-1") as f:
36-
yield parse_advisory_data(f.read())
35+
try:
36+
with open(file) as f:
37+
yield parse_advisory_data(f.read())
38+
except UnicodeError:
39+
print(file)
40+
3741

3842

3943
def parse_advisory_data(raw_data) -> AdvisoryData:

0 commit comments

Comments
 (0)