Skip to content

Swap utf-8 progbar character for ASCII#692

Open
rw wants to merge 1 commit intoblei-lab:masterfrom
rw:patch-1
Open

Swap utf-8 progbar character for ASCII#692
rw wants to merge 1 commit intoblei-lab:masterfrom
rw:patch-1

Conversation

@rw
Copy link
Contributor

@rw rw commented Jun 24, 2017

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 patch changes the progress bar character to be ASCII, so that we have less to worry about when running Edward.

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.
@dustinvtran
Copy link
Member

IMO the UTF-8 black bar is a lot cleaner. Does catching this error with a try/except block work? E.g., it will default to using the ASCII * if that error is raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants