Some ntpath/posixpath functions unusable on foreign OS
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 36k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
The os.path docs intro includes:
Note: Since different operating systems have different path name conventions, there are several versions of this module in the standard library. The
os.pathmodule is always the path module suitable for the operating system Python is running on, and therefore usable for local paths. However, you can also import and use the individual modules if you want to manipulate a path that is always in one of the different formats. They all have the same interface:
posixpathfor UNIX-style pathsntpathfor Windows paths
But we don't explain that some of the functions in ntpath and posixpath aren't suitable for usage on a "foreign" OS, e.g. that using ntpath.realpath() from POSIX is a bad idea.
These functions are safe because they do purely lexical work:
basenamecommonpathcommonprefixdirnameisabsjoinnormcasenormpathsplitsplitdrivesplitrootsplitext
These functions are probably unsafe because they rely on details of the host OS (e.g. via the os module):
abspathexistslexistsexpanduserexpandvarsgetatimegetmtimegetctimegetsizeisfileisdirisjunctionislinkismountisdevdriverealpathrelpathsamefilesameopenfilesamestatsupports_unicode_filenames
Linked PRs
- gh-119772
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
Beginne mit der im Issue verlinkten Einführung in die Dokumentation zu os.path und überprüfe die Listen der lexikalischen und hostabhängigen Funktionen. Sieh dir den verlinkten PR gh-119772 an, bevor du Änderungen vornimmst. Die Aufgabe ist erledigt, wenn die Dokumentation klar erklärt, welche ntpath- und posixpath-Funktionen auf einem fremden Betriebssystem sicher sind und welche vom Hostbetriebssystem abhängen.
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
- Klar beschrieben
- Anfängerfreundlichkeit
- 20/100