From fffc644c06db631af141d99e2ee416fd9785a7af Mon Sep 17 00:00:00 2001 From: yagggi Date: Tue, 9 Sep 2025 00:41:48 +0800 Subject: [PATCH 1/4] Mention unexpected behavior of getpass.getpass() in document --- Doc/library/getpass.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/getpass.rst b/Doc/library/getpass.rst index 0fb0fc88683c03..eef5f0ff183c70 100644 --- a/Doc/library/getpass.rst +++ b/Doc/library/getpass.rst @@ -39,6 +39,12 @@ The :mod:`getpass` module provides two functions: If you call getpass from within IDLE, the input may be done in the terminal you launched IDLE from rather than the idle window itself. + .. note:: + On Unix systems, when ``echo_char`` is set, ``Ctrl+U`` will not erase + the entire current input line, and may insert unexpected characters + into the input. + (See https://github.com/python/cpython/issues/138577 for detail) + .. versionchanged:: 3.14 Added the *echo_char* parameter for keyboard feedback. From d8fe91b57961df8e247a3a9ee889efa1ea0f5e0d Mon Sep 17 00:00:00 2001 From: yagggi Date: Tue, 9 Sep 2025 02:11:40 +0800 Subject: [PATCH 2/4] Improve wording Co-authored-by: Brian Schubert --- Doc/library/getpass.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/getpass.rst b/Doc/library/getpass.rst index eef5f0ff183c70..60ee854027088c 100644 --- a/Doc/library/getpass.rst +++ b/Doc/library/getpass.rst @@ -40,10 +40,12 @@ The :mod:`getpass` module provides two functions: terminal you launched IDLE from rather than the idle window itself. .. note:: - On Unix systems, when ``echo_char`` is set, ``Ctrl+U`` will not erase - the entire current input line, and may insert unexpected characters - into the input. - (See https://github.com/python/cpython/issues/138577 for detail) + On Unix systems, when *echo_char* is set, the terminal will be + configured to operate in `noncanonical mode + `__. + In particular, this means that line editing shortcuts such as + :kbd:`Ctrl+U` will not work and may insert unexpected characters into + the input. (See :gh:`138577`) .. versionchanged:: 3.14 Added the *echo_char* parameter for keyboard feedback. From 40470ab6818a0625720913c46ca8d699a69c8d98 Mon Sep 17 00:00:00 2001 From: yagggi Date: Tue, 9 Sep 2025 02:14:41 +0800 Subject: [PATCH 3/4] Remove trailing whitespace --- Doc/library/getpass.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/getpass.rst b/Doc/library/getpass.rst index 60ee854027088c..1bb9a06ca6e37f 100644 --- a/Doc/library/getpass.rst +++ b/Doc/library/getpass.rst @@ -41,7 +41,7 @@ The :mod:`getpass` module provides two functions: .. note:: On Unix systems, when *echo_char* is set, the terminal will be - configured to operate in `noncanonical mode + configured to operate in `noncanonical mode `__. In particular, this means that line editing shortcuts such as :kbd:`Ctrl+U` will not work and may insert unexpected characters into From 942016c20e7a8aa4c1875ac68023b4a39490f5a5 Mon Sep 17 00:00:00 2001 From: yagggi Date: Tue, 9 Sep 2025 02:38:08 +0800 Subject: [PATCH 4/4] Revise formatting: use :manpage: to generate link; remove github issue link. --- Doc/library/getpass.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/getpass.rst b/Doc/library/getpass.rst index 1bb9a06ca6e37f..af9c9e9f39d9a6 100644 --- a/Doc/library/getpass.rst +++ b/Doc/library/getpass.rst @@ -41,11 +41,11 @@ The :mod:`getpass` module provides two functions: .. note:: On Unix systems, when *echo_char* is set, the terminal will be - configured to operate in `noncanonical mode - `__. + configured to operate in + :manpage:`noncanonical mode `. In particular, this means that line editing shortcuts such as :kbd:`Ctrl+U` will not work and may insert unexpected characters into - the input. (See :gh:`138577`) + the input. .. versionchanged:: 3.14 Added the *echo_char* parameter for keyboard feedback.