From 81c97a81cc8a36fa14f10142163954bf59fb06f0 Mon Sep 17 00:00:00 2001 From: Wouter Bolsterlee Date: Thu, 31 Dec 2015 15:03:14 +0100 Subject: [PATCH] Catch io.UnsupportedOperation exception for io.BytesIO.fileno() Closes #1174. --- gunicorn/http/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index 1d48467d1..b85762589 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -355,7 +355,7 @@ def sendfile(self, respiter): try: fileno = respiter.filelike.fileno() - except AttributeError: + except (AttributeError, io.UnsupportedOperation): return False try: