Skip to content

Commit a8b4942

Browse files
committed
Quick and dirty fix to allow WriteXmlIfChanged to write xml in utf-8, converting latin-1 directory paths.
1 parent 90dbe71 commit a8b4942

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

gyp/pylib/gyp/easy_xml.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False,
127127
# It has changed, write it
128128
if existing != xml_string:
129129
f = open(path, 'w')
130+
try:
131+
dec = unicode(xml_string, 'latin-1').encode('utf-8')
132+
xml_string = dec
133+
except Exception as inst:
134+
pass
130135
f.write(xml_string)
131136
f.close()
132137

0 commit comments

Comments
 (0)