From 41d5f916c166f893e7af6ec34890b10bb7193aa1 Mon Sep 17 00:00:00 2001 From: Giorgos Verigakis Date: Mon, 25 Nov 2013 12:52:20 +0800 Subject: [PATCH] Fix Python 3 output --- progress/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/progress/helpers.py b/progress/helpers.py index 1b33258..9ed90b2 100644 --- a/progress/helpers.py +++ b/progress/helpers.py @@ -37,7 +37,7 @@ class WriteMixin(object): def write(self, s): if self.file.isatty(): b = '\b' * self._width - c = s.encode('utf8').ljust(self._width) + c = s.ljust(self._width) print(b + c, end='', file=self.file) self._width = max(self._width, len(s)) self.file.flush() @@ -65,7 +65,7 @@ class WritelnMixin(object): def writeln(self, line): if self.file.isatty(): self.clearln() - print(line.encode('utf8'), end='', file=self.file) + print(line, end='', file=self.file) self.file.flush() def finish(self):