5

If I run a python script using piping, sys.stdout.encoding inside it becomes None and crashes it. How can I get away with it without modifying the script? I cannot modify it for some reason.

smci
  • 29,564
  • 18
  • 109
  • 144
user1081596
  • 877
  • 1
  • 9
  • 16
  • 1
    possible duplicates of: http://stackoverflow.com/questions/492483/setting-the-correct-encoding-when-piping-stdout-in-python http://stackoverflow.com/questions/1473577/writing-unicode-strings-via-sys-stdout-in-python http://stackoverflow.com/questions/4374455/how-to-set-sys-stdout-encoding-in-python-3 (and several note `PYTHONIOENCODING`) – torek Apr 03 '12 at 16:00

0 Answers0