Return the path as a URI.
(self)
| 1262 | return cls(homedir) |
| 1263 | |
| 1264 | def as_uri(self): |
| 1265 | """Return the path as a URI.""" |
| 1266 | if not self.is_absolute(): |
| 1267 | raise ValueError("relative paths can't be expressed as file URIs") |
| 1268 | from urllib.request import pathname2url |
| 1269 | return pathname2url(str(self), add_scheme=True) |
| 1270 | |
| 1271 | @classmethod |
| 1272 | def from_uri(cls, uri): |