MCPcopy
hub / github.com/cool-RR/PySnooper / resolve

Method resolve

tests/mini_toolbox/pathlib.py:1334–1352  ·  view source on GitHub ↗

Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows).

(self, strict=False)

Source from the content-addressed store, hash-verified

1332 return obj
1333
1334 def resolve(self, strict=False):
1335 """
1336 Make the path absolute, resolving all symlinks on the way and also
1337 normalizing it (for example turning slashes into backslashes under
1338 Windows).
1339 """
1340 if self._closed:
1341 self._raise_closed()
1342 s = self._flavour.resolve(self, strict=strict)
1343 if s is None:
1344 # No symlink resolution => for consistency, raise an error if
1345 # the path doesn't exist or is forbidden
1346 self.stat()
1347 s = str(self.absolute())
1348 # Now we have no symlinks in the path, it's safe to normalize it.
1349 normed = self._flavour.pathmod.normpath(s)
1350 obj = self._from_parts((normed,), init=False)
1351 obj._init(template=self)
1352 return obj
1353
1354 def stat(self):
1355 """

Callers

nothing calls this directly

Calls 5

_raise_closedMethod · 0.95
statMethod · 0.95
absoluteMethod · 0.95
_from_partsMethod · 0.80
_initMethod · 0.45

Tested by

no test coverage detected