From e7924b53e4e8807c6d639179ecfed028ae8d70cd Mon Sep 17 00:00:00 2001 From: roottool Date: Mon, 22 Apr 2019 03:48:18 +0900 Subject: [PATCH 1/4] Changed from open() to io.open() --- pre_commit_hooks/check_yaml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pre_commit_hooks/check_yaml.py b/pre_commit_hooks/check_yaml.py index c8665aa4..9bbd36c5 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 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int 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) From 5b01ea52f2eb2853d557a9b589ffa40bde552393 Mon Sep 17 00:00:00 2001 From: roottool Date: Mon, 22 Apr 2019 04:11:18 +0900 Subject: [PATCH 2/4] empty commit From 47c89785e8a2a735c2ff23af8098e0a72f2dd69b Mon Sep 17 00:00:00 2001 From: roottool Date: Mon, 22 Apr 2019 04:17:09 +0900 Subject: [PATCH 3/4] Added newline --- pre_commit_hooks/check_yaml.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pre_commit_hooks/check_yaml.py b/pre_commit_hooks/check_yaml.py index 9bbd36c5..9b0ac894 100644 --- a/pre_commit_hooks/check_yaml.py +++ b/pre_commit_hooks/check_yaml.py @@ -4,6 +4,7 @@ import collections import sys import io + from typing import Any from typing import Generator from typing import Optional From fc9fb8bfa84b0a187bd857a668de3ce1a41d9967 Mon Sep 17 00:00:00 2001 From: roottool Date: Mon, 22 Apr 2019 04:24:41 +0900 Subject: [PATCH 4/4] Changed position of 'import io' --- pre_commit_hooks/check_yaml.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pre_commit_hooks/check_yaml.py b/pre_commit_hooks/check_yaml.py index 9b0ac894..5b664854 100644 --- a/pre_commit_hooks/check_yaml.py +++ b/pre_commit_hooks/check_yaml.py @@ -2,9 +2,8 @@ import argparse import collections -import sys import io - +import sys from typing import Any from typing import Generator from typing import Optional