Changed from open() to io.open()
diff --git a/pre_commit_hooks/check_yaml.py b/pre_commit_hooks/check_yaml.py index c8665aa..9bbd36c 100644 --- a/pre_commit_hooks/check_yaml.py +++ b/pre_commit_hooks/check_yaml.py
@@ -3,6 +3,7 @@ import argparse import collections import sys +import io from typing import Any from typing import Generator from typing import Optional @@ -58,7 +59,7 @@ retval = 0 for filename in args.filenames: try: - with open(filename) as f: + with io.open(filename, encoding='UTF-8') as f: load_fn(f) except ruamel.yaml.YAMLError as exc: print(exc)