Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)
(self)
| 1437 | raise UnsupportedOperation(f"{f} is unsupported on this system") |
| 1438 | |
| 1439 | def expanduser(self): |
| 1440 | """ Return a new path with expanded ~ and ~user constructs |
| 1441 | (as returned by os.path.expanduser) |
| 1442 | """ |
| 1443 | if (not (self.drive or self.root) and |
| 1444 | self._tail and self._tail[0][:1] == '~'): |
| 1445 | homedir = os.path.expanduser(self._tail[0]) |
| 1446 | if homedir[:1] == "~": |
| 1447 | raise RuntimeError("Could not determine home directory.") |
| 1448 | drv, root, tail = self._parse_path(homedir) |
| 1449 | return self._from_parsed_parts(drv, root, tail + self._tail[1:]) |
| 1450 | |
| 1451 | return self |
| 1452 | |
| 1453 | @classmethod |
| 1454 | def home(cls): |