def get_path_uid(path):<EOL>
if hasattr(os, '<STR_LIT>'):<EOL><INDENT>fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW)<EOL>file_uid = os.fstat(fd).st_uid<EOL>os.close(fd)<EOL><DEDENT>else:  <EOL><INDENT>if not os.path.islink(path):<EOL><INDENT>file_uid = os.stat(path).st_uid<EOL><DEDENT>else:<EOL><INDENT>raise OSError(<EOL>"<STR_LIT>" % path<EOL>)<EOL><DEDENT><DEDENT>return file_uid<EOL>
Return path's uid.

Does not follow symlinks:
    https://github.com/pypa/pip/pull/935#discussion_r5307003

Placed this function in compat due to differences on AIX and
Jython, that should eventually go away.

:raises OSError: When path is a symlink or can't be read.