windows XP 中的 Pygit2 0.25.0 存储库查找问题

Pygit2 0.25.0 repository finding problem in windows XP

我正在编写 python 程序来处理 git 存储库,它在 win7 上工作正常,但我还需要这个程序在 win xp 上工作(win xp 支持 python 3.4, pygit2 0.28 无法在 win xp 上运行(dll 导入错误)所以我安装了 pygit2 0.25.0) 我正在使用 pyinstaller 构建 .exe

p = pygit2.Repository(repository_path)  

生成异常(在 windows XP 上):

无法解析路径 'C:\TestRepository.git':参数无效

def get_repo():
    repository_path = "C:\TestRepository\.git"
    try:
        p = pygit2.Repository(repository_path)
    except Exception as e:
        print(str(e) + " (exception)") # print to console
        return None
    return p

我试过的:

repository_path = Path("C:\TestRepository\.git").resolve() 

returns 异常: 必须是 str,而不是 windows 路径

repository_path = "C:/TestRepository/.git"
repository_path = b"C:\TestRepository\.git"
repository_path = r"C:\TestRepository\.git"
repository_path = "C:\TestRepository\.git".encode("utf-8")

returns 异常:无法解析路径 'C:\TestRepository.git':参数无效

我期望函数 get_repo 到 return 存储库

已解决:libgit2 从 v.0.21.0

中删除了对 Windows XP 的支持