From 5e1c64e61efb574c6c23e6e6b60054f898986b2a Mon Sep 17 00:00:00 2001 From: Nurono Date: Wed, 23 Nov 2016 12:48:09 +0300 Subject: [PATCH] fix UnicodeEncodeError --- colout/colout.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/colout/colout.py b/colout/colout.py index a5744d9..b80e065 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -698,6 +698,8 @@ def write(colored, stream = sys.stdout): """ Write "colored" on sys.stdout, then flush. """ + if isinstance(colored, unicode): + colored = colored.encode('utf-8') try: stream.write(colored) stream.flush()