Skip to content

Don't pass mixed str/bytes inputs to subprocess. #9393

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

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 5 additions & 3 deletions lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,8 @@ def find_tex_file(filename, format=None):

Parameters
----------
filename : string or bytestring
format : string or bytestring
filename : str or bytes
format : str
Used as the value of the `--format` option to :program:`kpsewhich`.
Could be e.g. 'tfm' or 'vf' to limit the search to that type of files.

Expand All @@ -1032,7 +1032,9 @@ def find_tex_file(filename, format=None):

cmd = [str('kpsewhich')]
if format is not None:
cmd += ['--format=' + format]
cmd += [str('--format=') + format]
if six.PY3 and isinstance(filename, bytes):
filename = filename.decode('ascii')
cmd += [filename]

matplotlib.verbose.report('find_tex_file(%s): %s'
Expand Down