Skip to content

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

Merged
merged 1 commit into from
Dec 12, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/type1font.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

for token, value in filtered:
if token is self._name and value.startswith(b'/'):
key = convert(value[1:])
Expand Down