GetLongPathName = ctypes.windll.kernel32.GetLongPathNameW
rv = GetLongPathName(path, buf, 260)
if rv == 0 or rv > 260:
    return path
else:
    return buf.value
In Python, how can I get the correctly-cased path for a file?