Message144744
> 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. |
|
Date |
User |
Action |
Args |
2011-10-01 17:47:03 | neologix | set | recipients:
+ neologix, amaury.forgeotdarc, pitrou, vsemionov |
2011-10-01 17:47:03 | neologix | set | messageid: <1317491223.79.0.275640510789.issue13070@psf.upfronthosting.co.za> |
2011-10-01 17:47:03 | neologix | link | issue13070 messages |
2011-10-01 17:47:02 | neologix | create | |
|