seperating streams from there underlying buffer

Currently, If you want write/read binary from a stream you are using TextIOWrapper with you must keep the TextIOWrapper alive otherwise, it will close the underlying buffer. I think we should provide a disconnect() method for BufferedIOBase and TextIOBase that removes from the wrapper and returns raw stream or buffer respectively.

On Tue, Apr 14, 2009 at 5:08 PM, Benjamin Peterson <benjamin@python.org>wrote:
I'd rather that wrapper objects not close the underlying object when garbage collected. Better to let the underlying object close itself when garbage collected. An explicit call to close() should still work, of course. Basically, move the __del__ from IOBase to RawIOBase. Maybe it's too late to make that change, though. :-( -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>

On Tue, Apr 14, 2009 at 5:08 PM, Benjamin Peterson <benjamin@python.org>wrote:
I'd rather that wrapper objects not close the underlying object when garbage collected. Better to let the underlying object close itself when garbage collected. An explicit call to close() should still work, of course. Basically, move the __del__ from IOBase to RawIOBase. Maybe it's too late to make that change, though. :-( -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
participants (3)
-
Antoine Pitrou
-
Benjamin Peterson
-
Daniel Stutzbach