Skip to content

Commit

Permalink
Update main.py to resolve PYTHONWARNDEFAULTENCODING (#61)
Browse files Browse the repository at this point in the history
Adds encoding="utf-8" to resolve warning
  • Loading branch information
NebularNerd authored Apr 7, 2024
1 parent bd95308 commit aabd5a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion puremagic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _magic_data(
Dict[bytes, List[PureMagic]],
]:
"""Read the magic file"""
with open(filename) as f:
with open(filename, encoding="utf-8") as f:
data = json.load(f)
headers = sorted((_create_puremagic(x) for x in data["headers"]), key=lambda x: x.byte_match)
footers = sorted((_create_puremagic(x) for x in data["footers"]), key=lambda x: x.byte_match)
Expand Down

0 comments on commit aabd5a9

Please sign in to comment.