diff options
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/coverage/control.py b/coverage/control.py index b7ba055d..0a5ccae6 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -1047,7 +1047,10 @@ class Coverage(object): output_dir = os.path.dirname(self.config.xml_output) if output_dir and not os.path.isdir(output_dir): os.makedirs(output_dir) - outfile = open(self.config.xml_output, "w") + open_kwargs = {} + if env.PY3: + open_kwargs['encoding'] = 'utf8' + outfile = open(self.config.xml_output, "w", **open_kwargs) file_to_close = outfile try: reporter = XmlReporter(self, self.config) |