Skip to content

Commit

Permalink
don't make opening mode dependent on filename type
Browse files Browse the repository at this point in the history
  • Loading branch information
simleo committed Dec 12, 2024
1 parent 9c610f9 commit babc476
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions rocrate/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ def read_metadata(metadata_path):
"""
if isinstance(metadata_path, dict):
metadata = metadata_path
elif isinstance(metadata_path, str):
with open(metadata_path, 'r', encoding='utf-8') as f:
metadata = json.load(f)
else:
with open(metadata_path, 'rb') as f:
with open(metadata_path, 'r', encoding='utf-8') as f:
metadata = json.load(f)
try:
context = metadata['@context']
Expand Down

0 comments on commit babc476

Please sign in to comment.