Skip to content

Commit 0b5aae2

Browse files
committed
MNT : retain 'replace' and 2.6 compat
Per https://docs.python.org/2/library/stdtypes.html#str.decode the error handling arg was added in 2.2, but support for kwarg was only added in 2.7
1 parent addc51e commit 0b5aae2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/type1font.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def _parse(self):
216216
# The spec calls this an ASCII format; in Python 2.x we could
217217
# just treat the strings and names as opaque bytes but let's
218218
# turn them into proper Unicode, and be lenient in case of high bytes.
219-
convert = lambda x: x.decode('ascii')
219+
convert = lambda x: x.decode('ascii', 'replace')
220220
for token, value in filtered:
221221
if token is self._name and value.startswith(b'/'):
222222
key = convert(value[1:])

0 commit comments

Comments
 (0)