##// END OF EJS Templates
Ensure that we're writing unicode in svg2pdf preprocessor...
Thomas Kluyver -
Show More
@@ -11,6 +11,7 b' import os'
11 import sys
11 import sys
12 import subprocess
12 import subprocess
13
13
14 from IPython.utils.py3compat import cast_unicode_py2
14 from IPython.utils.tempdir import TemporaryDirectory
15 from IPython.utils.tempdir import TemporaryDirectory
15 from IPython.utils.traitlets import Unicode
16 from IPython.utils.traitlets import Unicode
16
17
@@ -64,7 +65,7 b' class SVG2PDFPreprocessor(ConvertFiguresPreprocessor):'
64 input_filename = os.path.join(tmpdir, 'figure.svg')
65 input_filename = os.path.join(tmpdir, 'figure.svg')
65 # SVG data is unicode text
66 # SVG data is unicode text
66 with io.open(input_filename, 'w', encoding='utf8') as f:
67 with io.open(input_filename, 'w', encoding='utf8') as f:
67 f.write(data)
68 f.write(cast_unicode_py2(data))
68
69
69 #Call conversion application
70 #Call conversion application
70 output_filename = os.path.join(tmpdir, 'figure.pdf')
71 output_filename = os.path.join(tmpdir, 'figure.pdf')
General Comments 0
You need to be logged in to leave comments. Login now