mirror of
https://gitee.com/openharmony/third_party_pyyaml
synced 2025-03-03 08:18:33 +00:00
Make the encoding of the unicode->str conversion explicit; fix [52].
This commit is contained in:
parent
9eb838b97b
commit
69379ea21b
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user