Hello,

I would like to call to your attention the following behavior of TextIOWrapper:

   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.

-- Alexandre
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to