Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
00e820dc
Commit
00e820dc
authored
Apr 14, 2014
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#21169: add comment and doc update for getpass change.
parent
6eb92f97
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
Doc/library/getpass.rst
Doc/library/getpass.rst
+5
-4
Lib/getpass.py
Lib/getpass.py
+1
-0
No files found.
Doc/library/getpass.rst
View file @
00e820dc
...
...
@@ -13,10 +13,11 @@ The :mod:`getpass` module provides two functions:
.. function:: getpass(prompt='Password: ', stream=None)
Prompt the user for a password without echoing. The user is prompted using
the string *prompt*, which defaults to ``'Password: '``. On Unix, the prompt
is written to the file-like object *stream*. *stream* defaults to the
controlling terminal (:file:`/dev/tty`) or if that is unavailable to
``sys.stderr`` (this argument is ignored on Windows).
the string *prompt*, which defaults to ``'Password: '``. On Unix, the
prompt is written to the file-like object *stream* using the replace error
handler if needed. *stream* defaults to the controlling terminal
(:file:`/dev/tty`) or if that is unavailable to ``sys.stderr`` (this
argument is ignored on Windows).
If echo free input is unavailable getpass() falls back to printing
a warning message to *stream* and reading from ``sys.stdin`` and
...
...
Lib/getpass.py
View file @
00e820dc
...
...
@@ -138,6 +138,7 @@ def _raw_input(prompt="", stream=None, input=None):
try
:
stream
.
write
(
prompt
)
except
UnicodeEncodeError
:
# Use replace error handler to get as much as possible printed.
prompt
=
prompt
.
encode
(
stream
.
encoding
,
'replace'
)
prompt
=
prompt
.
decode
(
stream
.
encoding
)
stream
.
write
(
prompt
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment