浏览代码

Encode all progress stream output as UTF-8

Closes #231.
Aanand Prasad 11 年之前
父节点
当前提交
9eb3697b40
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fig/progress_stream.py

+ 2 - 0
fig/progress_stream.py

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