diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index c537166ea..1d48467d1 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -355,6 +355,10 @@ def sendfile(self, respiter): try: fileno = respiter.filelike.fileno() + except AttributeError: + return False + + try: offset = os.lseek(fileno, 0, os.SEEK_CUR) if self.response_length is None: filesize = os.fstat(fileno).st_size