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 terry.reedy
Recipients gvanrossum, terry.reedy
Date 2019-05-06.07:23:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557127438.79.0.0144008416965.issue36807@roundup.psfhosted.org>
In-reply-to
Content
OS and disk interaction is not something I know a lot about.  I don't know how long different OSes take to write things out by themselves, and therefore how much real danger there is of loosing data.  However, IDLE is used in places where power is less reliable than it is for me, and if not doing this makes IDLE look bad, and if it does not noticeably delay running a file (and I expect not), then it seems like a good idea.

Digging further, Kurt Kaiser added f.flush in 3/19/2006.  On 2013-08-04, for #18151, Serhiy submitted a patch for 3.3 with the comment "Here is a patch which replace the "open ... close" idiom to the "with open" idiom in IDLE."  It replaced
            f = open(filename, "wb")
            f.write(chars)
            f.flush()
            f.close()
with
            with open(filename, "wb") as f:
                f.write(chars)

I have no idea why f.flush was deleted.  An oversight?  There is no discussion on the issue. I merged Serhiy's patch and backported to 2.7.
History
Date User Action Args
2019-05-06 07:23:58terry.reedysetrecipients: + terry.reedy, gvanrossum
2019-05-06 07:23:58terry.reedysetmessageid: <1557127438.79.0.0144008416965.issue36807@roundup.psfhosted.org>
2019-05-06 07:23:58terry.reedylinkissue36807 messages
2019-05-06 07:23:58terry.reedycreate