python / python/cpython

subprocess.run parameters not fully documented

Aperta
#127,008 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

docs
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

https://docs.python.org/3/library/subprocess.html#subprocess.run

So I want to capture STDERR, but it doesn't actually say how to do that anywhere that I can see. Note that I don't want to capture STDOUT.

My IDE is telling me that stderr accepts None and Int types. What are the int values? I'm guessing a PIPE:

subprocess.PIPE
Special value that can be used as the stdin, stdout or stderr argument to Popen and indicates that a pipe to the standard stream should be opened.

Now the user also needs to understand the inner workings of Popen? Why on earth does a user need to join so many dots just to use an arguement? Is not explicit is better than implicit part of the python ethos?

I'm sorry to be blunt, but none of this is well documented. There should be a comprehensive, itemised list of all parameters. Each one should explicitly list what they do and what their possible values are. As it is, it's a confused mess of "if x, then y in module q, but not z in module p".

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.

Direzione di ricerca

Inizia dalla documentazione di subprocess.run collegata nell’issue e confronta le descrizioni dei parametri con la documentazione di Popen indicata, in particolare stderr e subprocess.PIPE. Il lavoro è completato quando i parametri e i valori accettati sono documentati in modo sufficientemente chiaro da spiegare come catturare STDERR senza richiedere ai lettori di dedurre il comportamento da un’altra API.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.