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 Anthony Sottile
Recipients Anthony Sottile, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-01-03.16:53:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1546534436.45.0.760844199857.issue35650@roundup.psfhosted.org>
In-reply-to
Content
>>> with open('f.exe', 'w') as f:
...     f.write('hi')
...
>>> with open('f') as f:
...     print(f.read())
...
hi


`os.path.exists(...)` and others treat them as the same file as well.  It seems the only reliable way to write both files is:

1. write to f.exe
2. write to f.bak
3. move f.bak to f (`os.rename`)
History
Date User Action Args
2019-01-03 16:53:58Anthony Sottilesetrecipients: + Anthony Sottile, paul.moore, tim.golden, zach.ware, steve.dower
2019-01-03 16:53:56Anthony Sottilesetmessageid: <1546534436.45.0.760844199857.issue35650@roundup.psfhosted.org>
2019-01-03 16:53:56Anthony Sottilelinkissue35650 messages
2019-01-03 16:53:56Anthony Sottilecreate