diff options
author | James Turnbull <james@incuna.com> | 2015-07-31 16:42:59 +0100 |
---|---|---|
committer | James Turnbull <james@incuna.com> | 2015-07-31 16:42:59 +0100 |
commit | c98062dcfea8c51eaca96a69facb49268bf7aaa4 (patch) | |
tree | 93d4152cffe63692cf8f5738683347f7c70b8603 | |
parent | d24325f4a9ba19733ecfbb83d19f4553b9e3fb38 (diff) | |
parent | 797b909847a950fa8617461824af1602323c2985 (diff) | |
download | django-wkhtmltopdf-c98062dcfea8c51eaca96a69facb49268bf7aaa4.tar.gz django-wkhtmltopdf-c98062dcfea8c51eaca96a69facb49268bf7aaa4.tar.bz2 django-wkhtmltopdf-c98062dcfea8c51eaca96a69facb49268bf7aaa4.zip |
Merge pull request #83 from DeadWisdom/master
WKHTMLTOPDF_CMD needs to be properly split by the shlex module
-rw-r--r-- | wkhtmltopdf/utils.py | 3 |
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])) |