MCPcopy Index your code
hub / github.com/RustPython/RustPython / from_uri

Method from_uri

Lib/pathlib/__init__.py:1272–1282  ·  view source on GitHub ↗

Return a new path from the given 'file' URI.

(cls, uri)

Source from the content-addressed store, hash-verified

1270
1271 @classmethod
1272 def from_uri(cls, uri):
1273 """Return a new path from the given 'file' URI."""
1274 from urllib.error import URLError
1275 from urllib.request import url2pathname
1276 try:
1277 path = cls(url2pathname(uri, require_scheme=True))
1278 except URLError as exc:
1279 raise ValueError(exc.reason) from None
1280 if not path.is_absolute():
1281 raise ValueError(f"URI is not absolute: {uri!r}")
1282 return path
1283
1284
1285class PosixPath(Path, PurePosixPath):

Calls 3

url2pathnameFunction · 0.90
is_absoluteMethod · 0.80
clsClass · 0.50