mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-05 13:11:33 +00:00
fixed latin1 encoding with python3
This commit is contained in:
@@ -819,7 +819,7 @@ PyObject *py_uwsgi_advanced_sendfile(PyObject * self, PyObject * args) {
|
||||
}
|
||||
#ifdef PYTHREE
|
||||
else if (PyUnicode_Check(what)) {
|
||||
filename = PyBytes_AsString(PyUnicode_AsASCIIString(what));
|
||||
filename = PyBytes_AsString(PyUnicode_AsLatin1String(what));
|
||||
|
||||
fd = open(filename, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
|
||||
@@ -61,7 +61,7 @@ PyObject *py_uwsgi_spit(PyObject * self, PyObject * args) {
|
||||
PyObject *zero = NULL;
|
||||
PyObject *zero2 = NULL;
|
||||
if (self != Py_None) {
|
||||
zero = PyUnicode_AsASCIIString(head);
|
||||
zero = PyUnicode_AsLatin1String(head);
|
||||
if (!zero) {
|
||||
return PyErr_Format(PyExc_TypeError, "http status string must be encodable in latin1");
|
||||
}
|
||||
@@ -135,7 +135,7 @@ PyObject *py_uwsgi_spit(PyObject * self, PyObject * args) {
|
||||
|
||||
#ifdef PYTHREE
|
||||
if (self != Py_None) {
|
||||
zero = PyUnicode_AsASCIIString(h_key);
|
||||
zero = PyUnicode_AsLatin1String(h_key);
|
||||
if (!zero) {
|
||||
return PyErr_Format(PyExc_TypeError, "http header must be encodable in latin1");
|
||||
}
|
||||
@@ -153,7 +153,7 @@ PyObject *py_uwsgi_spit(PyObject * self, PyObject * args) {
|
||||
|
||||
#ifdef PYTHREE
|
||||
if (self != Py_None) {
|
||||
zero2 = PyUnicode_AsASCIIString(h_value);
|
||||
zero2 = PyUnicode_AsLatin1String(h_value);
|
||||
if (!zero2) {
|
||||
return PyErr_Format(PyExc_TypeError, "http header must be encodable in latin1");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user