--- Python-2.6/Python/ast.c 2008-08-19 19:52:46.000000000 +0000 +++ Python-2.6-patched/Python/ast.c 2008-11-20 16:59:41.000000000 +0000 @@ -1287,7 +1287,7 @@ if (PyErr_ExceptionMatches(PyExc_UnicodeError)){ PyObject *type, *value, *tback, *errstr; PyErr_Fetch(&type, &value, &tback); - errstr = ((PyUnicodeErrorObject *)value)->reason; + errstr = value; if (errstr) { char *s = ""; char buf[128];