回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我当前使用的是github3.py版本0.9.6,在调用github3.organization(login)</strong>函数时收到一个错误:</p>
<pre><code>Traceback (most recent call last):
File "Main.py", line 23, in <module>
__main__()
File "Main.py", line 19, in __main__
Stats.git_auth(username, password, access_token)
File "/Users/edigiovine/Repositories/GitMetrics/Stats.py", line 36, in git_auth
git_orgs(gh)
File "/Users/edigiovine/Repositories/GitMetrics/Stats.py", line 49, in git_orgs
org = gh.organization(rel_org)
File "/Library/Python/2.7/site-packages/github3/github.py", line 971, in organization
return Organization(json, self) if json else None
File "/Library/Python/2.7/site-packages/github3/orgs.py", line 236, in __init__
super(Organization, self).__init__(org, session)
File "/Library/Python/2.7/site-packages/github3/models.py", line 311, in __init__
super(BaseAccount, self).__init__(acct, session)
File "/Library/Python/2.7/site-packages/github3/models.py", line 77, in __init__
super(GitHubCore, self).__init__(json)
File "/Library/Python/2.7/site-packages/github3/models.py", line 30, in __init__
self.etag = json.pop('ETag', None)
TypeError: pop() takes at most 1 argument (2 given)
</code></pre>
<p>我希望我能得到一些帮助来解决这个问题。具体地说,我很好奇最后一次通话中的“无”从何而来。在</p>
<p>提前感谢您的帮助!在</p>
<p><strong>EDIT1:</strong>我试图根据用户提供的现有组织的列表来调用特定的组织,在我的例子中,这个列表比组织的总列表要小得多,所以在这种情况下,遍历所有组织对我没有好处(如果没有给出列表,这是我的默认情况)。在</p>
<p>再次感谢!在</p>
<p><strong>EDIT2:</strong>我正在实现的代码示例,显然微不足道(无法提供私有信息):</p>
^{pr2}$
<p><strong>编辑3:</strong>我知道gh.组织函数是导致代码中出现问题的原因,堆栈跟踪可以看出这一点。我的问题是关于github3的库,并询问如何解决/修复中的pop()函数模型.py,它是引发错误的函数。在</p>
<p><strong>EDIT4:</strong>多亏了pdb,我解决了这个问题:
通过浏览代码,我发现url生成是基于组织函数的输入动态生成的。在</p>
<p>具体地说,我所拥有的是我们组织的默认基本url,它正确地收集了我们的组织数据。我的组织需要修改两个组织的代码。在</p>
<p>这个问题现在解决了。谢谢大家!在</p>