https://docs.python.org/2/library/pwd.html#pwd.getpwuid

Should be pwd.getpwuid(uid)[0]