]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-138514: getpass: restrict `echo_char` to a single ASCII character (#138591)
authorBenjamin Johnson <benjohnson2040@gmail.com>
Tue, 16 Sep 2025 14:21:55 +0000 (08:21 -0600)
committerGitHub <noreply@github.com>
Tue, 16 Sep 2025 14:21:55 +0000 (16:21 +0200)
commitab6893ab5c04fecf71c94f7d65527df124155df5
tree377bdb94c82e242f0235069dc09b91bc1d360ddd
parent9a8bc6d4a46cc5af1e3a98b0c147496f2ddd17ae
gh-138514: getpass: restrict `echo_char` to a single ASCII character (#138591)

This amends commit bf8bbe9a813dd9fc2dd14be06df172b7d26ca1af by
restricting `echo_char` in `getpass.getpass` to single printable
ASCII characters as it would be uncommon to use long strings or
multi-byte characters for keyboard feedback.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Doc/library/getpass.rst
Lib/getpass.py
Lib/test/test_getpass.py
Misc/ACKS
Misc/NEWS.d/next/Library/2025-09-06-11-26-21.gh-issue-138514.66ltOb.rst [new file with mode: 0644]