gpt4 book ai didi

python - github3.py 带有 IssueEvents 的 AttributeError

转载 作者:太空宇宙 更新时间:2023-11-03 17:23:42 25 4
gpt4 key购买 nike

我有一些代码已成功使用 github3.py 来迭代存储库中的问题并提取各种统计信息。

在尝试迭代每个问题的事件时突然出现错误。

我从存储库对象中获取问题:

issues = repo.issues(assignee=user, state="open", labels=label)

我正在迭代以下问题:

for issue in issues:

将每个事件传递给子例程,然后使用迭代事件

for event in issue.events():

这会导致:

AttributeError: 'IssueEvent' object has no attribute '_session'

在循环的第二次迭代中。

我不知道我的代码发生了任何变化,所以我不太确定为什么我突然收到错误。

完整的回溯是:

Traceback (most recent call last):
File "issues.py", line 304, in <module>
main()
File "issues.py", line 300, in main
print_user_issues(gh, sketch, since, useMarkdown)
File "issues.py", line 282, in print_user_issues
status = status_for_user(userLogin, gh, LABEL_MAPPINGS, since, sketch)
File "issues.py", line 121, in status_for_user
add_issues_to_status_for_label(issues, status, label, since)
File "issues.py", line 96, in add_issues_to_status_for_label
wasNew = is_issue_new_since_stroll(issue, since)
File "issues.py", line 68, in is_issue_new_since_stroll
for event in issue.events():
File "/Library/Python/2.7/site-packages/github3/structs.py", line 95, in __iter__
yield cls(i)
File "/Library/Python/2.7/site-packages/github3/models.py", line 130, in __init__
super(GitHubCore, self).__init__(json)
File "/Library/Python/2.7/site-packages/github3/models.py", line 37, in __init__
self._update_attributes(json)
File "/Library/Python/2.7/site-packages/github3/issues/event.py", line 69, in _update_attributes
self.assignee = User(self.assignee, self._session)
AttributeError: 'IssueEvent' object has no attribute '_session'

最佳答案

我有机会查了一下,发现这是在 1.0(尚未发布)工作期间引入的错误。

关于python - github3.py 带有 IssueEvents 的 AttributeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32848546/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com