PyDocs

Nav

File and Directory Access

Path.from_uri

pathlib

classmethod of Path · Added in 3.13 (source)
  • Path.from_uri(uri)
Return a new path from the given 'file' URI.
Changed in 3.14
  • 3.14: The URL authority is discarded if it matches the local hostname. Otherwise, if the authority isn’t empty or localhost, then on Windows a UNC path is returned (as before), and on other platforms a ValueError is raised.
1 Example
>>> p = Path.from_uri('file:///etc/hosts')
PosixPath('/etc/hosts')
from the Python docs
See Also
No see-alsos for pathlib/Path.from_uri
0 Notes
No notes for Path.from_uri