From c0d5a14241720468a297add29e6fabaea3b8f3ab Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 21 Feb 2017 21:11:36 -0500 Subject: [PATCH] pgf: Fix invalid arguments passed to pdftocairo. This breaks saving PNG when using the PGF backend. Fixes #8121. --- lib/matplotlib/backends/backend_pgf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 8f5e7094b17c..682724a74ba7 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -191,10 +191,9 @@ def make_pdf_to_png_converter(): # pick converter if "pdftocairo" in tools_available: def cairo_convert(pdffile, pngfile, dpi): - cmd = [str("pdftocairo"), "-singlefile", "-png", - "-r %d" % dpi, pdffile, os.path.splitext(pngfile)[0]] - # for some reason this doesn't work without shell - check_output(cmd, shell=True, stderr=subprocess.STDOUT) + cmd = [str("pdftocairo"), "-singlefile", "-png", "-r", "%d" % dpi, + pdffile, os.path.splitext(pngfile)[0]] + check_output(cmd, stderr=subprocess.STDOUT) return cairo_convert elif "gs" in tools_available: def gs_convert(pdffile, pngfile, dpi):