[issue10391] obj2ast's error handling can lead to python crashing with a C-level assertion failure

2010-11-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: r86538 -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-li

[issue10391] obj2ast's error handling can lead to python crashing with a C-level assertion failure

2010-11-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: IMO a better patch would be to use the %R format specification: PyErr_Format( PyExc_TypeError, "expected some sort of mod, but got %R", obj); And no need to use PyObject_Repr and the temporary variable! -- nosy: +amaury.forgeotdarc __

[issue10391] obj2ast's error handling can lead to python crashing with a C-level assertion failure

2010-11-11 Thread Dave Malcolm
Changes by Dave Malcolm : -- nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan ___ Python tracker ___ ___ Python-bugs-lis

[issue10391] obj2ast's error handling can lead to python crashing with a C-level assertion failure

2010-11-11 Thread Dave Malcolm
Dave Malcolm added the comment: The attached patch: - extends the ast error-handling selftest with code that triggers this crash (on unpatched code) - fixes Parser/asdl_c.py to generate code using _PyUnicode_AS_STRING instead - contains the generated changes to Python/Python-ast.c FWIW,

[issue10391] obj2ast's error handling can lead to python crashing with a C-level assertion failure

2010-11-11 Thread Dave Malcolm
New submission from Dave Malcolm : In various places within the generated Python/Python-ast.c, error handling generates a repr() and raises exceptions accordingly. Currently in py3k the generated code uses PyBytes_AS_STRING() on the repr. My understanding is that repr() should be a PyUnicodeO