From cf48254eb4a8364ceaeb710607c4b21ba5cbe8a6 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 11 Feb 2015 11:55:25 +0000 Subject: Encode messages to utf-8 before writing them to the console in util.multi_log. --- cloudinit/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudinit/util.py b/cloudinit/util.py index d63b4bf2..eba93d1c 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -405,7 +405,7 @@ def multi_log(text, console=True, stderr=True, conpath = "/dev/console" if os.path.exists(conpath): with open(conpath, 'wb') as wfh: - wfh.write(text) + wfh.write(text.encode('utf-8')) wfh.flush() else: # A container may lack /dev/console (arguably a container bug). If -- cgit v1.2.3