ipython/ipython — pull request #4581 by takluyver (2013-11-22 19:05:30+00:00)
Title: Writing unicode to stdout

Reliably writing unicode to stdout is actually a bit fiddly, with things trying to automatically detect encodings, and the differences between Python 2 and 3. This function returns a wrapper for sys.stdout/stderr that accepts unicode.

Using it in `nbconvert.writers.stdout` fixes #4578, at least for me.