##// END OF EJS Templates
use TextIOWrapper when communicating with pandoc subprocess...
MinRK -
Show More
@@ -15,6 +15,7 b' from __future__ import print_function'
15
15
16 # Stdlib imports
16 # Stdlib imports
17 import subprocess
17 import subprocess
18 from io import TextIOWrapper, BytesIO
18
19
19 # IPython imports
20 # IPython imports
20 from IPython.utils.py3compat import cast_bytes
21 from IPython.utils.py3compat import cast_bytes
@@ -64,6 +65,6 b" def pandoc(source, fmt, to, extra_args=None, encoding='utf-8'):"
64 "http://johnmacfarlane.net/pandoc/installing.html"
65 "http://johnmacfarlane.net/pandoc/installing.html"
65 )
66 )
66 out, _ = p.communicate(cast_bytes(source, encoding))
67 out, _ = p.communicate(cast_bytes(source, encoding))
67 out = out.decode(encoding, 'replace')
68 out = TextIOWrapper(BytesIO(out), encoding, 'replace').read()
68 return out[:-1]
69 return out.rstrip('\n')
69
70
General Comments 0
You need to be logged in to leave comments. Login now