mirror of
https://github.com/python/cpython.git
synced 2026-02-13 19:04:37 +00:00
[3.10] gh-91924: Fix __ltrace__ for non-UTF-8 stdout encoding (#93214)
Fix __ltrace__ debug feature if the stdout encoding is not UTF-8. If the stdout encoding is not UTF-8, the first call to lltrace_resume_frame() indirectly sets lltrace to 0 when calling unicode_check_encoding_errors() which calls encodings.search_function(). Add test_lltrace.test_lltrace() test.
This commit is contained in:
parent
02d35fc4ef
commit
9369942054
3 changed files with 73 additions and 2 deletions
|
|
@ -5377,6 +5377,8 @@ prtrace(PyThreadState *tstate, PyObject *v, const char *str)
|
|||
}
|
||||
printf("\n");
|
||||
PyErr_Restore(type, value, traceback);
|
||||
// gh-91924: PyObject_Print() can indirectly set lltrace to 0
|
||||
lltrace = 1;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue