summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Evrard <nicoe@openhex.org>2022-11-17 09:47:39 +0100
committerRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>2023-03-17 16:31:42 +0100
commit509104eaff6f6ecde656c20fdd65a0b98b371c8d (patch)
treebcef21857f48972090ae9a27aa2cc0711cb69bbd
parent6fba62a3ad947b656bb4379f8f903e90c7b01346 (diff)
downloaduwsgi-2.0.tar.gz
plugins/python: Use "backslashreplace" on stderr initializationuwsgi-2.0
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 56c8781b..04cfdb51 100644
--- a/plugins/python/python_plugin.c
+++ b/plugins/python/python_plugin.c
@@ -554,7 +554,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);