Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force utf-8 for json encoding #48

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading