-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX str.decode in python2.6 does not take keyword arguments [backport to 1.4.x] #3850
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
Conversation
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') |
There was a problem hiding this comment.
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')
There was a problem hiding this comment.
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#str.decode <-should be this link
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. |
Can we leave the "lenient" comment in. It explains why having "replace" rather than just "ascii" is important. |
Sorry, should have nuked the comment I left as it makes sense if the On Mon, Dec 1, 2014, 10:41 Michael Droettboom notifications@github.com
|
Added 0b5aae2 which return |
cherry-picked as 5876c02 |
No description provided.