mirror of
https://github.com/python/cpython.git
synced 2025-11-28 22:18:54 +00:00
gh-77065: add missing parameter echo_char in getpass.fallback_getpass (#133849)
This commit is contained in:
parent
74c4e35ff1
commit
d029a1a1cb
1 changed files with 3 additions and 2 deletions
|
|
@ -132,14 +132,15 @@ def win_getpass(prompt='Password: ', stream=None, *, echo_char=None):
|
||||||
return pw
|
return pw
|
||||||
|
|
||||||
|
|
||||||
def fallback_getpass(prompt='Password: ', stream=None):
|
def fallback_getpass(prompt='Password: ', stream=None, *, echo_char=None):
|
||||||
|
_check_echo_char(echo_char)
|
||||||
import warnings
|
import warnings
|
||||||
warnings.warn("Can not control echo on the terminal.", GetPassWarning,
|
warnings.warn("Can not control echo on the terminal.", GetPassWarning,
|
||||||
stacklevel=2)
|
stacklevel=2)
|
||||||
if not stream:
|
if not stream:
|
||||||
stream = sys.stderr
|
stream = sys.stderr
|
||||||
print("Warning: Password input may be echoed.", file=stream)
|
print("Warning: Password input may be echoed.", file=stream)
|
||||||
return _raw_input(prompt, stream)
|
return _raw_input(prompt, stream, echo_char=echo_char)
|
||||||
|
|
||||||
|
|
||||||
def _check_echo_char(echo_char):
|
def _check_echo_char(echo_char):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue