Christian Heimes <li...@cheimes.de> added the comment:

errno 6 is ENXIO. According to 
https://www.man7.org/linux/man-pages/man3/getlogin.3.html the error code means 
"The calling process has no controlling terminal.".

os.getlogin() returns the name of the user logged in on the controlling 
terminal of the process. Typically processes in user session (tty, X session) 
have a controlling terminal. Processes spawned by a service manager like init, 
systemd, or upstart usually do not have a controlling terminal. You have to get 
the user information by other means. Our documentation for os.getlogin() 
recommends getpass.getuser().

----------
resolution:  -> not a bug
status: open -> pending

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40821>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to