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 neologix
Recipients amaury.forgeotdarc, neologix, pitrou, vsemionov
Date 2011-09-30.20:35:43
SpamBayes Score 1.0629175e-05
Marked as misclassified No
Message-id <1317414944.52.0.8614325043.issue13070@psf.upfronthosting.co.za>
In-reply-to
Content
Confirmed with default.
The problem is that the TextIOWrapper gets collected after the underlying BufferedRWPair has been cleared (tp_clear) by the garbage collector: when _PyIOBase_finalize() is called for the TextIOWrapper, it checks if the textio is closed, which indirectly checks if the underlying rwpair is closed:
"""
static PyObject *
bufferedrwpair_closed_get(rwpair *self, void *context)
{
    return PyObject_GetAttr((PyObject *) self->writer, _PyIO_str_closed);
}
"""

Since self->writer has already been set to NULL by bufferedrwpair_clear(), PyObject_GetAttr() segfaults.

@Victor
Could you try the patch attached?
History
Date User Action Args
2011-09-30 20:35:44neologixsetrecipients: + neologix, amaury.forgeotdarc, pitrou, vsemionov
2011-09-30 20:35:44neologixsetmessageid: <1317414944.52.0.8614325043.issue13070@psf.upfronthosting.co.za>
2011-09-30 20:35:43neologixlinkissue13070 messages
2011-09-30 20:35:43neologixcreate