Skip to content

Commit

Permalink
Use binary mode when opening file on Python 3.9+
Browse files Browse the repository at this point in the history
  • Loading branch information
cvzi committed Jan 15, 2025
1 parent d25d8d4 commit 75c263b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emoji/unicode_codes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __missing__(self, key: str) -> str:

def _open_file(name: str) -> BinaryIO:
if sys.version_info >= (3, 9):
return importlib.resources.files('emoji.unicode_codes').joinpath(name).open()
return importlib.resources.files('emoji.unicode_codes').joinpath(name).open('rb')
else:
return importlib.resources.open_binary('emoji.unicode_codes', name)

Expand Down

0 comments on commit 75c263b

Please sign in to comment.