Skip to content

set-feed-rev: Fix getting user info when running in docker

os.getlogin() throws an exception once called from docker: user = os.getlogin() OSError: [Errno 6] No such device or address

This is due to missing uid in /proc/self/loginuid that is common for docker.

It is better to use getpass.getuser() in this case as this checks for the environment variables LOGNAME, USER, LNAME and USERNAME. To make use of it one of those envs needs to be passed to docker.

Merge request reports