Romulo A. Ceccon added the comment:
I've made some further investigation on this issue. Here's the output and the
stack trace using --with-pydebug (and the attached patch applied):
run no. 0
[8766 refs]
free_list[0]->ob_refcnt before XDECREF: 2
run no. 1
New submission from Romulo A. Ceccon:
I have patched (see attachment) Python 2.7.4 (as available for download at
python.org/download) to disable initialization of Unicode (an embeded system
requirement) and now it segfaults with the following program:
#include
int main(int argc
Romulo A. Ceccon added the comment:
> I think WindowsError's message should be English like other errors.
> FormatMessageW() function can take dwLanguageId parameter.
> So I think Python should pass `MAKELANGID(LANG_ENGLISH,
> SUBLANG_ENGLISH_US)` to the parameter.
On a n
Romulo A. Ceccon added the comment:
"... but the error message must be converted to str early (i.e when
building the Exception)."
Wouldn't that create more problems? What if somebody wants to intercept
the exception and do something with it, like, say, redirect it to a log
file?
New submission from Romulo A. Ceccon:
The message for WindowsError is taken from the Windows API's
FormatMessage() function, following the OS language. Currently Python
does no conversion for those messages, so non-ASCII characters end up
improperly encoded in the console. For ex