def _get_win_folder_with_pywin32(csidl_name):
    from win32com.shell import shellcon, shell
    directory = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0)
    try:
        directory = six.text_type(directory)
        has_high_char = False
        for c in directory:
            if (ord(c) > 255):
                has_high_char = True
                break
        if has_high_char:
            try:
                import win32api
                directory = win32api.GetShortPathName(directory)
            except ImportError:
                pass
    except UnicodeError:
        pass
    return directory
def _get_win_folder_with_pywin32(csidl_name):
    from win32com.shell import shellcon, shell
    directory = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0)
    try:
        directory = six.text_type(directory)
        has_high_char = False
        for c in directory:
            if (ord(c) > 255):
                has_high_char = True
                break
        if has_high_char:
            try:
                import win32api
                directory = win32api.GetShortPathName(directory)
            except ImportError:
                pass
    except UnicodeError:
        pass
    return directory