1113
def dereference_path(path):
1114
"""Determine the real path to a file.
1116
All parent elements are dereferenced. But the file itself is not
1118
:param path: The original path. May be absolute or relative.
1119
:return: the real path *to* the file
1121
parent, base = os.path.split(path)
1122
# The pathjoin for '.' is a workaround for Python bug #1213894.
1123
# (initial path components aren't dereferenced)
1124
return pathjoin(realpath(pathjoin('.', parent)), base)