Unicode translation on pyinstaller
When using pyinstaller to 'compile' a program using decorating, I am suddenly faced with the following:
Traceback (most recent call last): File "threading.py", line 801, in __bootstrap_inner File "threading.py", line 754, in run File "site-packages/decorating/animation.py", line 157, in _spinner File "site-packages/decorating/stream.py", line 84, in write File "site-packages/decorating/stream.py", line 56, in write UnicodeEncodeError: 'ascii' codec can't encode character u'\u28fe' in position 18: ordinal not in range(128)
The little research I have done points to unicode being cast as strings, and I found a few workarounds based on using locales, but so far, no success.
The library is otherwise working fine and is pretty awesome.
Thanks for the report!
A few questions to get more into of this bug:
- Are you trying to use this package with Python2?
- Pyinstaller in some way did any type of Python2 compatibility stuff?
- This only occurs with Pyinstaller?
Please answer this questions and share your Python version as well a more detailed description of your environment, operating system and etc.
I'm not very familiar with pyinstaller, but there is a way to define unicode as literals if are you using Python2:
from __future__ import unicode_literals
If this is related to Python2, I don't use Python2 too much. Indeed there is some type of support of Python2 on decorating package, but this was provided by another person that is not currently an active maintainer.
The library is otherwise working fine and is pretty awesome.
I'm glade that you liked it.
Hi @ryukinix, To answer your questions, and I am sorry it is not going to be much help, yes, this is with python2 since sadly, that's the common denominator between everyone's computers and our servers (can't wait for things to start moving to Python3, but sadly, for the moment, I am stuck with it...) So this happens on Mac. Before running pyinstaller, everything works perfectly fine. The problem only happens post pyinstaller when running the binary. I have not had a chance to implement your suggestion of importing from future, but I will try it shortly. System details: OS: MacOS High Sierra Python: 2.7.14 from homwbrew (side rant, I wish Apple would stop messing with python...) and pip freeze, for the relevant parts, tells me: PyInstaller==3.3 decorating==0.6
Hope this helps!
Cheers :)
Thanks for the info! If you have later any news about it, I'll be glad to hear from you.
Since I get more free time I'll try check the reason of that, but this can be a someway difficult since my environment is so different from you (I use Linux, Python3 and never used pyinstaller).