Some ntpath/posixpath functions unusable on foreign OS
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 36k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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
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 con l’introduzione alla documentazione di os.path collegata nell’issue e rivedi gli elenchi delle funzioni lessicali e dipendenti dall’host. Controlla il PR collegato gh-119772 prima di apportare modifiche. Il lavoro è completato quando la documentazione spiega chiaramente quali funzioni di ntpath e posixpath sono sicure su un sistema operativo straniero e quali dipendono dal sistema operativo host.
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
- Specificata chiaramente
- Idoneità per principianti
- 20/100