summaryrefslogtreecommitdiffstats
path: root/Doc/library/getpass.rst
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2018-01-24 17:51:29 (GMT)
committerGitHub <noreply@github.com>2018-01-24 17:51:29 (GMT)
commitd499031f5f33c3ef71be7c81ef52eee6b47c42e1 (patch)
tree7998708eb21596ed635b2427b862b9c226d279a9 /Doc/library/getpass.rst
parent22feeb88b473b288950cdb2f6c5d28692274b5f9 (diff)
downloadcpython-d499031f5f33c3ef71be7c81ef52eee6b47c42e1.zip
cpython-d499031f5f33c3ef71be7c81ef52eee6b47c42e1.tar.gz
cpython-d499031f5f33c3ef71be7c81ef52eee6b47c42e1.tar.bz2
bpo-32651 Recommend getpass.getuser() (#5301)
* bpo-32651 - In the documentation for os.getlogin(), recommend getpass.getuser()
Diffstat (limited to 'Doc/library/getpass.rst')
-rw-r--r--Doc/library/getpass.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/getpass.rst b/Doc/library/getpass.rst
index 5eb9f04..82b1191 100644
--- a/Doc/library/getpass.rst
+++ b/Doc/library/getpass.rst
@@ -42,8 +42,10 @@ The :mod:`getpass` module provides two functions:
Return the "login name" of the user.
This function checks the environment variables :envvar:`LOGNAME`,
- :envvar:`USER`, :envvar:`LNAME` and :envvar:`USERNAME`, in order, and returns
- the value of the first one which is set to a non-empty string. If none are set,
- the login name from the password database is returned on systems which support
- the :mod:`pwd` module, otherwise, an exception is raised.
+ :envvar:`USER`, :envvar:`LNAME` and :envvar:`USERNAME`, in order, and
+ returns the value of the first one which is set to a non-empty string. If
+ none are set, the login name from the password database is returned on
+ systems which support the :mod:`pwd` module, otherwise, an exception is
+ raised.
+ In general, this function should be preferred over :func:`os.getlogin()`.