Skip to content

Commit 4d1e269

Browse files
authored
Encode utf 8 (#18)
* encode file as utf-8 * change import io
1 parent 1507efb commit 4d1e269

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python_testspace_xml/testspace_xml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os.path
77
import io
88
from io import BytesIO
9+
from io import open
910
import re
1011
import sys
1112
from xml.dom.minidom import parseString
@@ -277,7 +278,7 @@ def write(self, target_file_path, to_pretty=False):
277278
doc_elem = self.dom.documentElement
278279
self._write_suite(doc_elem, self.report.get_root_suite())
279280
if target_file_path:
280-
with open(target_file_path, 'w') as target_file:
281+
with open(target_file_path, encoding='utf-8', mode='w') as target_file:
281282
if to_pretty:
282283
target_file.write(self.dom.toprettyxml())
283284
else:

0 commit comments

Comments
 (0)