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

Function abspath

Lib/posixpath.py:374–383  ·  view source on GitHub ↗

Return an absolute path.

(path)

Source from the content-addressed store, hash-verified

372
373
374def abspath(path):
375 """Return an absolute path."""
376 path = os.fspath(path)
377 if isinstance(path, bytes):
378 if not path.startswith(b'/'):
379 path = join(os.getcwdb(), path)
380 else:
381 if not path.startswith('/'):
382 path = join(os.getcwd(), path)
383 return normpath(path)
384
385
386# Return a canonical path (i.e. the absolute location of a file on the

Callers 2

test_posixpath.pyFile · 0.90
relpathFunction · 0.70

Calls 3

normpathFunction · 0.90
joinFunction · 0.70
startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…