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

**Please** release a new version on PyPI. #64

Closed
justinas opened this issue Aug 10, 2013 · 7 comments
Closed

**Please** release a new version on PyPI. #64

justinas opened this issue Aug 10, 2013 · 7 comments

Comments

@justinas
Copy link

5570360 fixed a giant bug that some people have run into: with revisions before 5570360 (including v0.3.2) it's simply impossible to fetch access token from Twitter, Tumblr, and possibly any other site using the code below (that's basically a simplified example from the docs).

from requests_oauthlib import OAuth1Session

CLIENT_KEY = 'blah'
CLIENT_SECRET = 'blah'
REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'
BASE_AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'

if __name__ == '__main__':
    oauth = OAuth1Session(client_key=CLIENT_KEY,
                          client_secret=CLIENT_SECRET)

    oauth.fetch_request_token(REQUEST_TOKEN_URL)
    print oauth.authorization_url(BASE_AUTHORIZATION_URL)
    redirect_response = raw_input('Redirect response: ')
    oauth.parse_authorization_response(redirect_response)
    print oauth.fetch_access_token(ACCESS_TOKEN_URL)

On previous revisions it will fail with this:

Traceback (most recent call last):
  File "a.py", line 20, in <module>
    print oauth.fetch_access_token(ACCESS_TOKEN_URL)
  File "/tmp/requests-oauthlib/requests_oauthlib/oauth1_session.py", line 221, in fetch_access_token
    token = self._fetch_token(url)
  File "/tmp/requests-oauthlib/requests_oauthlib/oauth1_session.py", line 257, in _fetch_token
    self._populate_attributes(token)
  File "/tmp/requests-oauthlib/requests_oauthlib/oauth1_session.py", line 249, in _populate_attributes
    raise ValueError('Response does not contain a token. %s', token)
ValueError: (u'Response does not contain a token. %s', {})

I've already said it in a comment under the commit – this is a big issue. It breaks the OAuth 1 functionality completely, assuming you use OAuth1Session to obtain the tokens.

I think a lot of users of requests_oauthlib would lead much happier lives if a version that includes this fix would be available on PyPI.

@ib-lundgren
Copy link
Member

Think a 0.3.3 release would not hurt until we can sort out the remaining tasks in #48 but @Lukasa manages the releases so it is ultimately up to him.

@Lukasa
Copy link
Member

Lukasa commented Aug 10, 2013

Yeah, this is time for a mea culpa, I've let the next release slip. I'm taking a look through the changes now, and will be aiming to push out a release today if everything looks good.

@Lukasa
Copy link
Member

Lukasa commented Aug 10, 2013

Yeah, this looks fine, seems like a minor version bump to me.

@Lukasa
Copy link
Member

Lukasa commented Aug 10, 2013

Pushed 0.3.3. @justinas I'm so sorry this got left so late. =(

@Lukasa Lukasa closed this as completed Aug 10, 2013
@justinas
Copy link
Author

It's okay, thanks for resolving this! 👍

@Lukasa
Copy link
Member

Lukasa commented Aug 10, 2013

@ib-lundgren So that this is easier in future, I've pushed up a HISTORY.rst file. Each change should be accompanied with a note in there, so that I can prepare release notes. =)

@ib-lundgren
Copy link
Member

Sounds good, will keep it updated.

On Sat, Aug 10, 2013 at 3:52 PM, Cory Benfield [email protected]:

@ib-lundgren https://github.com/ib-lundgren So that this is easier in
future, I've pushed up a HISTORY.rst file. Each change should be
accompanied with a note in there, so that I can prepare release notes. =)


Reply to this email directly or view it on GitHubhttps://github.com//issues/64#issuecomment-22441082
.

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

No branches or pull requests

3 participants