Issue 10958: stat.S_ISLNK() does not wok! (original) (raw)

Issue10958

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:11 admin set github: 55167
2011-01-20 17:10:34 amaury.forgeotdarc set status: open -> closednosy: + amaury.forgeotdarcmessages: + resolution: not a bug
2011-01-20 16:59:59 socketpair create