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: stat.S_ISLNK() does not wok!
Type: behavior Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, socketpair
Priority: normal Keywords:

Created on 2011-01-20 16:59 by socketpair, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg126628 - (view) Author: Марк Коренберг (socketpair) * Date: 2011-01-20 16:59
ipython session:

In [48]: qwe=os.stat('/usr/lib/libstdc++.so.6')
In [49]: qwe.st_mode
Out[49]: 33188
In [50]: stat.S_ISLNK(qwe.st_mode)
Out[50]: False
In [51]: stat.S_IFLNK & qwe.st_mode
Out[51]: 32768

'/usr/lib/libstdc++.so.6' is really symlink !!!

python in ubuntu 10.10 and RHEL 6.0. All the same.
msg126630 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-01-20 17:10
os.stat() follows symbolic links. You probably want to use os.lstat() instead: http://docs.python.org/library/os.html#os.lstat
History
Date User Action Args
2022-04-11 14:57:11adminsetgithub: 55167
2011-01-20 17:10:34amaury.forgeotdarcsetstatus: open -> closed

nosy: + amaury.forgeotdarc
messages: + msg126630

resolution: not a bug
2011-01-20 16:59:59socketpaircreate