Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c0d5a14

Browse filesBrowse files
committed
pgf: Fix invalid arguments passed to pdftocairo.
This breaks saving PNG when using the PGF backend. Fixes #8121.
1 parent 03e540f commit c0d5a14
Copy full SHA for c0d5a14

File tree

Expand file treeCollapse file tree

1 file changed

+3
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-4
lines changed

‎lib/matplotlib/backends/backend_pgf.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_pgf.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,9 @@ def make_pdf_to_png_converter():
191191
# pick converter
192192
if "pdftocairo" in tools_available:
193193
def cairo_convert(pdffile, pngfile, dpi):
194-
cmd = [str("pdftocairo"), "-singlefile", "-png",
195-
"-r %d" % dpi, pdffile, os.path.splitext(pngfile)[0]]
196-
# for some reason this doesn't work without shell
197-
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
194+
cmd = [str("pdftocairo"), "-singlefile", "-png", "-r", "%d" % dpi,
195+
pdffile, os.path.splitext(pngfile)[0]]
196+
check_output(cmd, stderr=subprocess.STDOUT)
198197
return cairo_convert
199198
elif "gs" in tools_available:
200199
def gs_convert(pdffile, pngfile, dpi):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.