This repository was archived by the owner on Sep 16, 2020. It is now read-only.
make combine_files() work with UTF-8 encoded files#394
Merged
AlanCoding merged 1 commit intoansible:masterfrom Oct 9, 2017
evgeni:non-unicode-setup
Merged
make combine_files() work with UTF-8 encoded files#394AlanCoding merged 1 commit intoansible:masterfrom evgeni:non-unicode-setup
AlanCoding merged 1 commit intoansible:masterfrom
evgeni:non-unicode-setup
Conversation
setup.py might fail on Python 3 in non-UTF8 environments while parsing
HISTORY.rst or README.rst which are not required to be ASCII-only with:
UnicodeDecodeError: 'ascii' codec can't decode …
We could also require the files to be plain ASCII, but it sounds not the
right thing to do in the 21st century.
Simple reproducer:
% LC_ALL=C python3 setup.py
Traceback (most recent call last):
File "setup.py", line 126, in <module>
long_description=combine_files('README.rst', 'HISTORY.rst'),
File "setup.py", line 112, in combine_files
file_contents.append(f.read())
File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2132: ordinal not in range(128)
Member
|
This makes sense to me. I believe the idea is that files that we are providing are implicitly utf-8, and it just needs to be marked as such. |
AlanCoding
approved these changes
Oct 9, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
setup.py might fail on Python 3 in non-UTF8 environments while parsing
HISTORY.rst or README.rst which are not required to be ASCII-only with:
We could also require the files to be plain ASCII, but it sounds not the
right thing to do in the 21st century.
Simple reproducer: