Skip to content

Commit 9765dba

Browse files
authored
Merge pull request mtalexan#26 from Matt141421356/master
v1meta: Fix UnicodeEncodeError when using utf-8 in newvalue
2 parents 9020a8a + 447e042 commit 9765dba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

v1pysdk/v1meta.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,11 @@ def generate_update_doc(self, newdata):
119119
node = Element('Attribute')
120120
node.set('name', attrname)
121121
node.set('act', 'set')
122-
node.text = str(newvalue)
123-
update_doc.append(node)
122+
if isinstance(newvalue, unicode) != True:
123+
node.text = str(newvalue).decode('utf-8')
124+
else:
125+
node.text = newvalue
126+
update_doc.append(node)
124127
return update_doc
125128

126129
def create_asset(self, asset_type_name, newdata):

0 commit comments

Comments
 (0)