Skip to content

Commit

Permalink
Merge pull request #48 from gisaia/fix/json_encoding
Browse files Browse the repository at this point in the history
Force utf-8 for json encoding
  • Loading branch information
WilliGautier authored Dec 5, 2024
2 parents b92bc17 + 2337778 commit a1b156f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arlas/cli/model_infering.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def make_mapping(file: str, nb_lines: int = 2, types: dict[str, str] = {}, no_fu
no_index: list[str] = []):
tree = {}
mapping = {}
with open(file) as f:
with open(file, mode="r", encoding="utf-8") as f:
i = 0
for line in f:
if i > nb_lines:
Expand Down
4 changes: 2 additions & 2 deletions arlas/cli/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def count_collection(arlas: str, collection: str) -> list[list[str]]:

def count_hits(file_path: str) -> int:
line_number = 0
with open(file_path) as f:
with open(file_path, mode="r", encoding="utf-8") as f:
for line in f:
line_number = line_number + 1
return line_number
Expand Down Expand Up @@ -388,7 +388,7 @@ def index_hits(arlas: str, index: str, file_path: str, bulk_size: int = 5000, co
line_number = 0
line_in_bulk = 0
bulk = []
with open(file_path) as f:
with open(file_path, mode="r", encoding="utf-8") as f:
with alive_bar(count) as bar:
for line in f:
line_number = line_number + 1
Expand Down

0 comments on commit a1b156f

Please sign in to comment.