rest25/library/getpass.rst => rest262/library/getpass.rst
n1- 
2:mod:`getpass` --- Portable password input
3==========================================
4
5.. module:: getpass
6   :synopsis: Portable reading of passwords and retrieval of the userid.
7.. moduleauthor:: Piers Lauder <piers@cs.su.oz.au>
8.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
n9- 
10- 
11-.. % Windows (& Mac?) support by Guido van Rossum.
8+.. Windows (& Mac?) support by Guido van Rossum.
12
13The :mod:`getpass` module provides two functions:
14
15
16.. function:: getpass([prompt[, stream]])
17
18   Prompt the user for a password without echoing.  The user is prompted using the
19   string *prompt*, which defaults to ``'Password: '``. On Unix, the prompt is
n20-   written to the file-like object *stream*, which defaults to ``sys.stdout`` (this
n17+   written to the file-like object *stream*.  *stream* defaults to the
18+   controlling terminal (/dev/tty) or if that is unavailable to ``sys.stderr``
21-   argument is ignored on Windows).
19+   (this argument is ignored on Windows).
20+ 
21+   If echo free input is unavailable getpass() falls back to printing
22+   a warning message to *stream* and reading from ``sys.stdin`` and
23+   issuing a :exc:`GetPassWarning`.
22
23   Availability: Macintosh, Unix, Windows.
24
25   .. versionchanged:: 2.5
26      The *stream* parameter was added.
t29+   .. versionchanged:: 2.6
30+      On Unix it defaults to using /dev/tty before falling back
31+      to ``sys.stdin`` and ``sys.stderr``.
32+   .. note::
33+      If you call getpass from within IDLE, the input may be done in the
34+      terminal you launched IDLE from rather than the idle window itself.
35+ 
36+ 
37+.. exception:: GetPassWarning
38+ 
39+   A :exc:`UserWarning` subclass issued when password input may be echoed.
27
28
29.. function:: getuser()
30
31   Return the "login name" of the user. Availability: Unix, Windows.
32
33   This function checks the environment variables :envvar:`LOGNAME`,
34   :envvar:`USER`, :envvar:`LNAME` and :envvar:`USERNAME`, in order, and returns
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op