Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating anonymous gist #795

Closed
jwass opened this issue Mar 16, 2018 · 2 comments
Closed

Error creating anonymous gist #795

jwass opened this issue Mar 16, 2018 · 2 comments
Assignees

Comments

@jwass
Copy link

jwass commented Mar 16, 2018

Hello,
Creating an anonymous gist following the code in the docs (https://github3.readthedocs.io/en/develop/examples/gist.html#creating-an-anonymous-gist) results in the following error:

>>> import github3
>>> github3.__version__
'1.0.1'
>>> gh = github3.GitHub()
>>> files = {
...     'spam.txt' : {
...         'content': 'What... is the air-speed velocity of an unladen swallow?'
...         }
...     }
>>>
>>> gist = gh.create_gist('Answer this to cross the bridge', files)
Traceback (most recent call last):
  File "/Users/jwass/.pyenv/versions/geojsonio3/lib/python3.5/site-packages/github3/models.py", line 48, in __init__
    self._update_attributes(json)
  File "/Users/jwass/.pyenv/versions/geojsonio3/lib/python3.5/site-packages/github3/gists/gist.py", line 325, in _update_attributes
    super(Gist, self)._update_attributes(gist)
  File "/Users/jwass/.pyenv/versions/geojsonio3/lib/python3.5/site-packages/github3/gists/gist.py", line 51, in _update_attributes
    self.owner = users.ShortUser(gist['owner'], self)
KeyError: 'owner'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jwass/.pyenv/versions/geojsonio3/lib/python3.5/site-packages/github3/github.py", line 305, in create_gist
    return self._instance_or_null(gists.Gist, json)
  File "/Users/jwass/.pyenv/versions/geojsonio3/lib/python3.5/site-packages/github3/models.py", line 146, in _instance_or_null
    return instance_class(json, self)
  File "/Users/jwass/.pyenv/versions/geojsonio3/lib/python3.5/site-packages/github3/models.py", line 50, in __init__
    raise exceptions.IncompleteResponse(json, kerr)
github3.exceptions.IncompleteResponse: None The library was expecting more data in the response (KeyError('owner',)). Either GitHub modified it's response body, or your token is not properly scoped to retrieve this information.
@omgjlk
Copy link
Collaborator

omgjlk commented Mar 20, 2018

So... GitHub is removing the ability to create anonymous gists. https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/

We'll need to clean up this code to remove the method all together. There may be an actual bug lurking here in the return from attempting to create one, but instead of chasing that down I'm just going to remove the method.

@omgjlk omgjlk self-assigned this Mar 20, 2018
@jwass
Copy link
Author

jwass commented Mar 20, 2018

Oof. I didn't know this. Bummer - but I guess it makes sense for Github to remove them.

omgjlk added a commit to omgjlk/github3.py that referenced this issue Mar 20, 2018
omgjlk added a commit to omgjlk/github3.py that referenced this issue Mar 21, 2018
Per
https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/
anonymous gist creation is no longer possible on GitHub. Also updates
the betamax cassette to ensure tests still work against current API.

Resolves: sigmavirus24#795
omgjlk added a commit to omgjlk/github3.py that referenced this issue Mar 21, 2018
Per
https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/
anonymous gist creation is no longer possible on GitHub. Also updates
the betamax cassette to ensure tests still work against current API.

Resolves: sigmavirus24#795
omgjlk added a commit to omgjlk/github3.py that referenced this issue Mar 21, 2018
Per
https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/
anonymous gist creation is no longer possible on GitHub. Also updates
the betamax cassette to ensure tests still work against current API.

Resolves: sigmavirus24#795
omgjlk added a commit that referenced this issue Mar 21, 2018
Per
https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/
anonymous gist creation is no longer possible on GitHub. Also updates
the betamax cassette to ensure tests still work against current API.

Resolves: #795
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants