From 94b43e0fbd95b180f4de8bfb8bdeed1c34a30361 Mon Sep 17 00:00:00 2001 From: Oleg Moroz Date: Tue, 13 Dec 2022 11:16:46 +0300 Subject: [PATCH] Use utf-8 as default yaml file encoding --- yamale/readers/yaml_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yamale/readers/yaml_reader.py b/yamale/readers/yaml_reader.py index 59696b3..68c400a 100644 --- a/yamale/readers/yaml_reader.py +++ b/yamale/readers/yaml_reader.py @@ -31,7 +31,7 @@ def parse_yaml(path=None, parser='pyyaml', content=None): if (path is None and content is None) or (path is not None and content is not None): raise TypeError("Pass either path= or content=, not both") if path is not None: - with open(path) as f: + with open(path, encoding='utf8') as f: return parse(f) else: return parse(StringIO(content))