From 8e678c6d3b7421f62e109973c169a91f6ddb9e9b Mon Sep 17 00:00:00 2001 From: Joseph Date: Thu, 26 Nov 2015 12:39:31 -0800 Subject: Update utils.py --- wkhtmltopdf/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index f9d7ac1..772be9b 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -94,10 +94,11 @@ def wkhtmltopdf(pages, output=None, **kwargs): list(pages), [output])) ck_kwargs = {'env': env} + # Handling of fileno() attr. based on https://github.com/GrahamDumpleton/mod_wsgi/issues/85 try: i = sys.stderr.fileno() ck_kwargs['stderr'] = sys.stderr - except AttributeError: + except AttributeError, IOError: # can't call fileno() on mod_wsgi stderr object pass -- cgit v1.2.3 From 09eaeef0ae73bbc57b2faebb7c402e4dec45e0e3 Mon Sep 17 00:00:00 2001 From: Joseph Date: Thu, 26 Nov 2015 12:59:46 -0800 Subject: Update utils.py --- wkhtmltopdf/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index 772be9b..b5df681 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -98,7 +98,7 @@ def wkhtmltopdf(pages, output=None, **kwargs): try: i = sys.stderr.fileno() ck_kwargs['stderr'] = sys.stderr - except AttributeError, IOError: + except (AttributeError, IOError): # can't call fileno() on mod_wsgi stderr object pass -- cgit v1.2.3