[New-bugs-announce] [issue32651] os.getlogin() should recommend getpass.getuser()

Barry A. Warsaw report at bugs.python.org
Wed Jan 24 10:37:19 EST 2018

New submission from Barry A. Warsaw <barry at python.org>:

The documentation for os.getlogin() says:

"Return the name of the user logged in on the controlling terminal of the process. For most purposes, it is more useful to use the environment variables LOGNAME or USERNAME to find out who the user is, or pwd.getpwuid(os.getuid())[0] to get the login name of the current real user id.

Availability: Unix, Windows."

Well, why not suggestion getpass.getuser() since that's exactly how the latter works? :)

assignee: barry
components: Documentation
messages: 310601
nosy: barry
priority: normal
severity: normal
status: open
title: os.getlogin() should recommend getpass.getuser()
versions: Python 3.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list