summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Evrard <nicoe@openhex.org>2022-11-17 09:47:39 +0100
committerNicolas Evrard <nicoe@openhex.org>2022-11-17 09:47:39 +0100
commit835a395a5c1124fc931a261fd8c5c689d490b9c9 (patch)
tree6a943b480be075b9096907414043ca2619a98528
parentae489f0881fb358347aabc168a28a96672b0ce3c (diff)
downloaduwsgi-835a395a5c1124fc931a261fd8c5c689d490b9c9.tar.gz
plugins/python: Use "backslashreplace" on stderr initialization
Failing to use this value will result in enconding errors when logging unicode characters to stderr
-rw-r--r--plugins/python/python_plugin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c
index fbc85c22..dcb5d348 100644
--- a/plugins/python/python_plugin.c
+++ b/plugins/python/python_plugin.c
@@ -591,7 +591,7 @@ void init_uwsgi_vars() {
#ifdef HAS_NO_ERRORS_IN_PyFile_FromFd
PyObject *new_stdprint = PyFile_FromFd(2, NULL, "w", _IOLBF, NULL, NULL, 0);
#else
- PyObject *new_stdprint = PyFile_FromFd(2, NULL, "w", _IOLBF, NULL, NULL, NULL, 0);
+ PyObject *new_stdprint = PyFile_FromFd(2, NULL, "w", _IOLBF, NULL, "backslashreplace", NULL, 0);
#endif
PyDict_SetItemString(pysys_dict, "stdout", new_stdprint);
PyDict_SetItemString(pysys_dict, "__stdout__", new_stdprint);