➜

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.

作者 dmalcolm
收信人 dmalcolm
日期 2010-11-11.20:53:41
SpamBayes Score 6.594217e-09
Marked as misclassified 否
Message-id <1289508823.86.0.760663346752.issue10391@psf.upfronthosting.co.za>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2010-11-11 20:53:43dmalcolm修改recipients: + dmalcolm
2010-11-11 20:53:43dmalcolm修改messageid: <1289508823.86.0.760663346752.issue10391@psf.upfronthosting.co.za>
2010-11-11 20:53:42dmalcolm链接issue10391 messages
2010-11-11 20:53:41dmalcolm创建