Skip to content

Overhaul external process calls #7572

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

Merged
merged 16 commits into from
Apr 14, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
BUG: fix check_output with non-ascii in paths similar to #7715
  • Loading branch information
tomspur committed Apr 9, 2017
commit 742cf62e9b9c29a137f558ea069d658865b5c86d
10 changes: 5 additions & 5 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def gs_exe(self):
gs_exe = 'gs'

self._cached["gs_exe"] = gs_exe
return gs_exe
return str(gs_exe)

@property
def gs_version(self):
Expand Down Expand Up @@ -1539,7 +1539,7 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
else:
device_name = "pswrite"

command = [gs_exe, "-dBATCH", "-dNOPAUSE", "-r%d" % dpi,
command = [str(gs_exe), "-dBATCH", "-dNOPAUSE", "-r%d" % dpi,
"-sDEVICE=%s" % device_name, paper_option,
"-sOutputFile=%s" % psfile, tmpfile]
verbose.report(command, 'debug')
Expand Down Expand Up @@ -1595,13 +1595,13 @@ def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
paper_option = "-sPAPERSIZE=%s" % ptype

if sys.platform == "win32":
command = ["ps2pdf", "-dAutoFilterColorImages#false",
command = [str("ps2pdf"), "-dAutoFilterColorImages#false",
"-dAutoFilterGrayImages#false",
"-sGrayImageFilter#FlateEncode",
"-sColorImageFilter#FlateEncode", paper_option, tmpfile,
pdffile]
else:
command = ["ps2pdf", "-dAutoFilterColorImages=false",
command = [str("ps2pdf"), "-dAutoFilterColorImages=false",
"-dAutoFilterGrayImages=false",
"-sGrayImageFilter=FlateEncode",
"-sColorImageFilter=FlateEncode", paper_option, tmpfile,
Expand All @@ -1622,7 +1622,7 @@ def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
verbose.report(fh.read(), 'debug')
os.remove(outfile)

command = ["pdftops", "-paper", "match", "-level2", pdffile, psfile]
command = [str("pdftops"), "-paper", "match", "-level2", pdffile, psfile]
verbose.report(command, 'debug')
try:
with open(outfile, "w") as fout:
Expand Down