, GetShortPathName GetLongPathName. , Windows . ctypes:
def normcase(path):
import ctypes
GetShortPathName = ctypes.windll.kernel32.GetShortPathNameA
GetLongPathName = ctypes.windll.kernel32.GetLongPathNameA
short_length = GetShortPathName(path, None, 0)
if short_length == 0:
return path
short_buf = ctypes.create_string_buffer(short_length)
GetShortPathName(path, short_buf, short_length)
long_length = GetLongPathName(short_buf, None, 0)
long_buf = ctypes.create_string_buffer(long_length)
GetLongPathName(short_buf, long_buf, long_length)
return long_buf.value