From d9782b2dd1cca218e580d04a270af5fe0bfa1604 Mon Sep 17 00:00:00 2001 From: Shane Jonas Date: Thu, 10 Apr 2014 16:47:26 -0700 Subject: [PATCH] fix issue with utf8 encoding in logger stdout --- fig/cli/log_printer.py | 2 +- fig/cli/socketclient.py | 2 +- fig/service.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fig/cli/log_printer.py b/fig/cli/log_printer.py index 1bfc7bab1..35d362821 100644 --- a/fig/cli/log_printer.py +++ b/fig/cli/log_printer.py @@ -18,7 +18,7 @@ class LogPrinter(object): def run(self): mux = Multiplexer(self.generators) 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): color_fns = cycle(colors.rainbow()) diff --git a/fig/cli/socketclient.py b/fig/cli/socketclient.py index 53e3bf790..518b7af45 100644 --- a/fig/cli/socketclient.py +++ b/fig/cli/socketclient.py @@ -81,7 +81,7 @@ class SocketClient: chunk = socket.recv(4096) if chunk: - stream.write(chunk.encode(stream.encoding or 'utf8')) + stream.write(chunk.encode(stream.encoding or 'utf-8')) stream.flush() else: break diff --git a/fig/service.py b/fig/service.py index 2555967b1..4059ead6a 100644 --- a/fig/service.py +++ b/fig/service.py @@ -306,7 +306,7 @@ class Service(object): match = re.search(r'Successfully built ([0-9a-f]+)', line) if match: 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: raise BuildError(self)