This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dmalcolm
Recipients dmalcolm
Date 2010-11-11.20:53:41
SpamBayes Score 6.594217e-09
Marked as misclassified No
Message-id <1289508823.86.0.760663346752.issue10391@psf.upfronthosting.co.za>
In-reply-to
Content
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 PyUnicodeObject, not a PyBytesObject.  This seems to be unchanged from r63682, which was a mass-change of PyString to PyBytes from 2 years ago.

This leads to a python crashing with an assertion failure:
test_compile_ast (__main__.TestSpecifics) ... python: Python/Python-ast.c:5835: obj2ast_expr: Assertion `((((((PyObject*)(tmp))->ob_type))->tp_flags & ((1L<<27))) != 0)' failed.

when invoking compile() on certain (malformed) trees of ast objects.
History
Date User Action Args
2010-11-11 20:53:43dmalcolmsetrecipients: + dmalcolm
2010-11-11 20:53:43dmalcolmsetmessageid: <1289508823.86.0.760663346752.issue10391@psf.upfronthosting.co.za>
2010-11-11 20:53:42dmalcolmlinkissue10391 messages
2010-11-11 20:53:41dmalcolmcreate