From 015e466205a425384271bbbf71a38123ca0c4281 Mon Sep 17 00:00:00 2001 From: xi Date: Sat, 5 May 2007 19:03:39 +0000 Subject: [PATCH] Make the encoding of the unicode->str conversion explicit; fix [52]. git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@251 18f92427-320e-0410-9341-c67f048884a3 --- lib/yaml/constructor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yaml/constructor.py b/lib/yaml/constructor.py index 73fd4e3..a1295c8 100644 --- a/lib/yaml/constructor.py +++ b/lib/yaml/constructor.py @@ -379,7 +379,7 @@ class SafeConstructor(BaseConstructor): def construct_yaml_str(self, node): value = self.construct_scalar(node) try: - return str(value) + return value.encode('ascii') except UnicodeEncodeError: return value -- 2.11.4.GIT