rsalmei / alive-progress

A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
MIT License
5.53k stars 206 forks source link

Unicode encode error with anaconda #76

Closed jkscg317 closed 2 years ago

jkscg317 commented 3 years ago

Using win 7 latest release of anaconda and python. this is the error i get when running one of your examples:

File "C:\Users\User\Desktop\DB\untitled0.py", line 20, in bar() # call after consuming one item

File "C:\Users\User\Anaconda3\lib\contextlib.py", line 120, in exit next(self.gen)

File "C:\Users\User\Anaconda3\lib\site-packages\alive_progress\core\progress.py", line 282, in alive_bar alive_repr()

File "C:\Users\User\Anaconda3\lib\site-packages\alive_progress\core\progress.py", line 116, in alive_repr sys.stdout.write(line[:cols] + (spin and '\r' or '\n'))

File "C:\Users\User\Anaconda3\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0]

UnicodeEncodeError: 'charmap' codec can't encode characters in position 1-41: character maps to

TheTechRobo commented 3 years ago

What do you mean, "latest version of python"?

That could be 3.7.x, 3.8.x, 3.9.x.

rsalmei commented 3 years ago

Hey @jkscg317, I have a very similar ticket #15 on Linux'es, this only occurs on Windows. I'm not sure what could cause this. What does your system report with this:

import sys
sys.getdefaultencoding()
jkscg317 commented 3 years ago

Running python 3.8.

utf-8

rsalmei commented 3 years ago

Humm, if your system does use utf-8, why would your anaconda try to encode it with cp1252??? 🤔

rsalmei commented 2 years ago

Closing this one, in favor of #15.