From 688d3fff8c9a285995774007cd0fae13a92068d2 Mon Sep 17 00:00:00 2001 From: Unbit Date: Fri, 23 Aug 2013 14:51:18 +0200 Subject: [PATCH] fixed python3 static files handling --- plugins/python/wsgi_handlers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index d958daac..8db893fd 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -588,6 +588,9 @@ PyObject *py_uwsgi_sendfile(PyObject * self, PyObject * args) { #ifdef PYTHREE wsgi_req->sendfile_fd = PyObject_AsFileDescriptor(wsgi_req->async_sendfile); + if (wsgi_req->sendfile_fd >= 0) { + Py_INCREF((PyObject *)wsgi_req->async_sendfile); + } #else if (PyFile_Check((PyObject *)wsgi_req->async_sendfile)) { Py_INCREF((PyObject *)wsgi_req->async_sendfile);