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 serhiy.storchaka
Recipients bquinlan, pitrou, serhiy.storchaka, terry.reedy
Date 2014-10-12.13:55:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413122115.52.0.65064623459.issue5700@psf.upfronthosting.co.za>
In-reply-to
Content
Yet one related bug is that flush() isn't called at all if the file was opened with closefd=False.

>>> import io, os
>>> class MyIO(io.FileIO):
...     def flush(self):
...         print('closed:', self.closed)
... 
>>> fd = os.open('test.out', os.O_WRONLY|os.O_CREAT)
>>> f = MyIO(fd, 'wb', closefd=False)
>>> f.close()

The proposed simple patch fixes both bugs.
History
Date User Action Args
2014-10-12 13:55:15serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, bquinlan, pitrou
2014-10-12 13:55:15serhiy.storchakasetmessageid: <1413122115.52.0.65064623459.issue5700@psf.upfronthosting.co.za>
2014-10-12 13:55:15serhiy.storchakalinkissue5700 messages
2014-10-12 13:55:15serhiy.storchakacreate