diff options
author | Brantley Harris <deadwisdom@gmail.com> | 2015-06-22 16:09:30 -0500 |
---|---|---|
committer | Brantley Harris <deadwisdom@gmail.com> | 2015-06-22 16:09:30 -0500 |
commit | 797b909847a950fa8617461824af1602323c2985 (patch) | |
tree | 077e9f820a8ebae16657bf32751015b6eef7623e /wkhtmltopdf/utils.py | |
parent | e354459621f417195a96ca87ccf4ac42ef844aa4 (diff) | |
download | django-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.
Diffstat (limited to 'wkhtmltopdf/utils.py')
-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])) |