David W. Lambert <[email protected]> added the comment:
#OOPS! I forgot the subtlety.
#I must also retain the stream
#else it gets collected.
#Nasty.
import io
class file(io.TextIOWrapper):
'''condensing code for this list without test is a no no!'''
def __init__(self,name):
self.stream = open(name) # SAVE THE STREAM!
super().__init__(self.stream.buffer)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue5513>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com