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

Decode the README as utf-8 #6

Merged
merged 2 commits into from
May 20, 2015
Merged

Decode the README as utf-8 #6

merged 2 commits into from
May 20, 2015

Conversation

ryanhiebert
Copy link
Contributor

tox, in version 2, no longer passes environment variables from the calling environment. This causes problems, because the LANG environment variable is how Python attempts to figure out the locale, and defaults to ASCII. The README.rst file has utf-8 characters, and is read in the setup.py.

This means that right now this package cannot be installed under tox 2 with Python 3, unless tox is configured to pass that environment variable from the context.

Running the tests on Travis CI isn't catching this, because this problem doesn't show up without a limited environment, like we get from tox.

tox no longer passed environment variables from the calling environment.
This causes problems, because the LANG environment variable is how
Python attempts to figure out the locale, and defaults to ASCII. The
README file has utf-8 characters.

This means that right now this package cannot be installed under tox 2
with Python 3, unless tox in configured to pass that environment
variable from the context.
Put all the testing configuration and various python versions to test in
tox.ini, and use TOXENV to choose which one to build on Travis. Use
Travis' build matrix to separate the runs for all of the tox envs.

The sudo: false line should speed up the builds, because it allows
Travis to use containers.
@jwhitlock
Copy link

I'm seeing the same issue, and this fix worked for me. More people are going to get tox 2 and see it in TravisCI. An alternate is to use:

from io import open  # Python 3's open, in Python 2.6 and above
long_description=open('README.rst', 'r', encoding='utf-8')

@ryanhiebert
Copy link
Contributor Author

It is another solution. I chose this one because it doesn't require another import, and I understand based on a stack overflow answer than the io import is slower too.

@ryanhiebert
Copy link
Contributor Author

A terrible workaround for individual projects can be to add LANG to the passenv tox configuration.

@rmohr
Copy link
Owner

rmohr commented May 20, 2015

Hi,

Thank you for bringing this to my attention! I do not care very much how the encoding is set. So the version from @ryanhiebert is fine for me. I also like the new tox configuration very much.

@ryanhiebert @jwhitlock thank you for contributing!

rmohr added a commit that referenced this pull request May 20, 2015
Decode the README as utf-8
@rmohr rmohr merged commit 151b3e7 into rmohr:master May 20, 2015
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.

None yet

3 participants