os.stat()’s follow_symlinks is a bit ambigously described
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 36k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Documentation
There are numerous functions which take a pathname and and argument like follow_symlinks.
For most of these, the argument follow_symlinks is not further explained in the function itself, but people will rather have to resort to https://docs.python.org/3/library/os.html#files-and-directories where things are rather exactly described.
However, the description of os.stat() has:
This function normally follows symlinks; to stat a symlink add the argument follow_symlinks=False, or use lstat().
Which is however only half correct, because what it actually means is:
When the last component of the path is a symbolic link, the function normally follows it. Symbolic links in the path that are not the last component, are always followed.
Similar, the paragraph below for windows, also uses wording that implies any name-surrogate reparse points, i.e. not only if the last pathname component is one.
No idea what Windows does, but if that's also wrong, it should be corrected accordingly. Also in the "Changed in" entry for that.
AFAICS, the other functions of os have it correctly described (by simply not describing it).
Thanks,
Chris.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalla documentazione di os.stat() e dalla sezione collegata Files and Directories. Chiarisci che follow_symlinks si applica all’ultimo componente del nome del percorso, quindi verifica e correggi, se necessario, la formulazione corrispondente per Windows e la voce Changed in; la documentazione deve descrivere accuratamente entrambi i comportamenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100