Encode csv export header as unicode

This commit is contained in:
Ogi 2020-05-30 21:13:20 -07:00
parent e08ac110f5
commit 173a755b6c

View File

@ -3,6 +3,7 @@ from ..Qt import QtGui, QtCore
from .Exporter import Exporter from .Exporter import Exporter
from ..parametertree import Parameter from ..parametertree import Parameter
from .. import PlotItem from .. import PlotItem
from ..python2_3 import asUnicode
__all__ = ['CSVExporter'] __all__ = ['CSVExporter']
@ -57,7 +58,7 @@ class CSVExporter(Exporter):
sep = '\t' sep = '\t'
with open(fileName, 'w') as fd: with open(fileName, 'w') as fd:
fd.write(sep.join(header) + '\n') fd.write(sep.join(map(asUnicode, header)) + '\n')
i = 0 i = 0
numFormat = '%%0.%dg' % self.params['precision'] numFormat = '%%0.%dg' % self.params['precision']
numRows = max([len(d[0]) for d in data]) numRows = max([len(d[0]) for d in data])