From 5d52c5b2991c7c36349506db1da6229a9704c949 Mon Sep 17 00:00:00 2001 From: Georgios Verigakis Date: Thu, 31 May 2018 09:47:00 +0300 Subject: [PATCH] Avoid unprintable chars on Windows Fixes #36 --- progress/bar.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/progress/bar.py b/progress/bar.py index 5ee968f..025e61c 100644 --- a/progress/bar.py +++ b/progress/bar.py @@ -15,6 +15,9 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from __future__ import unicode_literals + +import sys + from . import Progress from .helpers import WritelnMixin @@ -61,7 +64,10 @@ class FillingCirclesBar(ChargingBar): class IncrementalBar(Bar): - phases = (' ', '▏', '▎', '▍', '▌', '▋', '▊', '▉', '█') + if sys.platform.startswith('win'): + phases = (u' ', u'▌', u'█') + else: + phases = (' ', '▏', '▎', '▍', '▌', '▋', '▊', '▉', '█') def update(self): nphases = len(self.phases)