aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrantley Harris <deadwisdom@gmail.com>2015-06-22 16:09:30 -0500
committerBrantley Harris <deadwisdom@gmail.com>2015-06-22 16:09:30 -0500
commit797b909847a950fa8617461824af1602323c2985 (patch)
tree077e9f820a8ebae16657bf32751015b6eef7623e
parente354459621f417195a96ca87ccf4ac42ef844aa4 (diff)
downloaddjango-wkhtmltopdf-797b909847a950fa8617461824af1602323c2985.tar.gz
django-wkhtmltopdf-797b909847a950fa8617461824af1602323c2985.tar.bz2
django-wkhtmltopdf-797b909847a950fa8617461824af1602323c2985.zip
WKHTMLTOPDF_CMD is properly split by the shlex module split() which properly accounts for quotes and escapes.
-rw-r--r--wkhtmltopdf/utils.py3
1 files changed, 2 insertions, 1 deletions
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]))