Bläddra i källkod

Encode all progress stream output as UTF-8

Closes #231.
Aanand Prasad 11 år sedan
förälder
incheckning
9eb3697b40
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2 0
      fig/progress_stream.py

+ 2 - 0
fig/progress_stream.py

@@ -1,5 +1,6 @@
 import json
 import json
 import os
 import os
+import codecs
 
 
 
 
 class StreamOutputError(Exception):
 class StreamOutputError(Exception):
@@ -8,6 +9,7 @@ class StreamOutputError(Exception):
 
 
 def stream_output(output, stream):
 def stream_output(output, stream):
     is_terminal = hasattr(stream, 'fileno') and os.isatty(stream.fileno())
     is_terminal = hasattr(stream, 'fileno') and os.isatty(stream.fileno())
+    stream = codecs.getwriter('utf-8')(stream)
     all_events = []
     all_events = []
     lines = {}
     lines = {}
     diff = 0
     diff = 0