Skip to content

Commit

Permalink
grass.benchmark: Use UTF-8 for text files (#2201)
Browse files Browse the repository at this point in the history
Use UTF-8 as encoding for text files (JSON files here) in grass.benchmark result reading and writing. This explicitly specifies an encoding and thus it avoids unspecified-encoding warning from Pylint.
  • Loading branch information
wenzeslaus committed Feb 13, 2022
1 parent ffc874d commit 36cf097
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/grass/benchmark/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def save_results_to_file(results, filename):
See :func:`save_results` for details.
"""
text = save_results(results)
with open(filename, "w") as file:
with open(filename, "w", encoding="utf-8") as file:
file.write(text)


Expand All @@ -67,7 +67,7 @@ def load_results_from_file(filename):
See :func:`load_results` for details.
"""
with open(filename, "r") as file:
with open(filename, "r", encoding="utf-8") as file:
return load_results(file.read())


Expand Down

0 comments on commit 36cf097

Please sign in to comment.