Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)
(self)
| 1239 | raise UnsupportedOperation(f"{f} is unsupported on this system") |
| 1240 | |
| 1241 | def expanduser(self): |
| 1242 | """ Return a new path with expanded ~ and ~user constructs |
| 1243 | (as returned by os.path.expanduser) |
| 1244 | """ |
| 1245 | if (not (self.drive or self.root) and |
| 1246 | self._tail and self._tail[0][:1] == '~'): |
| 1247 | homedir = os.path.expanduser(self._tail[0]) |
| 1248 | if homedir[:1] == "~": |
| 1249 | raise RuntimeError("Could not determine home directory.") |
| 1250 | drv, root, tail = self._parse_path(homedir) |
| 1251 | return self._from_parsed_parts(drv, root, tail + self._tail[1:]) |
| 1252 | |
| 1253 | return self |
| 1254 | |
| 1255 | @classmethod |
| 1256 | def home(cls): |