mirror of
https://github.com/docker/compose.git
synced 2025-07-27 15:44:08 +02:00
Merge pull request #188 from shanejonas/fix/utf8-encoding
fix issue with utf8 encoding in logger stdout
This commit is contained in:
commit
5061875fa9
@ -18,7 +18,7 @@ class LogPrinter(object):
|
|||||||
def run(self):
|
def run(self):
|
||||||
mux = Multiplexer(self.generators)
|
mux = Multiplexer(self.generators)
|
||||||
for line in mux.loop():
|
for line in mux.loop():
|
||||||
sys.stdout.write(line.encode(sys.__stdout__.encoding or 'utf8'))
|
sys.stdout.write(line.encode(sys.__stdout__.encoding or 'utf-8'))
|
||||||
|
|
||||||
def _make_log_generators(self):
|
def _make_log_generators(self):
|
||||||
color_fns = cycle(colors.rainbow())
|
color_fns = cycle(colors.rainbow())
|
||||||
|
@ -81,7 +81,7 @@ class SocketClient:
|
|||||||
chunk = socket.recv(4096)
|
chunk = socket.recv(4096)
|
||||||
|
|
||||||
if chunk:
|
if chunk:
|
||||||
stream.write(chunk.encode(stream.encoding or 'utf8'))
|
stream.write(chunk.encode(stream.encoding or 'utf-8'))
|
||||||
stream.flush()
|
stream.flush()
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
@ -306,7 +306,7 @@ class Service(object):
|
|||||||
match = re.search(r'Successfully built ([0-9a-f]+)', line)
|
match = re.search(r'Successfully built ([0-9a-f]+)', line)
|
||||||
if match:
|
if match:
|
||||||
image_id = match.group(1)
|
image_id = match.group(1)
|
||||||
sys.stdout.write(line.encode(sys.__stdout__.encoding or 'utf8'))
|
sys.stdout.write(line.encode(sys.__stdout__.encoding or 'utf-8'))
|
||||||
|
|
||||||
if image_id is None:
|
if image_id is None:
|
||||||
raise BuildError(self)
|
raise BuildError(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user