From 4061826da49ba8dae8f75d27b38ff07756df5868 Mon Sep 17 00:00:00 2001 From: Unbit Date: Tue, 20 Aug 2013 07:32:41 +0200 Subject: [PATCH] try to fix 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 42dd213e..518ddfa9 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -468,6 +468,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);