summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>2022-11-23 19:52:03 +0100
committerGitHub <noreply@github.com>2022-11-23 19:52:03 +0100
commitb5069a6caf419207bb15a0c397e7a3b88bd9e5e5 (patch)
tree5f7587dc487d01d66b8535e5cc90df6b3917243c
parent8a8f03b0ce7ccb8508272406277f2ee7779ef588 (diff)
parent835a395a5c1124fc931a261fd8c5c689d490b9c9 (diff)
downloaduwsgi-b5069a6caf419207bb15a0c397e7a3b88bd9e5e5.tar.gz
Merge pull request #2510 from nicoe/python3_stdout_errors
plugins/python: Use "backslashreplace" on stderr initialization
-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);