gh-77065: add missing parameter `echo_char` in `getpass.fallback_getpass` (#133849)

This commit is contained in:
Semyon Moroz 2025-05-15 13:07:34 +00:00 committed by GitHub
parent 74c4e35ff1
commit d029a1a1cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -132,14 +132,15 @@ def win_getpass(prompt='Password: ', stream=None, *, echo_char=None):
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
warnings.warn("Can not control echo on the terminal.", GetPassWarning,
stacklevel=2)
if not stream:
stream = sys.stderr
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):