<div class="gmail_quote">On Tue, Apr 14, 2009 at 5:08 PM, Benjamin Peterson <span dir="ltr"><<a href="mailto:benjamin@python.org">benjamin@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Currently, If you want write/read binary from a stream you are using<br>
TextIOWrapper with you must keep the TextIOWrapper alive otherwise, it will<br>
close the underlying buffer. I think we should provide a disconnect() method for<br>
BufferedIOBase and TextIOBase that removes from the wrapper and returns raw<br>
stream or buffer respectively.<br>
</blockquote></div><br>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.<br>
<br>Basically, move the __del__ from IOBase to RawIOBase.  Maybe it's too late to make that change, though. :-(<br><blockquote style="margin: 1.5em 0pt;">--<br>
Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com">Stutzbach Enterprises, LLC</a>
</blockquote>