diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index 984505021..612df367e 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -63,12 +63,14 @@ class exportHtmlThread(threading.Thread): HTML = self.generateFullHTML(sMkt, sFit, dnaUrl) try: - FILE = open(settings.getPath(), "w") - FILE.write(HTML.encode('utf-8')) + FILE = open(settings.getPath(), "w", encoding='utf-8') + FILE.write(HTML) FILE.close() - except IOError: + except IOError as ex: print(("Failed to write to " + settings.getPath())) pass + except Exception as ex: + pass if self.callback: wx.CallAfter(self.callback, -1) @@ -84,6 +86,7 @@ class exportHtmlThread(threading.Thread):