Skip to content

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Aug 23, 2024

There are no tests for input() function in general, so I didn't include any unittests.

Manual testing:

>>> def audithook(name, *args):
...     if "input" in name: print(name, args)
...     
>>> import sys
>>> sys.addaudithook(audithook)
>>> input("abc ")
builtins.input (('abc ',),)
abc xyz
builtins.input/result (('xyz',),)
'xyz'

@skirpichev
Copy link
Contributor

There are no tests for input() function in general

$ git grep test_input Lib/test/test_builtin.py
Lib/test/test_builtin.py:    def test_input(self):
Lib/test/test_builtin.py:    def test_input_tty(self):
Lib/test/test_builtin.py:    def test_input_tty_non_ascii(self):
Lib/test/test_builtin.py:    def test_input_tty_non_ascii_unicode_errors(self):
Lib/test/test_builtin.py:    def test_input_tty_null_in_prompt(self):
Lib/test/test_builtin.py:    def test_input_tty_nonencodable_prompt(self):
Lib/test/test_builtin.py:    def test_input_tty_nondecodable_input(self):
Lib/test/test_builtin.py:    def test_input_no_stdout_fileno(self):
Lib/test/test_builtin.py:    def test_inputtypes(self):

@sobolevn
Copy link
Member Author

@skirpichev I mean _ReadlineWrapper.input :)

@ambv ambv added the needs backport to 3.13 bugs and security fixes label Sep 5, 2024
@ambv ambv merged commit aa1339a into python:main Sep 5, 2024
@miss-islington-app
Copy link

Thanks @sobolevn for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 5, 2024
@bedevere-app
Copy link

bedevere-app bot commented Sep 5, 2024

GH-123737 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 5, 2024
ambv pushed a commit that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants