【发布时间】:2015-10-03 03:32:09
【问题描述】:
我正在使用 PyGithub 获得对我自己的 github 存储库的基本访问权限。大多数方法都需要一个“路径”,我不确定那是什么。我将在 .get_contents() 函数中使用哪些参数?简单例子:
from github import Github
g = Github("***","***")
repo = g.get_user().get_repo("my_projects")
contents = repo.get_contents()
【问题讨论】:
-
您对上述 sn-p 的反应是什么?
-
回溯错误;最后两行阅读:文件“/Library/Python/2.7/site-packages/PyGithub-1.25.2-py2.7.egg/github/Requester.py”,第177行,在__check raise self.__createException(status, responseHeaders , 输出) github.GithubException.UnknownObjectException: 404 {u'documentation_url': u'developer.github.com/v3', u'message': u'Not Found'}
-
根据 pygithhub 的说法,产生上述异常的原因如下:请求不存在的对象时引发异常(当 Github API 回复 404 HTML 状态时)
-
repo 对象存在(我可以调用 repo.name 并获得“my_projects”而没有错误)。我需要弄清楚我认为应该在 get_contents() 中放入什么
标签: python github github-api pygithub