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-10-01.17:47:02
SpamBayes Score 2.3131608e-11
Marked as misclassified No
Message-id <1317491223.79.0.275640510789.issue13070@psf.upfronthosting.co.za>
In-reply-to
Content
> Shouldn't the test use "self.BufferedRWPair" instead of
> "io.BufferedRWPair"?

Yes.

> Also, is it ok to just return NULL or should the error state also be
> set?

Well, I'm not sure, that why I made you and Amaury noisy :-)
AFAICT, this is the only case where _check_closed can encounter a NULL self->writer. And this specific situation is not an error (nothing prevents the rwpair from being garbaged collected before the textio) ,and _PyIOBase_finalize() explicitely clears any error returned:
"""
    /* If `closed` doesn't exist or can't be evaluated as bool, then the
       object is probably in an unusable state, so ignore. */
    res = PyObject_GetAttr(self, _PyIO_str_closed);
    if (res == NULL)
        PyErr_Clear();
    else {
        closed = PyObject_IsTrue(res);
        Py_DECREF(res);
        if (closed == -1)
            PyErr_Clear();
    }
"""

Furthermore, I'm not sure about what kind of error would make sense here.
History
Date User Action Args
2011-10-01 17:47:03neologixsetrecipients: + neologix, amaury.forgeotdarc, pitrou, vsemionov
2011-10-01 17:47:03neologixsetmessageid: <1317491223.79.0.275640510789.issue13070@psf.upfronthosting.co.za>
2011-10-01 17:47:03neologixlinkissue13070 messages
2011-10-01 17:47:02neologixcreate