Skip to content

Commit deb990d

Browse files
committed
🐛 fix utf-8 encoding issue with python3
1 parent ce92d3f commit deb990d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pyexcel_echarts/echarts.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import tempfile
22

3+
from pyexcel._compact import PY2
34
from pyexcel.renderer import Renderer
45
from pyexcel_echarts.options import MANAGER
56

@@ -28,4 +29,7 @@ def _write_content(self, instance):
2829
with tempfile.NamedTemporaryFile(suffix=".html") as fout:
2930
instance.render(path=fout.name)
3031
fout.seek(0)
31-
self._stream.write(fout.read())
32+
if PY2:
33+
self._stream.write(fout.read())
34+
else:
35+
self._stream.write(fout.read().decode('utf-8'))

0 commit comments

Comments
 (0)