PyGithub `Repository.compare(base, head)` 不工作

PyGithub `Repository.compare(base, head)` not working

我正在尝试 运行 将 GitHub Enterprise Repo 与 PyGitHub 进行比较。我的代码如下所示:

repo = github.get_repo("my/repo")
log.debug(f"The Repo: {repo}")
log.debug(f"The URL: {repo.compare_url}")

labels = repo.get_labels()
log.debug(f"Labels: {labels.totalCount}")

compare = repo.compare("BRANCH_A", "TAG_B")
log.debug("Compare:\n{compare}")

结果我得到这个:

2020-10-08:13:38:15,349 DEBUG    [changelog.py:50] The Repo: Repository(full_name="my/repo")
2020-10-08:13:38:15,349 DEBUG    [changelog.py:51] The URL: https://<my.enterprise-github.host>/api/v3/repos/my/repo/compare/{base}...{head}
2020-10-08:13:38:15,446 DEBUG    [changelog.py:54] Labels: 13
2020-10-08:13:38:16,114 DEBUG    [changelog.py:57] Compare:
{compare}

如果我 运行 在第 3 行用正确的参数 (https://<my.enterprise-github.host>/api/v3/repos/my/repo/compare/BRANCH_A...TAG_B) 打印出的 URL 失眠,我得到了正确的结果。你有什么提示,为什么 PyGitHub 中的 Repository.compare 不起作用?

行。这个问题是我 python-noob-level:

的结果

我忘记格式化 Log-String,我想在其中显示 Compare-Result:

log.debug(**f**"Compare:\n{compare}")