gh-117174: Add a new route in linecache to fetch interactive source code (GH-117500)
(cherry picked from commit a931a8b324)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
The source line was not displayed if the warnings module had not yet
been imported.
(cherry picked from commit 100c7ab00a)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Such C API functions as PyErr_SetString(), PyErr_Format(),
PyErr_SetFromErrnoWithFilename() and many others no longer crash or
ignore errors if it failed to format the error message or decode the
filename. Instead, they keep a corresponding error.