Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Let python redirect unicode stdout to files w/out crashing. Requires LANG=C.UTF-8 or similar in .profile
import codecs
import sys
sys.stdout = codecs.getwriter('utf-8')(sys.__stdout__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.