python / python/cpython

Missing audit events for `python -i` and `python -m asyncio`

Aperta
#121,957 2 commenti 1 reazione 1 assegnatario Vedi su GitHub

@ambv ci sta già lavorando.

Dal 18/7/2024.

3.10 3.11 3.12 3.13 3.14 topic-repl type-security
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Modules/main.c:pymain_repl should fire cpython.run_stdin like Modules/main.c:pymain_run_stdin to allow administrators to log/block interactive use. Maybe that event firing should be moved all the way to _PyRun_InteractiveLoopObject, but its only other use is with PyRun_InteractiveLoopFlags, which is embedded, so not clear we want that. Therefore, pymain_repl is now the clear choice. Affected versions: Python 3.8+.

Similarly, the asyncio REPL didn't emit any audit events related to interactive use. Affected versions: Python 3.8+.

Note that code.InteractiveConsole also doesn't fire interactive use audit events, but my thinking here is that this is an end-user API, so the user can choose to fire that event if they want to. Similar case to PyRun_InteractiveLoopFlags.

This will require a separate fix for 3.8 - 3.12.

Linked PRs
  • gh-121958
  • gh-122115
  • gh-122117
  • gh-122118
  • gh-122119
  • gh-122120
  • gh-122121

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.