mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.14] gh-77065: add missing parameter echo_char
in getpass.fallback_getpass
(GH-133849) (#134053)
gh-77065: add missing parameter `echo_char` in `getpass.fallback_getpass` (GH-133849)
(cherry picked from commit d029a1a1cb
)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
This commit is contained in:
parent
620065c33e
commit
29d69e8b66
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