I think this is the clearest way of getting a file's the permission bits:
stat.S_IMODE(os.lstat("file").st_mode)
The os.lstat function, will in case the file is a symlink, give you the mode of the link itself, whereas os.stat dereferences the link. Therefore I find os.lstat the most generally useful.
Here's an example case, given regular file "testfile" and symlink to the latter, "testlink":
import stat
import os
print oct(stat.S_IMODE(os.lstat("testlink").st_mode))
print oct(stat.S_IMODE(os.stat("testlink").st_mode))
This script outputs the following for me:
0777
0666