From 57eb740c8c608c0504f71af419a9bf2a649fca6a Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 31 May 2013 20:03:02 -0400 Subject: [PATCH 1/4] Doc patch for 3.0: replace @gen.coroutine with @gen.engine. The oauth 1.0 redirect methods are asynchronous even though they don't take a callback, so we don't want the end of the coroutine to trigger a call to self.finish. --- tornado/auth.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tornado/auth.py b/tornado/auth.py index fddbad6c..c8686187 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -37,7 +37,7 @@ Example usage for Google OpenID:: class GoogleLoginHandler(tornado.web.RequestHandler, tornado.auth.GoogleMixin): @tornado.web.asynchronous - @tornado.gen.coroutine + @tornado.gen.engine def get(self): if self.get_argument("openid.mode", None): user = yield self.get_authenticated_user() @@ -572,7 +572,7 @@ class TwitterMixin(OAuthMixin): class TwitterLoginHandler(tornado.web.RequestHandler, tornado.auth.TwitterMixin): @tornado.web.asynchronous - @tornado.gen.coroutine + @tornado.gen.engine def get(self): if self.get_argument("oauth_token", None): user = yield self.get_authenticated_user() @@ -627,7 +627,7 @@ class TwitterMixin(OAuthMixin): tornado.auth.TwitterMixin): @tornado.web.authenticated @tornado.web.asynchronous - @tornado.gen.coroutine + @tornado.gen.engine def get(self): new_entry = yield self.twitter_request( "/statuses/update", @@ -706,7 +706,7 @@ class FriendFeedMixin(OAuthMixin): class FriendFeedLoginHandler(tornado.web.RequestHandler, tornado.auth.FriendFeedMixin): @tornado.web.asynchronous - @tornado.gen.coroutine + @tornado.gen.engine def get(self): if self.get_argument("oauth_token", None): user = yield self.get_authenticated_user() @@ -751,7 +751,7 @@ class FriendFeedMixin(OAuthMixin): tornado.auth.FriendFeedMixin): @tornado.web.authenticated @tornado.web.asynchronous - @tornado.gen.coroutine + @tornado.gen.engine def get(self): new_entry = yield self.friendfeed_request( "/entry", @@ -835,7 +835,7 @@ class GoogleMixin(OpenIdMixin, OAuthMixin): class GoogleLoginHandler(tornado.web.RequestHandler, tornado.auth.GoogleMixin): @tornado.web.asynchronous - @tornado.gen.coroutine + @tornado.gen.engine def get(self): if self.get_argument("openid.mode", None): user = yield self.get_authenticated_user() @@ -1105,7 +1105,7 @@ class FacebookGraphMixin(OAuth2Mixin): class FacebookGraphLoginHandler(LoginHandler, tornado.auth.FacebookGraphMixin): @tornado.web.asynchronous - @tornado.gen.coroutine + @tornado.gen.engine def get(self): if self.get_argument("code", False): user = yield self.get_authenticated_user( @@ -1192,7 +1192,7 @@ class FacebookGraphMixin(OAuth2Mixin): tornado.auth.FacebookGraphMixin): @tornado.web.authenticated @tornado.web.asynchronous - @tornado.gen.coroutine + @tornado.gen.engine def get(self): new_entry = yield self.facebook_request( "/me/feed", @@ -1223,7 +1223,7 @@ class FacebookGraphMixin(OAuth2Mixin): def _on_facebook_request(self, future, response): if response.error: - future.set_exception(AuthError("Error response %s fetching %s", + future.set_exception(AuthError("Error response %s fetching %s", response.error, response.request.url)) return From 39d89b626c4038871789dbd0eb7eca8aef3e7da6 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 2 Jun 2013 16:04:57 -0400 Subject: [PATCH 2/4] Copy .gitignore update from master to branch3.0 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c84e747f..af3cc1bc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ _auto2to3* /.coverage /htmlcov/ /env/ +# Used in demo apps +secrets.cfg From 64d8b86d6b5f7751f6ab7519035e988a78566df7 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 31 May 2013 21:49:08 -0400 Subject: [PATCH 3/4] Update twitter base urls to use api 1.1 and HTTPS. This is in preparation for the shutdown of version 1 of the API on June 11. Closes #809. --- tornado/auth.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tornado/auth.py b/tornado/auth.py index c8686187..ab2137e3 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -585,12 +585,12 @@ class TwitterMixin(OAuthMixin): and all of the custom Twitter user attributes described at https://dev.twitter.com/docs/api/1.1/get/users/show """ - _OAUTH_REQUEST_TOKEN_URL = "http://api.twitter.com/oauth/request_token" - _OAUTH_ACCESS_TOKEN_URL = "http://api.twitter.com/oauth/access_token" - _OAUTH_AUTHORIZE_URL = "http://api.twitter.com/oauth/authorize" - _OAUTH_AUTHENTICATE_URL = "http://api.twitter.com/oauth/authenticate" + _OAUTH_REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token" + _OAUTH_ACCESS_TOKEN_URL = "https://api.twitter.com/oauth/access_token" + _OAUTH_AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize" + _OAUTH_AUTHENTICATE_URL = "https://api.twitter.com/oauth/authenticate" _OAUTH_NO_CALLBACKS = False - _TWITTER_BASE_URL = "http://api.twitter.com/1" + _TWITTER_BASE_URL = "https://api.twitter.com/1.1" def authenticate_redirect(self, callback_uri=None): """Just like `~OAuthMixin.authorize_redirect`, but From 1a3088b58d5160c4befbc5119cd5459e0c24a5a1 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 2 Jun 2013 16:27:28 -0400 Subject: [PATCH 4/4] Version bump and release notes for 3.0.2. --- docs/releases.rst | 1 + docs/releases/v3.0.2.rst | 12 ++++++++++++ setup.py | 2 +- tornado/__init__.py | 4 ++-- 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 docs/releases/v3.0.2.rst diff --git a/docs/releases.rst b/docs/releases.rst index bdce355e..782c20af 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -4,6 +4,7 @@ Release notes .. toctree:: :maxdepth: 2 + releases/v3.0.2 releases/v3.0.1 releases/v3.0.0 releases/v2.4.1 diff --git a/docs/releases/v3.0.2.rst b/docs/releases/v3.0.2.rst new file mode 100644 index 00000000..7eac09db --- /dev/null +++ b/docs/releases/v3.0.2.rst @@ -0,0 +1,12 @@ +What's new in Tornado 3.0.2 +=========================== + +Jun 2, 2013 +----------- + +* `tornado.auth.TwitterMixin` now defaults to version 1.1 of the + Twitter API, instead of version 1.0 which is being `discontinued on + June 11 `_. It also now uses HTTPS + when talking to Twitter. +* Fixed a potential memory leak with a long chain of `.gen.coroutine` + or `.gen.engine` functions. diff --git a/setup.py b/setup.py index 35d62446..82e6b9c3 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ except ImportError: kwargs = {} -version = "3.0.1" +version = "3.0.2" with open('README.rst') as f: long_description = f.read() diff --git a/tornado/__init__.py b/tornado/__init__.py index c188a1b5..483eb128 100644 --- a/tornado/__init__.py +++ b/tornado/__init__.py @@ -25,5 +25,5 @@ from __future__ import absolute_import, division, print_function, with_statement # is zero for an official release, positive for a development branch, # or negative for a release candidate or beta (after the base version # number has been incremented) -version = "3.0.1" -version_info = (3, 0, 1, 0) +version = "3.0.2" +version_info = (3, 0, 2, 0)