-
Notifications
You must be signed in to change notification settings - Fork 911
Python 3 support #125
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
Python 3 support #125
Conversation
See #158 for more. cc @jaitaiwan |
Darn this looks promising. I'll have to check mine again, because I think I opted for breaking py2x compatibility in favour if py3k. Once I've rebased my PR we'll see if the tests pass or fail. @mitchellrj reckon you'd be keen on rebasing your PR? See if your tests are still passing. |
I'm unable to work on this right now, I will try to take a look sometime in
|
I'll see if I can rebase and check the tests are passing or not. |
Here's the results of the rebase and test against py3k in travis: https://travis-ci.org/CentricWebEstate/python-oauth2/builds/75876246 So great to see that it still passes on 2k but 3k's going to need some work. |
Thanks for everyone who contributed to getting py3k out the door. Closing this as it is resolved by release 1.9 |
@@ -490,7 +542,7 @@ def sign_request(self, signature_method, consumer, token): | |||
# section 4.1.1 "OAuth Consumers MUST NOT include an | |||
# oauth_body_hash parameter on requests with form-encoded | |||
# request bodies." | |||
self['oauth_body_hash'] = base64.b64encode(sha(self.body).digest()) | |||
self['oauth_body_hash'] = s(base64.b64encode(sha(b(self.body)).digest())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- E501 line too long (85 > 79 characters)
self.failUnlessEqual(kw['redirections'], httplib2.DEFAULT_MAX_REDIRECTS) | ||
self.failUnless(isinstance(kw['headers'], dict)) | ||
self.assertTrue(cl is client) | ||
self.assertEqual(frozenset(kw.keys()), frozenset(['method', 'body', 'redirections', 'connection_type', 'headers'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- E501 line too long (127 > 79 characters)
All tests passing on latest versions of Python 2.5, 2.6, 2.7 & 3.2.
Python 2.4 tests fail, but were failing anyway. I'd advise the README is updated to reflect this.
Alternate expectations in tests are purely due to Python 3's handling of unicode strings.