summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>2007-05-05 19:03:39 +0000
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>2007-05-05 19:03:39 +0000
commit015e466205a425384271bbbf71a38123ca0c4281 (patch)
tree93a75ba5cf478fc71e260ace0eb0e065340f7d17
parentf903555081dad75c588c473de4aa8a13cfd5aa20 (diff)
downloadpyyaml-015e466205a425384271bbbf71a38123ca0c4281.tar.gz
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
-rw-r--r--lib/yaml/constructor.py2
1 files changed, 1 insertions, 1 deletions
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