nturl2path.url2pathname
Prev: nturl2path.pathname2url | Up: nturl2path
Rel: nturl2path.pathname2url
Ref: docs.python.org — nturl2path.url2pathname
Tags: #public #python3 #stdlib #nturl2path
Import
import nturl2path
from nturl2path import url2pathname
Signature & Overview
nturl2path.url2pathname(url)
OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.
Usage
import nturl2path
assert nturl2path.url2pathname("///C:/Users/Ada/a.txt") == r"C:\Users\Ada\a.txt"
Gotchas
- Internal helper: Prefer
urllib.request.url2pathname()orPath.from_uri()(Python 3.13+).
REPL Inspect
from nturl2path import url2pathname
help(url2pathname)
Linked from
Related notes
- tuts/python3/stdlib_module/nturl2path Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/nturl2path/pathname2url Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib
- tuts/c/stdlib/ctype/isspace shared tags: #stdlib