Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly specify the encoding while reading the readme file. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abhipec
Copy link

@abhipec abhipec commented Feb 1, 2019

Since the readme file contains a Unicode character, on some systems such as docker container when the terminal encoding is not proper, the setup fails with the following error:

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

The error is generated while reading the readme file in setup.py

This pull request will resolve this issue. The proposed solution is tested for Python 2.7 and Python 3.5.

@@ -14,8 +14,8 @@ def has_gpu():
return False


with open("README.md", "r") as fh:
long_description = fh.read()
with open("README.md", "rb") as fh:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should specify the encoding directly in the open() call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants