MCPcopy Index your code
hub / github.com/python/cpython / as_uri

Method as_uri

Lib/pathlib/__init__.py:1462–1467  ·  view source on GitHub ↗

Return the path as a URI.

(self)

Source from the content-addressed store, hash-verified

1460 return cls(homedir)
1461
1462 def as_uri(self):
1463 """Return the path as a URI."""
1464 if not self.is_absolute():
1465 raise ValueError("relative paths can't be expressed as file URIs")
1466 from urllib.request import pathname2url
1467 return pathname2url(str(self), add_scheme=True)
1468
1469 @classmethod
1470 def from_uri(cls, uri):

Callers 2

make_uriMethod · 0.45
_normalize_uriFunction · 0.45

Calls 3

pathname2urlFunction · 0.90
strFunction · 0.85
is_absoluteMethod · 0.80

Tested by 1

make_uriMethod · 0.36