Skip to content

Commit

Permalink
Fix encoding issue by opening file in binary mode (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
myd7349 authored Oct 21, 2022
1 parent 5a384a9 commit 0849d17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cppimport/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ def _find_file_in_folders(filename, paths, opt_in):


def _check_first_line_contains_cppimport(filepath):
with open(filepath, "r") as f:
return "cppimport" in f.readline()
with open(filepath, "rb") as f:
return b"cppimport" in f.readline()

0 comments on commit 0849d17

Please sign in to comment.