PyDocs

Nav

File and Directory Access

Path.as_uri

pathlib

method of Path (source) Deprecated 3.14
  • Path.as_uri()
Deprecated since 3.14, removed in 3.19. Calling this method from PurePath rather than Path is possible but deprecated. The method’s use of os.fsencode() makes it strictly impure.
Return the path as a URI.
1 Example
>>> p = PosixPath('/etc/passwd')
>>> p.as_uri()
'file:///etc/passwd'
>>> p = WindowsPath('c:/Windows')
>>> p.as_uri()
'file:///c:/Windows'
from the Python docs
See Also
No see-alsos for pathlib/Path.as_uri
0 Notes
No notes for Path.as_uri