Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Conversation

@alexey-sveshnikov
Copy link
Contributor

Hello.

Here is a small patch which sets encoding to UTF-8 in readme.md reading in setup.py.

On pre-3.7 environments the default encoding may be different than UTF-8. AFAIK that's the case when the system locale is not set. I'm getting UnicodeDecodeError on installing rsa in clean Ubuntu 18.04 environment in Docker.

UTF-8 mode in open as well as using io.open is the recommended by pip/pypi authors practice. I used pypi sample projects as a reference (https://github.com/pypa/sampleproject/blob/master/setup.py).

@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.838% when pulling fb552c1 on alexey-sveshnikov:master into 368a31f on sybrenstuvel:master.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Oct 19, 2018
@jgehrcke
Copy link

This needs to be merged. Installing from the tarball is otherwise broken on many Linux systems. During setup.py install:

    Traceback (most recent call last):
[...]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 898: ordinal not in range(128)

@sybrenstuvel
Copy link
Owner

Thanks for the pull request! I've applied your changes (0eaeead) with a few minor changes:

  • Removed the added 'r' argument to open(), as it's superfluous and doesn't have anything to do with the actual issue addressed in this PR.
  • Copied the comment about importing io.open from the reference project you linked. I think the comment is good to keep, as it'll get relevant relatively soon when we drop Python 2 support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants