带有IssueEvents

时间:2015-09-29 15:53:36

标签: python github github3.py

我有一些代码已成功使用github3.py来迭代回购中的问题并提取各种统计数据。

突然间,我在尝试迭代每个问题的事件时遇到错误。

我从repo对象获取问题:

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 :(得分:1)

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