Ignore Errors when reading Files

Workaround for german umelts and similar reading utf-8 issues
pull/414/head
bakerboy448 4 years ago committed by GitHub
parent 058fef7559
commit 66fd0bd943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -202,7 +202,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, newline='', errors='ignore') 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)

Loading…
Cancel
Save