Read files in binary mode

This commit is contained in:
Spencer Phillip Young
2020-03-24 18:53:33 -07:00
committed by Spencer Young
parent 542ae758f5
commit 28ea079812

View File

@@ -177,7 +177,7 @@ def run(argv=None):
for file in find_files_recursively(args.files, conf): for file in find_files_recursively(args.files, conf):
filepath = file[2:] if file.startswith('./') else file filepath = file[2:] if file.startswith('./') else file
try: try:
with io.open(file, newline='') as f: with io.open(file, mode='rb') as f:
problems = linter.run(f, conf, filepath) problems = linter.run(f, conf, filepath)
except EnvironmentError as e: except EnvironmentError as e:
print(e, file=sys.stderr) print(e, file=sys.stderr)