Fix encoding issue when installing with Pip3 #58
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When installing with pip3, the following error is given:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 48: ordinal not in range(128)
It appears that if you don't explicitly set the encoding with locale.setlocale(locale.LC_ALL, 'en_US.utf-8') --- or whatever locale, just the encoding matters AFAIK --- python will try to decode files using ascii (the
locale.getpreferredencoding(False)
function thatopen()
actually depends on for the type of encoding it uses returns ANSI_X3.4-1968). This generates an issue where Python will say it cannot decode usingascii
and the installation will fail.I'm manually setting the encoding depending on the Python version now, i just copied line 48 (in old setup.py) to check the python version.