Skip to content

gh-123240: Raise input audit events in the new REPL #123274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2024

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
43 checks passed
@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
…23274)

(cherry picked from commit aa1339a)

Co-authored-by: sobolevn <mail@sobolevn.me>
@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
#123737)

(cherry picked from commit aa1339a)

Co-authored-by: sobolevn <mail@sobolevn.me>
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