|
1 |
| -#!/usr/bin/env python |
| 1 | +#!/usr/bin/env python3 |
2 | 2 |
|
3 | 3 | """flawfinder: Find potential security flaws ("hits") in source code.
|
4 | 4 | Usage:
|
@@ -418,9 +418,12 @@ class Hit(object):
|
418 | 418 | # Show as CSV format
|
419 | 419 | def show_csv(self):
|
420 | 420 | csv_writer.writerow([
|
421 |
| - self.filename, self.line, self.column, self.level, self.category, |
422 |
| - self.name, self.warning, self.suggestion, self.note, |
423 |
| - self.cwes(), self.context_text, self.fingerprint() |
| 421 | + self.filename.encode('utf8'), self.line, |
| 422 | + self.column, self.level, |
| 423 | + self.category.encode('utf8'), self.name.encode('utf8'), |
| 424 | + self.warning.encode('utf8'), self.suggestion.encode('utf8'), |
| 425 | + self.note.encode('utf8'), self.cwes().encode('utf8'), |
| 426 | + self.context_text.encode('utf8'), self.fingerprint().encode('utf8') |
424 | 427 | ])
|
425 | 428 |
|
426 | 429 | def show(self):
|
@@ -1485,7 +1488,7 @@ def process_c_file(f, patch_infos):
|
1485 | 1488 | num_links_skipped += 1
|
1486 | 1489 | return
|
1487 | 1490 | try:
|
1488 |
| - my_input = open(f, "r") |
| 1491 | + my_input = open(f, "r", encoding="ISO-8859-1") |
1489 | 1492 | except BaseException:
|
1490 | 1493 | print("Error: failed to open", h(f))
|
1491 | 1494 | sys.exit(14)
|
|
0 commit comments