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 alexandre.vassalotti
Recipients alexandre.vassalotti
Date 2009-06-29.00:49:51
SpamBayes Score 0.00014102022
Marked as misclassified No
Message-id <1246236592.97.0.944471121329.issue6361@psf.upfronthosting.co.za>
In-reply-to
Content
Here's an example of the behaviour:

import io

def test(buf):
   textio = io.TextIOWrapper(buf)

buf = io.BytesIO()
test(buf)
print(buf.closed)  # This prints True currently


The problem here is TextIOWrapper closes its buffer when deleted.
BufferedRWPair behalves similarly. The solution is simply to override
the __del__ method of TextIOWrapper inherited from IOBase.
History
Date User Action Args
2009-06-29 00:49:53alexandre.vassalottisetrecipients: + alexandre.vassalotti
2009-06-29 00:49:52alexandre.vassalottisetmessageid: <1246236592.97.0.944471121329.issue6361@psf.upfronthosting.co.za>
2009-06-29 00:49:51alexandre.vassalottilinkissue6361 messages
2009-06-29 00:49:51alexandre.vassalotticreate