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.

classification
Title: os.stat('foo') succeds if 'foo.exe' exists on cygwin
Type: behavior Stage:
Components: Windows Versions: 3rd party
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: LambertDW, calandoa, loewis
Priority: normal Keywords:

Created on 2009-02-05 15:02 by calandoa, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg81214 - (view) Author: Antoine Calando (calandoa) Date: 2009-02-05 15:01
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.
msg81225 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-02-05 20:24
Why do you think this is a bug in Python? It sounds like a bug in Cygwin
to me?

Python delegates to the C library as-is, with not attempt to
second-guessing the C library. So if the C library says "file" exists,
then this is also what Python must tell you.

Closing as third-party bug.
msg81257 - (view) Author: Antoine Calando (calandoa) Date: 2009-02-06 10:21
Hi Martin,

Actually, I just investigated the problem in the libs and did not
check the python exe source code.

I guess you are right, this looks more like an issue from cygwin.

I was a bit irritated by hours of debugging when entering the bug, 
and also tired of thinking it seems :)

Regards,

Antoine

----- Martin v. Löwis <report@bugs.python.org> a écrit :
> 
> Martin v. Löwis <martin@v.loewis.de> added the comment:
> 
> Why do you think this is a bug in Python? It sounds like a bug in Cygwin
> to me?
> 
> Python delegates to the C library as-is, with not attempt to
> second-guessing the C library. So if the C library says "file" exists,
> then this is also what Python must tell you.
> 
> Closing as third-party bug.
> 
> ----------
> nosy: +loewis
> resolution:  -> invalid
> status: open -> closed
> versions: +3rd party -Python 2.5
> 
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue5157>
> _______________________________________
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49407
2009-02-06 10:21:36calandoasetmessages: + msg81257
2009-02-05 20:24:54loewissetstatus: open -> closed
nosy: + loewis
resolution: not a bug
messages: + msg81225
versions: + 3rd party, - Python 2.5
2009-02-05 19:18:11LambertDWsetnosy: + LambertDW
2009-02-05 15:02:00calandoacreate