(self)
The name of the user that owns the process.
        On UNIX this is calculated by using *real* process uid.
The name of the user that owns the process.
        On UNIX this is calculated by using *real* process uid.
The name of the user that owns the process . On UNIX this is calculated by using * real * process uid .
def username(self):
        """The name of the user that owns the process.
        On UNIX this is calculated by using *real* process uid.
        """
        if _POSIX:
            if pwd is None:
                # might happen if python was installed from sources
                raise ImportError(
                    "requires pwd module shipped with standard python")
            real_uid = self.uids().real
            try:
                return pwd.getpwuid(real_uid).pw_name
            except KeyError:
                # the uid can't be resolved by the system
                return str(real_uid)
        else:
            return self._proc.username()
def username ( self ) : if _POSIX : if pwd is None : # might happen if python was installed from sources raise ImportError ( "requires pwd module shipped with standard python" ) real_uid = self . uids ( ) . real try : return pwd . getpwuid ( real_uid ) . pw_name except KeyError : # the uid can't be resolved by the system return str ( real_uid ) else : return self . _proc . username ( )