Skip to content

Commit

Permalink
file open encoding=utf-8, rename prefix.cc file
Browse files Browse the repository at this point in the history
  • Loading branch information
muddymudskipper committed Sep 23, 2024
1 parent 7d6d272 commit 7dc4fd4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmem_plugin_shapes/plugin_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def get_prefixes(self) -> dict:
f"failed to fetch prefixes from http://prefix.cc ({err}) - using local file"
)
if err or not self.prefix_cc:
with (Path(__path__[0]) / "prefix.cc.json").open("r") as json_file:
with (Path(__path__[0]) / "prefix_cc.json").open("r", encoding="utf-8") as json_file:
prefixes = {v: k for k, v in load(json_file).items()}
prefixes_project = {v: k for k, v in get_prefixes(self.context.task.project_id()).items()}
prefixes.update(prefixes_project)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion update_prefixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
with urlopen("http://prefix.cc/popular/all.file.json") as remote_file:
json_data = loads(remote_file.read())

with (Path("cmem_plugin_shapes") / "prefix.cc.json").open("w") as local_file:
with (Path("cmem_plugin_shapes") / "prefix_cc.json").open("w") as local_file:
dump(json_data, local_file, sort_keys=True, indent=2)

0 comments on commit 7dc4fd4

Please sign in to comment.