From b48e0e9eb50b5007a95d10eabb269c952129c729 Mon Sep 17 00:00:00 2001 From: Guillaume Poulin Date: Tue, 10 Sep 2013 22:34:20 +0800 Subject: [PATCH] Restore utf-8 compatibility for python 2 --- pyqtgraph/exporters/SVGExporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/exporters/SVGExporter.py b/pyqtgraph/exporters/SVGExporter.py index 821427a4..62b49d30 100644 --- a/pyqtgraph/exporters/SVGExporter.py +++ b/pyqtgraph/exporters/SVGExporter.py @@ -92,8 +92,8 @@ class SVGExporter(Exporter): md.setData('image/svg+xml', QtCore.QByteArray(xml.encode('UTF-8'))) QtGui.QApplication.clipboard().setMimeData(md) else: - with open(fileName, 'wt') as fh: - fh.write(asUnicode(xml)) + with open(fileName, 'wb') as fh: + fh.write(asUnicode(xml).encode('utf-8')) xmlHeader = """\