From e23b7590c30ad3b1b45ce83ff9e0a05961fe0a28 Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 24 Jun 2017 02:29:33 -0700 Subject: [PATCH] Swap utf-8 progbar character for ASCII In terminal work. printing Unicode characters can be problematic. In particular, using a Unicode character for the progressbar causes encoding errors if the environment is not set up properly: ``` UnicodeEncodeError: 'ascii' codec can't encode character '\u2588' in position 15: ordinal not in range(128) ``` This uses a typical ASCII character for the progress bar so that we have less to worry about when running Edward. --- edward/util/progbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edward/util/progbar.py b/edward/util/progbar.py index b9224e705..a5591c0aa 100644 --- a/edward/util/progbar.py +++ b/edward/util/progbar.py @@ -77,7 +77,7 @@ def update(self, current, values=None, force=False): bar += ' ' prog_width = int(self.width * float(current) / self.target) if prog_width > 0: - bar += ('█' * prog_width) + bar += ('*' * prog_width) bar += (' ' * (self.width - prog_width)) sys.stdout.write(bar)