# HG changeset patch # User Franz Glasner # Date 1522319840 -7200 # Node ID eefde3288fb80725db39c0c941ce5fa39c7af737 # Parent e37fc67ae7f389f48050308b45badaf2ce2c0989 FIX: YAML-file streams must be opened as UTF-8 text files; otherwise double encoding occurs for non-Unicode locales (e.g. Windows) diff -r e37fc67ae7f3 -r eefde3288fb8 tests/test.py --- a/tests/test.py Thu Mar 29 10:08:26 2018 +0200 +++ b/tests/test.py Thu Mar 29 12:37:20 2018 +0200 @@ -4,6 +4,7 @@ import os import unittest import platform +import io sys.path.insert( 0, @@ -59,7 +60,8 @@ self.__check_types(cfg) def test03_yaml_types(self): - with open(os.path.join(TESTDATADIR, "conf1.yml"), "rt") as f: + with io.open(os.path.join(TESTDATADIR, "conf1.yml"), "rt", + encoding="utf-8") as f: cfg = configmix.yaml.safe_load(f) self.__check_types(cfg) @@ -86,7 +88,8 @@ self.__check_tree(cfg) def test08_yaml_tree(self): - with open(os.path.join(TESTDATADIR, "conf10.yml"), "rt") as f: + with io.open(os.path.join(TESTDATADIR, "conf10.yml"), "rt", + encoding="utf-8") as f: cfg = configmix.yaml.safe_load(f) self.__check_tree(cfg)