Skip to content
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
Copy Markdown
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
Copy Markdown
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