From a0ff5b91b8229f3794c50e00c21c5e746c4567fe Mon Sep 17 00:00:00 2001 From: Unbit Date: Sun, 5 Jan 2014 09:08:29 +0100 Subject: [PATCH] cast non-bytes arguments to bytes in python3 spool api --- plugins/python/uwsgi_pymodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index 8906f7f5..87bd2216 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -1805,7 +1805,11 @@ PyObject *py_uwsgi_send_spool(PyObject * self, PyObject * args, PyObject *kw) { } } else { +#ifdef PYTHREE + PyObject *str = PyObject_Bytes(val); +#else PyObject *str = PyObject_Str(val); +#endif if (!str) { Py_DECREF(zero); uwsgi_buffer_destroy(ub);