Skip to content

Fix #269 #270

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pdfkit/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ def __init__(self, wkhtmltopdf='', meta_tag_prefix='pdfkit-', environ=''):
self.wkhtmltopdf = subprocess.Popen(
['where.exe', 'wkhtmltopdf'], stdout=subprocess.PIPE, startupinfo=startupinfo).communicate()[0]
else:
try:
subprocess.Popen(
['which'], stdout=subprocess.PIPE).communicate()[0]
except (IOError, FileNotFoundError) as e:
raise IOError('No which executable found. '
'If this file exists please check that this process can '
'read it or you can pass path to it manually in method call, '
'check README. Otherwise please install which - '
'https://github.com/JazzCore/python-pdfkit/wiki/Installing-which')
self.wkhtmltopdf = subprocess.Popen(
['which', 'wkhtmltopdf'], stdout=subprocess.PIPE).communicate()[0]

Expand Down