From 797b909847a950fa8617461824af1602323c2985 Mon Sep 17 00:00:00 2001 From: Brantley Harris Date: Mon, 22 Jun 2015 16:09:30 -0500 Subject: WKHTMLTOPDF_CMD is properly split by the shlex module split() which properly accounts for quotes and escapes. --- wkhtmltopdf/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index 603d29a..40e1809 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -5,6 +5,7 @@ from itertools import chain import os import re import sys +import shlex try: from urllib.request import pathname2url @@ -88,7 +89,7 @@ def wkhtmltopdf(pages, output=None, **kwargs): cmd = 'WKHTMLTOPDF_CMD' cmd = getattr(settings, cmd, os.environ.get(cmd, 'wkhtmltopdf')) - ck_args = list(chain(cmd.split(), + ck_args = list(chain(shlex.split(cmd), _options_to_args(**options), list(pages), [output])) -- cgit v1.2.3