def get_path_uid(path):
 if hasattr(os, 'O_NOFOLLOW'):
  fd = os.open(path, (os.O_RDONLY | os.O_NOFOLLOW))
  file_uid = os.fstat(fd).st_uid
  os.close(fd)
 elif (not os.path.islink(path)):
  file_uid = os.stat(path).st_uid
 else:
  raise OSError(('%s is a symlink; Will not return uid for symlinks' % path))
 return file_uid

def get_path_uid ( path ) : if hasattr ( os , 'O_NOFOLLOW' ) : fd = os . open ( path , ( os . O_RDONLY | os . O_NOFOLLOW ) ) file_uid = os . fstat ( fd ) . st_uid os . close ( fd ) elif ( not os . path . islink ( path ) ) : file_uid = os . stat ( path ) . st_uid else : raise OSError ( ( '%s is a symlink; Will not return uid for symlinks' % path ) ) return file_uid
return paths uid .