Skip to content

Commit 741a817

Browse files
authored
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent e1461a7 commit 741a817

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Doc/library/getpass.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ The :mod:`!getpass` module provides two functions:
5656
Added the *echo_char* parameter for keyboard feedback.
5757

5858
.. versionchanged:: next
59-
When using non-empty *echo_char* on Unix, keyboard shortcuts (including cursor
60-
movement and line editing) are now properly handled using the terminal's
61-
control character configuration.
59+
When using non-empty *echo_char* on Unix, keyboard shortcuts (including
60+
cursor movement and line editing) are now properly handled using the
61+
terminal's control character configuration.
6262

6363
.. exception:: GetPassWarning
6464

Lib/test/test_getpass.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def check_raw_input(self, inputs, expect_result, prompt='Password: '):
9595
self.assertEqual(result, expect_result)
9696
return mock_output.getvalue()
9797

98+
def test_null_char(self):
99+
self.check_raw_input('pass\x00word\n', 'password')
100+
98101
def test_raw_input_with_echo_char(self):
99102
output = self.check_raw_input('my1pa$$word!\n', 'my1pa$$word!')
100103
self.assertEqual('Password: ************', output)

0 commit comments

Comments
 (0)