Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

input audit hook is not called from new repl #123240

Closed
Labels
topic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error
@cfbolz

Description

@cfbolz

Bug report

Bug description:

sorry, another pretty strange corner case that probably doesn't matter, but I still wanted to report it.

In the new repl, callinginput does not trigger the audit-hook forinput any more, because the builtin is replaced with a pyrepl-specific function:

cfbolz@triacontahedron:~/projects/cpython$ ./python Python 3.14.0a0 (heads/main-dirty:3d7b1a526d8, Aug 22 2024, 14:55:23) [GCC 13.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>>defaudithook(name,*args):...if"input"in name:print(name, args)...     >>>import sys>>> sys.addaudithook(audithook)>>>input()abcdef'abcdef'>>>

Here's the old behaviour:

cfbolz@triacontahedron:~/projects/cpython$ python3Python 3.11.6 (main, Apr 10 2024, 17:26:07) [GCC 13.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>>import sys>>>defaudithook(name,*args):...if"input"in name:print(name, args)... >>> sys.addaudithook(audithook)>>>input()builtins.input ((None,),)abcbuiltins.input/result (('abc',),)'abc'

CPython versions tested on:

3.13, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp