verigak / progress

Easy to use progress bars for Python
ISC License
1.41k stars 179 forks source link

fix ascii bug #53

Closed weigq closed 6 years ago

weigq commented 6 years ago

In docker containers, this bug always appears. I have test on the most used 'deepo' docker image.

UnicodeEncodeError: 'ascii' codec can't encode characters in position 12-43: ordinal not in range(128)

This is due to the encoder.

verigak commented 6 years ago

This breaks output in some cases. E.g. on Linux with Python 3.4 I get output like this:

b'Bar |################################| 200/200 [2 / 0 / 0:00:00]'

Have you tried setting PYTHONIOENCODING instead? See for example here: https://stackoverflow.com/questions/43356982/docker-python-set-utf-8-locale/46181663#46181663