github3.py不返回gist的文件内容

时间:2015-04-15 14:31:13

标签: github3.py

我使用github3.py库来创建和更新github.com上的Gist

我可以访问现有的要点并获取除文件内容之外的所有信息:

for g in gh.iter_gists():
    if g.id == content[0]:
        f = g.iter_files().next()
        print g.files #1
        print f.raw_url
        old_content = f.content #Returns None

任何提示为什么它会在最后一行返回None

1 个答案:

答案 0 :(得分:1)

看起来GitHub的API不再作为响应的一部分返回gist文件的内容:

{u'size': 12, u'raw_url': u'https://gist.githubusercontent.com/testgh3/eb911d34ec732e4b7f24/raw/e041e7dc6236db21062c11b2929a72e656bbc40e/fileA.txt', u'type': u'text/plain', u'language': u'Text', u'filename': u'fileA.txt'}

这意味着您正在尝试使用github3.py needs to add functionality to the GistFile class。 (我已经为此创建了一个问题。如果您想帮忙完成工作,我很乐意为您提供帮助,我很乐意将拉取请求与此功能合并。)