[New-bugs-announce] [issue35650] cygwin treats X and X.exe as the same file

Anthony Sottile report at bugs.python.org
Thu Jan 3 11:53:56 EST 2019

New submission from Anthony Sottile <asottile at umich.edu>:

>>> with open('f.exe', 'w') as f:
...     f.write('hi')
>>> with open('f') as f:
...     print(f.read())

`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`)

components: Windows
messages: 332935
nosy: Anthony Sottile, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: cygwin treats X and X.exe as the same file
type: behavior
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list