Skip to content

Commit

Permalink
fix char encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdavis2 committed Apr 19, 2022
1 parent 3a3331e commit 9fd6261
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clean_ttl_hook/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def clean_ttl(input_file_path: Path):
# get a list of all leading comments in the file
comments_list = []
comment_flag = False
with open(input_file_path, "r", encoding="utf-8") as f:
with open(input_file_path, "r", encoding="utf-8", errors='ignore') as f:
for index, line in enumerate(f):
if len(line.strip()) > 0 and line.strip()[0] == "#" and index == 0:
comments_list.append(line)
Expand Down Expand Up @@ -47,7 +47,7 @@ def clean_ttl(input_file_path: Path):
f.add((s, p, o))
f.serialize(destination=input_file_path, format="turtle")

with open(input_file_path, "r", encoding="utf-8") as f:
with open(input_file_path, "r", encoding="utf-8", errors='ignore') as f:
lines = f.readlines()

comments_list.extend(lines)
Expand Down

0 comments on commit 9fd6261

Please sign in to comment.