Skip to content

getpass.getuser may fail #67

Description

@Alex663

getpass.getuser fails when called from containers and returns the following error.

  File ""/.pyenv/versions/python39_loaded/lib/python3.9/site-packages/nzpy/core.py"", line 1530, in __init__
    hs = handshake.Handshake(self._usock, self._sock, ssl, self.log)
  File ""/.pyenv/versions/python39_loaded/lib/python3.9/site-packages/nzpy/handshake.py"", line 76, in __init__
    self.guardium_clientOSUser = getuser()
  File ""/.pyenv/versions/3.9.10/lib/python3.9/getpass.py"", line 169, in getuser
    return pwd.getpwuid(os.getuid())[0]
KeyError: 'getpwuid(): uid not found: 10000'"

A similar issue was noted in a package called ansible and was resolved in ansible/ansible#68007

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions