Bug report
Bug description:
The message must be prefixed by a whitespace since _Py_CheckRecursiveCall directly appends them to "maximum recursion depth exceeded":
|
if (tstate->c_recursion_remaining <= 0) { |
|
tstate->recursion_headroom++; |
|
_PyErr_Format(tstate, PyExc_RecursionError, |
|
"maximum recursion depth exceeded%s", |
|
where); |
|
tstate->recursion_headroom--; |
|
++tstate->c_recursion_remaining; |
.
Alternatively, we could make it so that a whitespace is automatically added and strip leading whitespaces if the "where" is the empty string (we wouldn't strip whitespaces in custom messages though I think).
For now, I'll just add the missing whitespaces where it should be.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
The message must be prefixed by a whitespace since
_Py_CheckRecursiveCalldirectly appends them to "maximum recursion depth exceeded":cpython/Python/ceval.c
Lines 329 to 335 in dc76a4a
Alternatively, we could make it so that a whitespace is automatically added and strip leading whitespaces if the "where" is the empty string (we wouldn't strip whitespaces in custom messages though I think).
For now, I'll just add the missing whitespaces where it should be.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
*Py_EnterRecursiveCallmessages #126036