[New-bugs-announce] [issue5157] os.stat('foo') succeds if 'foo.exe' exists on cygwin

Antoine Calando report at bugs.python.org
Thu Feb 5 16:02:02 CET 2009


New submission from Antoine Calando <acalando at free.fr>:

On cygwin platform, with python cygwin package:
Python 2.5.2 (r252:60911, Dec  2 2008, 09:26:14)

When doing an os.stat('file') in a directory where no 'file' exists
but a 'file.exe' do, the function return a stat object, as if the call 
was done on os.stat('file.exe').

After a few investigations, the problem come from the posix builtin 
library used by python-cygwin.

I guess this is a workaround to have some calls like os.stat('/bin/ls') 
not failing, but is a dirty workaround. 'file' and 'file.exe' are two 
different files whatever the system you are on.

This problem was found due to a strange behaviour from scons.

I also check with other functions like os.lstat() and os.access() and 
it is the same problem.

----------
components: Windows
messages: 81214
nosy: calandoa
severity: normal
status: open
title: os.stat('foo') succeds if 'foo.exe' exists on cygwin
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5157>
_______________________________________


More information about the New-bugs-announce mailing list