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 bskinn
Recipients bskinn, docs@python
Date 2019-07-29.03:34:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564371298.05.0.400100937454.issue37699@roundup.psfhosted.org>
In-reply-to
Content
Once the underlying buffer/stream is .detach()ed from an instance of a subclass of TextIOBase or BufferedIOBase, accession of most attributes defined on TextIOBase/BufferedIOBase or the IOBase parent, as well as calling of most methods defined on TextIOBase/BufferedIOBase/IOBase, results in raising of a ValueError.

Currently, the documentation of both .detach() methods states simply:

> After the raw stream has been detached, the buffer is in an unusable state.

I propose augmenting the above to something like the following in the docs for both .detach() methods, to make this behavior more explicit:

> After the raw stream has been detached, the buffer
> is in an unusable state. As a result, accessing/calling most
> attributes/methods of either :class:`BufferedIOBase` or its
> :class:`IOBase` parent will raise :exc:`ValueError`.

I confirm that the error raised for both `BufferedReader` and `TextIOWrapper` after `.detach()` *is* ValueError in all of 3.5.7, 3.6.8, 3.7.3, and 3.8.0b1.
History
Date User Action Args
2019-07-29 03:34:58bskinnsetrecipients: + bskinn, docs@python
2019-07-29 03:34:58bskinnsetmessageid: <1564371298.05.0.400100937454.issue37699@roundup.psfhosted.org>
2019-07-29 03:34:57bskinnlinkissue37699 messages
2019-07-29 03:34:57bskinncreate