8000 gh-91924: Fix __lltrace__ for non-UTF-8 stdout encoding (#93199) · python/cpython@5695c0e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5695c0e

Browse files
authored
gh-91924: Fix __lltrace__ for non-UTF-8 stdout encoding (#93199)
Fix __lltrace__ 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().
1 parent 1971014 commit 5695c0e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ``__lltrace__`` debug feature if the stdout encoding is not UTF-8. Patch
2+
by Victor Stinner.

Python/ceval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ static PyObject * do_call_core(
107107
PyObject *callargs, PyObject *kwdict, int use_tracing);
108108

109109
#ifdef LLTRACE
110-
static int lltrace;
111110
static void
112111
dump_stack(_PyInterpreterFrame *frame, PyObject **stack_pointer)
113112
{
@@ -1715,6 +1714,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
17151714
uint8_t opcode; /* Current opcode */
17161715
int oparg; /* Current opcode argument, if any */
17171716
_Py_atomic_int * const eval_breaker = &tstate->interp->ceval.eval_breaker;
1717+
#ifdef LLTRACE
1718+
int lltrace = 0;
1719+
#endif
17181720

17191721
_PyCFrame cframe;
17201722
CallShape call_shape;

0 commit comments

Comments
 (0)
0