Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e10c523

Browse files
authored
Merge pull request #9292 from cgohlke/patch-1
FIX: TypeError a bytes-like object is required, not 'str'
2 parents b263f40 + ab4a691 commit e10c523

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/matplotlib/dviread.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,14 @@ def find_tex_file(filename, format=None):
10301030
The library that :program:`kpsewhich` is part of.
10311031
"""
10321032

1033+
if six.PY3:
1034+
# we expect these to always be ascii encoded, but use utf-8
1035+
# out of caution
1036+
if isinstance(filename, bytes):
1037+
filename = filename.decode('utf-8', errors='replace')
1038+
if isinstance(format, bytes):
1039+
format = format.decode('utf-8', errors='replace')
1040+
10331041
cmd = [str('kpsewhich')]
10341042
if format is not None:
10351043
cmd += ['--format=' + format]

0 commit comments

Comments
 (0)