os.stat()’s follow_symlinks is a bit ambigously described
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 36k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit der Dokumentation zu os.stat() und dem verlinkten Abschnitt Files and Directories. Stellen Sie klar, dass follow_symlinks auf die letzte Komponente des Pfadnamens angewendet wird, und überprüfen und korrigieren Sie anschließend gegebenenfalls die entsprechende Windows-Formulierung und den Changed in-Eintrag; die Dokumentation sollte beide Verhaltensweisen korrekt beschreiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100