##// END OF EJS Templates
Use unicode_std_stream in nbconvert stdout writer...
Thomas Kluyver -
Show More
@@ -13,6 +13,7 b' Contains Stdout writer'
13 13 # Imports
14 14 #-----------------------------------------------------------------------------
15 15
16 from IPython.utils import io
16 17 from .base import WriterBase
17 18
18 19 #-----------------------------------------------------------------------------
@@ -30,5 +31,4 b' class StdoutWriter(WriterBase):'
30 31
31 32 See base for more...
32 33 """
33
34 print(output)
34 io.unicode_std_stream().write(output)
@@ -1,3 +1,4 b''
1 # coding: utf-8
1 2 """
2 3 Module with tests for stdout
3 4 """
@@ -43,9 +44,11 b' class TestStdout(TestsBase):'
43 44
44 45 # Create stdout writer, test output
45 46 writer = StdoutWriter()
46 writer.write('a', {'b': 'c'})
47 writer.write(u'a×', {'b': 'c'})
47 48 output = stream.getvalue()
48 self.fuzzy_compare(output, 'a')
49 if not PY3:
50 output = output.decode('utf-8')
51 self.fuzzy_compare(output, u'a×')
49 52
50 53 # Revert stdout
51 54 sys.stdout = stdout No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now