[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Here's an alternative patch which simply calls PyObject_Str on the value of the exception. It also has a test. Added file: http://bugs.python.org/file12087/use_PyObject_Str_and_test.patch ___ Python tra

[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Giuseppe Ottaviano
Giuseppe Ottaviano <[EMAIL PROTECTED]> added the comment: @amaury: Yes, this is exactly what I noticed. I didn't know how to create an instance of a PyUnicodeErrorObject. BTW, isn't PyErr_SetString used throughout the code? Should all those calls replaced with PyErr_SetObject? @benjamin: The b

[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: I think I got the point: to decode strings like "\N{CHARACTER NAME}" PyUnicode_DecodeUnicodeEscape imports the unicodedata module. If this fails, PyErr_SetString(PyExc_UnicodeError, "some message") is called. The exception will eventual

[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Can you provide the code that caused the seg fault? -- nosy: +benjamin.peterson priority: -> high ___ Python tracker <[EMAIL PROTECTED]> _

[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Giuseppe Ottaviano
New submission from Giuseppe Ottaviano <[EMAIL PROTECTED]>: Hi all, trying to compile Python 2.6 I got a segmentation fault while byte-compiling the modules. The segmentation fault happened in ast_for_atom, parsing an Unicode entity. I found out that another problem prevented unicodedata to be