Show More
@@ -88,9 +88,12 b' def _find_cmd(cmd):' | |||
|
88 | 88 | |
|
89 | 89 | def _system_body(p): |
|
90 | 90 | """Callback for _system.""" |
|
91 | enc = sys.stdin.encoding or sys.getdefaultencoding() | |
|
91 | 92 | for line in read_no_interrupt(p.stdout).splitlines(): |
|
93 | line = line.decode(enc, 'replace') | |
|
92 | 94 | print(line, file=sys.stdout) |
|
93 | 95 | for line in read_no_interrupt(p.stderr).splitlines(): |
|
96 | line = line.decode(enc, 'replace') | |
|
94 | 97 | print(line, file=sys.stderr) |
|
95 | 98 | |
|
96 | 99 |
@@ -44,6 +44,10 b' class OutStream(object):' | |||
|
44 | 44 | else: |
|
45 | 45 | data = self._buffer.getvalue() |
|
46 | 46 | if data: |
|
47 | # Make sure that we're handling unicode | |
|
48 | if not isinstance(data, unicode): | |
|
49 | enc = sys.stdin.encoding or sys.getdefaultencoding() | |
|
50 | data = data.decode(enc, 'replace') | |
|
47 | 51 | content = {u'name':self.name, u'data':data} |
|
48 | 52 | msg = self.session.send(self.pub_socket, u'stream', |
|
49 | 53 | content=content, |
General Comments 0
You need to be logged in to leave comments.
Login now