Skip to content

Commit

Permalink
add utf-8 encoding to open
Browse files Browse the repository at this point in the history
Signed-off-by: Lou DeGenaro <[email protected]>
  • Loading branch information
degenaro committed Dec 4, 2024
1 parent 1922968 commit e2e6a6e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions trestle/tasks/csv_to_oscal_cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,14 +1576,10 @@ class _CsvMgr():
def __init__(self, csv_path: pathlib.Path) -> None:
"""Initialize."""
self._csv = []
with open(csv_path, 'r', newline='') as f:
with open(csv_path, 'r', newline='', encoding='utf8') as f:
csv_reader = csv.reader(f, delimiter=',', quoting=csv.QUOTE_MINIMAL)
row = None
try:
for row in csv_reader:
self._csv.append(row)
except Exception:
raise RuntimeError(f'row: {row}')
for row in csv_reader:
self._csv.append(row)
self._undecorate_header()
self._verify()
self._csv_rules_map = {}
Expand Down

0 comments on commit e2e6a6e

Please sign in to comment.