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

Skip to content

Commit 37ad476

Browse files
authored
Fix TypeError: a bytes-like object is required, not 'str'
1 parent 790c843 commit 37ad476

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/matplotlib/dviread.py

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

1033+
if six.PY3:
1034+
if isinstance(filename, bytes):
1035+
filename = filename.decode('utf-8', errors='replace')
1036+
if isinstance(format, bytes):
1037+
format = format.decode('utf-8', errors='replace')
1038+
10331039
cmd = [str('kpsewhich')]
10341040
if format is not None:
10351041
cmd += ['--format=' + format]

0 commit comments

Comments
 (0)