Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-101000: Add os.path.splitroot()#101002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
21c0ba9836b85dbc2d1f9ecdc40d6592b2778f42279726ca47a6613c26a8dba0c237d411ed3eb2c9eed88299e9627ffe379beff2abacdee14ebe5452927afeb0aa73e19777d632e212e37cded35a8dfce0e75a553663237053729d694f093e99e3cdf618a001c522c9df17269File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -492,16 +492,28 @@ the :mod:`glob` module.) | ||
| Split the pathname *path* into a triad ``(drive, root, tail)`` where: | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| 1. *drive* isamount point or the empty string; | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| 2. *root* isasequence of separators following the drive or the empty string; and | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| 3. *tail* is anything after the root. | ||
| On POSIX systems, *drive* is always empty. The *root* may be empty (if *path* is | ||
| relative), a single forward slash (if *path* is absolute), or two forward slashes | ||
| (implementation-defined per `IEEE Std 1003.1 2013 Edition; 4.13 Pathname Resolution | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>`_.) | ||
| For example:: | ||
| >>> splitroot('/etc/hosts') | ||
| ('', '/', 'etc/hosts') | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| On Windows, *drive* may be a UNC sharepoint or a traditional drive-letter drive. The | ||
| *root* may be empty, a forward slash, or a backward slash. For example:: | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| >>> splitroot('//server/share/') | ||
| ('//server/share', '/', '') | ||
| >>> splitroot('C:/Users/Barney') | ||
| ('C:', '/', 'Users/Barney') | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| >>> splitroot('Windows/notepad') | ||
| ('', '', 'Windows/notepad') | ||
| In all cases, ``drive + root + tail`` will be the same as *path*. | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||