Make the encoding of the unicode->str conversion explicit; fix [52].

This commit is contained in:
Kirill Simonov 2007-05-05 19:03:39 +00:00
parent 9eb838b97b
commit 69379ea21b

View File

@ -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