Bug #1445068: getpass.getpass() can now be given an explicit stream

argument to specify where to write the prompt.
This commit is contained in:
Georg Brandl 2006-03-31 18:42:16 +00:00
parent 22ec80bc4f
commit 338ef7d2bd
3 changed files with 24 additions and 12 deletions

View file

@ -11,11 +11,15 @@
The \module{getpass} module provides two functions:
\begin{funcdesc}{getpass}{\optional{prompt}}
\begin{funcdesc}{getpass}{\optional{prompt\optional{, stream}}}
Prompt the user for a password without echoing. The user is
prompted using the string \var{prompt}, which defaults to
\code{'Password: '}.
\code{'Password: '}. On \UNIX, the prompt is written to the
file-like object \var{stream}, which defaults to
\code{sys.stdout} (this argument is ignored on Windows).
Availability: Macintosh, \UNIX, Windows.
\versionadded[The \var{stream} parameter]{2.5}
\end{funcdesc}