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

drop some non-ASCII characters from HISTORY.rst #20

Merged
merged 1 commit into from Apr 30, 2015

Conversation

AdamWill
Copy link

This file was using some odd unicode character instead of a normal apostrophe in a couple of places. Replace one occurrence with a normal apostrophe and remove the other (the possessive "its" does not contain an apostrophe).

This could cause a problem when setup.py does this:

history = open('HISTORY.rst').read().replace('.. :changelog:', '')

In Python 3, when you do open().read(), a unicode decode occurs. The 'default' encoding used in this case depends on details of system configuration, for instance the locale. In some cases, it can be ASCII - and so when the file contains non-ASCII characters, this causes a traceback. (This was happening in the Fedora buildsystem; presumably our buildbots don't have a UTF-8 locale).

We could do this:

history = open('HISTORY.rst', encoding='utf-8').read().replace('.. :changelog:', '')

but that's not valid in Python 2, open() does not have the encoding argument there. So at that point I figured it was easier to just find the non-ASCII characters and fix those than try and figure out a fix for reading non-ASCII chars that's safe for both Pythons.

This file was using some odd unicode character instead of a
normal apostrophe in a couple of places. Replace one occurrence
with a normal apostrophe and remove the other (the possessive
"its" does not contain an apostrophe).
@pydanny
Copy link
Owner

pydanny commented Apr 30, 2015

How the heck did that get in there? Anyhows, thanks for spotting it!

pydanny added a commit that referenced this pull request Apr 30, 2015
drop some non-ASCII characters from HISTORY.rst
@pydanny pydanny merged commit a876fc4 into pydanny:master Apr 30, 2015
@AdamWill
Copy link
Author

No problem. I see you put me in AUTHORS.rst as 'AdamWill' - you can credit me as Adam Williamson, awilliam AT redhat DOT com , but this really seems too trivial to merit a credit to be honest!

@pydanny
Copy link
Owner

pydanny commented Apr 30, 2015

I'm pretty fanatical in my belief that all work should be credited properly. :)

@chriskuehl
Copy link

@AdamWill thanks for fixing this!

@pydanny any chance you could cut a release to PyPI containing this fix? I know it's really trivial and not this project's fault, but the pip bug prevents us from installing your package on any of our servers :(

It's the same issue as in https://github.com/kennethreitz/requests/pull/2420

thanks!

chriskuehl added a commit to ocf/ocflib that referenced this pull request Nov 24, 2015
We can't install ocflib on the wheezy servers anymore because of a bug
in pip that prevents packages from being installed that have undecodable
bytes (via the current locale, which in Puppet is "C").

This was fixed in pydanny/cached-property#20 but
no release has been made yet.

This can be reverted once a release is made, or when we're fully on
jessie (which installs cached-property via a Debian package).
@pydanny
Copy link
Owner

pydanny commented Nov 25, 2015

I'll get a release out this evening or tomorrow. 😄

@pydanny
Copy link
Owner

pydanny commented Nov 25, 2015

Just release 1.3.0 "Bold Bottle": https://github.com/pydanny/cached-property/releases/tag/1.3.0

chriskuehl added a commit to ocf/ocflib that referenced this pull request Nov 25, 2015
@chriskuehl
Copy link

@pydanny thanks for the quick release! <3

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