Skip to content

Commit d11d087

Browse files
committed
BUG: fix check_output with non-ascii in paths similar to #7715
1 parent 50edfc6 commit d11d087

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def gs_exe(self):
7171
gs_exe = 'gs'
7272

7373
self._cached["gs_exe"] = gs_exe
74-
return gs_exe
74+
return str(gs_exe)
7575

7676
@property
7777
def gs_version(self):
@@ -1540,7 +1540,7 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
15401540
else:
15411541
device_name = "pswrite"
15421542

1543-
command = [gs_exe, "-dBATCH", "-dNOPAUSE", "-r%d" % dpi,
1543+
command = [str(gs_exe), "-dBATCH", "-dNOPAUSE", "-r%d" % dpi,
15441544
"-sDEVICE=%s" % device_name, paper_option,
15451545
"-sOutputFile=%s" % psfile, tmpfile]
15461546
verbose.report(command, 'debug')
@@ -1596,13 +1596,13 @@ def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
15961596
paper_option = "-sPAPERSIZE=%s" % ptype
15971597

15981598
if sys.platform == "win32":
1599-
command = ["ps2pdf", "-dAutoFilterColorImages#false",
1599+
command = [str("ps2pdf"), "-dAutoFilterColorImages#false",
16001600
"-dAutoFilterGrayImages#false",
16011601
"-sGrayImageFilter#FlateEncode",
16021602
"-sColorImageFilter#FlateEncode", paper_option, tmpfile,
16031603
pdffile]
16041604
else:
1605-
command = ["ps2pdf", "-dAutoFilterColorImages=false",
1605+
command = [str("ps2pdf"), "-dAutoFilterColorImages=false",
16061606
"-dAutoFilterGrayImages=false",
16071607
"-sGrayImageFilter=FlateEncode",
16081608
"-sColorImageFilter=FlateEncode", paper_option, tmpfile,
@@ -1623,7 +1623,7 @@ def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
16231623
verbose.report(fh.read(), 'debug')
16241624
os.remove(outfile)
16251625

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

0 commit comments

Comments
 (0)