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

FIX str.decode in python2.6 does not take keyword arguments [backport to 1.4.x] #3850

Merged
merged 1 commit into from Dec 12, 2014

Conversation

NelleV
Copy link
Member

@NelleV NelleV commented Nov 26, 2014

No description provided.

@tacaswell
Copy link
Member

Can you also take out the 'be lenient ...' comment from the line above?

@@ -216,7 +216,7 @@ def _parse(self):
# The spec calls this an ASCII format; in Python 2.x we could
# just treat the strings and names as opaque bytes but let's
# turn them into proper Unicode, and be lenient in case of high bytes.
convert = lambda x: x.decode('ascii', errors='replace')
convert = lambda x: x.decode('ascii')
Copy link
Member

Choose a reason for hiding this comment

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

https://docs.python.org/2/library/stdtypes.html Seems to suggest that the problem is the keyword, not the error handling. I think this can be changed to x.decode('ascii', 'replace')

Copy link
Member

Choose a reason for hiding this comment

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

@tacaswell tacaswell changed the title FIX str.decode in python2.6 does not take keyword arguments FIX str.decode in python2.6 does not take keyword arguments [backport to 1.4.x] Nov 26, 2014
@NelleV
Copy link
Member Author

NelleV commented Nov 26, 2014

I'll fix that ASAP, but I've got code running with mpl, so I can't test in the next 10 to 12 hours.

@mdboom
Copy link
Member

mdboom commented Dec 1, 2014

Can we leave the "lenient" comment in. It explains why having "replace" rather than just "ascii" is important.

@tacaswell
Copy link
Member

Sorry, should have nuked the comment I left as it makes sense if the
replace was removed entirely.

On Mon, Dec 1, 2014, 10:41 Michael Droettboom notifications@github.com
wrote:

Can we leave the "lenient" comment in. It explains why having "replace"
rather than just "ascii" is important.


Reply to this email directly or view it on GitHub
#3850 (comment)
.

@tacaswell tacaswell merged commit addc51e into matplotlib:master Dec 12, 2014
@tacaswell
Copy link
Member

Added 0b5aae2 which return 'replace' in a 2.6 compatible way and manually merged.

@tacaswell
Copy link
Member

cherry-picked as 5876c02

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