Message 85521 - Python tracker (original) (raw)
import io class MyIO(io.FileIO): ... def flush(self): ... print('closed:', self.closed) ... f = MyIO('test.out', 'wb') f.close() closed: True
IMHO, calling flush() after the file has already been closed is incorrect behaviour. Search for "Possible py3k io wierdness" on python-dev for discussion.