Amaury Forgeot d'Arc added the comment:
os.stat() follows symbolic links. You probably want to use os.lstat() instead:
http://docs.python.org/library/os.html#os.lstat
--
nosy: +amaury.forgeotdarc
resolution: -> invalid
status: open -> closed
___
Py
New submission from Марк Коренберг :
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