linusg / xbox360controller

🎮 A pythonic Xbox360 controller API built on top of the xpad Linux kernel driver
MIT License
97 stars 17 forks source link

Non-ASCII Characters on line 126 of README.md cause pip install to fail #7

Closed jennib3 closed 6 years ago

jennib3 commented 6 years ago

Raspbian image with pip3 version 10.0.1 reports error when installing xbox360controller:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4365: ordinal not in range(128)

I removed what appeared to be non ascii characters on line 126 of the README.md file and the install was successful.

In the line: Linus Groh (@linusg) – mail@linusgroh.de the appears to be the culprit.

linusg commented 6 years ago

Thanks for pointing out! I'm not quite sure what would make pip believe it's ASCII only (which it is not), anyways - would you mind creating a PR? The dash in the Readme is not the "normal" dash/minus but the semantically correct longer dash. I would not mind removing it, so again, a PR would be appreciated.

linusg commented 6 years ago

I believe it's Raspbian having some strange default of the LANG environment variable... Would you mind telling me the output of echo $LANG and echo $LC_ALL (latter might be empty)? I never had any problems like this on Linux Mint, currently using pip 10.0.0, and I also had Emojis and probably umlauts in other READMEs.

Also if it's caused by the setup script trying to open and read the README.md, a much better fix would be not only catching FileNotFound, but also UnicodeDecodeError, as the long description is required for PyPI only anyways.

jennib3 commented 6 years ago

Here are the outputs:

~ $ echo $LANG en_US.UTF-8 ~ $ echo $LC_ALL C

linusg commented 6 years ago

Ok, thanks. Still not sure why pip behaves like this on Raspbian. The most straightforward and bulletproof solution would be extending:

https://github.com/linusg/xbox360controller/blob/773e09e0313daf6786401a638e575c353e11efb8/setup.py#L7

to:

except (FileNotFoundError, UnicodeDecodeError):

If you can provide a PR, great, if not, I can fix it sometimes at the weekend.

linusg commented 6 years ago

Fixed by https://github.com/linusg/xbox360controller/pull/8, releases on PyPI and GitHub are done.