Hello community, here is the log from the commit of package python-tornado for openSUSE:Factory checked in at 2013-04-19 10:03:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-tornado (Old) and /work/SRC/openSUSE:Factory/.python-tornado.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tornado", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/python-tornado/python-tornado.changes 2013-04-07 14:26:11.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-tornado.new/python-tornado.changes 2013-04-19 10:03:44.000000000 +0200 @@ -1,0 +2,21 @@ +Thu Apr 11 16:47:30 UTC 2013 - [email protected] + +- Update to 3.0.1: + - The interface of tornado.auth.FacebookGraphMixin is now + consistent with its documentation and the rest of the module. + The get_authenticated_user and facebook_request methods return + a Future and the callback argument is optional. + - The tornado.testing.gen_test decorator will no longer be + recognized as a (broken) test by nose. + - Work around a bug in Ubuntu 13.04 betas involving an + incomplete backport of the ssl.match_hostname function. + - tornado.websocket.websocket_connect now fails cleanly when it + attempts to connect to a non-websocket url. + - tornado.testing.LogTrapTestCase once again works with byte + strings on Python 2. + - The request attribute of tornado.httpclient.HTTPResponse is + now always an HTTPRequest, never a _RequestProxy. + - Exceptions raised by the tornado.gen module now have better + messages when tuples are used as callback keys. + +------------------------------------------------------------------- python3-tornado.changes: same change Old: ---- tornado-3.0.tar.bz2 New: ---- tornado-3.0.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-tornado.spec ++++++ --- /var/tmp/diff_new_pack.bYgooh/_old 2013-04-19 10:03:45.000000000 +0200 +++ /var/tmp/diff_new_pack.bYgooh/_new 2013-04-19 10:03:45.000000000 +0200 @@ -16,7 +16,7 @@ # Name: python-tornado -Version: 3.0 +Version: 3.0.1 Release: 0 Url: http://www.tornadoweb.org Summary: Open source version of scalable, non-blocking web server that power FriendFeed python3-tornado.spec: same change ++++++ tornado-3.0.tar.bz2 -> tornado-3.0.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/MANIFEST.in new/tornado-3.0.1/MANIFEST.in --- old/tornado-3.0/MANIFEST.in 2013-03-29 02:38:33.000000000 +0100 +++ new/tornado-3.0.1/MANIFEST.in 2013-03-31 23:45:15.000000000 +0200 @@ -9,5 +9,6 @@ include tornado/test/templates/utf8.html include tornado/test/test.crt include tornado/test/test.key +include README.rst include runtests.sh global-exclude _auto2to3* \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/PKG-INFO new/tornado-3.0.1/PKG-INFO --- old/tornado-3.0/PKG-INFO 2013-03-29 14:09:10.000000000 +0100 +++ new/tornado-3.0.1/PKG-INFO 2013-04-09 05:28:27.000000000 +0200 @@ -1,12 +1,128 @@ Metadata-Version: 1.1 Name: tornado -Version: 3.0 +Version: 3.0.1 Summary: Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. Home-page: http://www.tornadoweb.org/ Author: Facebook Author-email: [email protected] License: http://www.apache.org/licenses/LICENSE-2.0 -Description: UNKNOWN +Description: Tornado Web Server + ================== + + `Tornado <http://www.tornadoweb.org>`_ is a Python web framework and + asynchronous networking library, originally developed at `FriendFeed + <http://friendfeed.com>`_. By using non-blocking network I/O, Tornado + can scale to tens of thousands of open connections, making it ideal for + `long polling <http://en.wikipedia.org/wiki/Push_technology#Long_polling>`_, + `WebSockets <http://en.wikipedia.org/wiki/WebSocket>`_, and other + applications that require a long-lived connection to each user. + + + Quick links + ----------- + + * `Documentation <http://www.tornadoweb.org/en/stable/>`_ + * `Source (github) <https://github.com/facebook/tornado>`_ + * `Mailing list <http://groups.google.com/group/python-tornado>`_ + * `Wiki <https://github.com/facebook/tornado/wiki/Links>`_ + + Hello, world + ------------ + + Here is a simple "Hello, world" example web app for Tornado:: + + import tornado.ioloop + import tornado.web + + class MainHandler(tornado.web.RequestHandler): + def get(self): + self.write("Hello, world") + + application = tornado.web.Application([ + (r"/", MainHandler), + ]) + + if __name__ == "__main__": + application.listen(8888) + tornado.ioloop.IOLoop.instance().start() + + This example does not use any of Tornado's asynchronous features; for + that see this `simple chat room + <https://github.com/facebook/tornado/tree/master/demos/chat>`_. + + Installation + ------------ + + **Automatic installation**:: + + pip install tornado + + Tornado is listed in `PyPI <http://pypi.python.org/pypi/tornado/>`_ and + can be installed with ``pip`` or ``easy_install``. Note that the + source distribution includes demo applications that are not present + when Tornado is installed in this way, so you may wish to download a + copy of the source tarball as well. + + **Manual installation**: Download the latest source from `PyPI + <http://pypi.python.org/pypi/tornado/>`_. + + .. parsed-literal:: + + tar xvzf tornado-$VERSION.tar.gz + cd tornado-$VERSION + python setup.py build + sudo python setup.py install + + The Tornado source code is `hosted on GitHub + <https://github.com/facebook/tornado>`_. + + **Prerequisites**: Tornado runs on Python 2.6, 2.7, 3.2, and 3.3. It has + no strict dependencies outside the Python standard library, although some + features may require one of the following libraries: + + * `unittest2 <https://pypi.python.org/pypi/unittest2>`_ is needed to run + Tornado's test suite on Python 2.6 (it is unnecessary on more recent + versions of Python) + * `concurrent.futures <https://pypi.python.org/pypi/futures>`_ is the + recommended thread pool for use with Tornado and enables the use of + ``tornado.netutil.ThreadedResolver``. It is needed only on Python 2; + Python 3 includes this package in the standard library. + * `pycurl <http://pycurl.sourceforge.net>`_ is used by the optional + ``tornado.curl_httpclient``. Libcurl version 7.18.2 or higher is required; + version 7.21.1 or higher is recommended. + * `Twisted <http://www.twistedmatrix.com>`_ may be used with the classes in + `tornado.platform.twisted`. + * `pycares <https://pypi.python.org/pypi/pycares>`_ is an alternative + non-blocking DNS resolver that can be used when threads are not + appropriate. + * `Monotime <https://pypi.python.org/pypi/Monotime>`_ adds support for + a monotonic clock, which improves reliability in environments + where clock adjustments are frequent. No longer needed in Python 3.3. + + **Platforms**: Tornado should run on any Unix-like platform, although + for the best performance and scalability only Linux (with ``epoll``) + and BSD (with ``kqueue``) are recommended (even though Mac OS X is + derived from BSD and supports kqueue, its networking performance is + generally poor so it is recommended only for development use). + + Discussion and support + ---------------------- + + You can discuss Tornado on `the Tornado developer mailing list + <http://groups.google.com/group/python-tornado>`_, and report bugs on + the `GitHub issue trackier + <https://github.com/facebook/tornado/issues>`_. Links to additional + resources can be found on the `Tornado wiki + <https://github.com/facebook/tornado/wiki/Links>`_. + + Tornado is one of `Facebook's open source technologies + <http://developers.facebook.com/opensource/>`_. It is available under + the `Apache License, Version 2.0 + <http://www.apache.org/licenses/LICENSE-2.0.html>`_. + + This web site and all documentation is licensed under `Creative + Commons 3.0 <http://creativecommons.org/licenses/by/3.0/>`_. + Platform: UNKNOWN Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/README.rst new/tornado-3.0.1/README.rst --- old/tornado-3.0/README.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/tornado-3.0.1/README.rst 2013-03-31 23:45:15.000000000 +0200 @@ -0,0 +1,116 @@ +Tornado Web Server +================== + +`Tornado <http://www.tornadoweb.org>`_ is a Python web framework and +asynchronous networking library, originally developed at `FriendFeed +<http://friendfeed.com>`_. By using non-blocking network I/O, Tornado +can scale to tens of thousands of open connections, making it ideal for +`long polling <http://en.wikipedia.org/wiki/Push_technology#Long_polling>`_, +`WebSockets <http://en.wikipedia.org/wiki/WebSocket>`_, and other +applications that require a long-lived connection to each user. + + +Quick links +----------- + +* `Documentation <http://www.tornadoweb.org/en/stable/>`_ +* `Source (github) <https://github.com/facebook/tornado>`_ +* `Mailing list <http://groups.google.com/group/python-tornado>`_ +* `Wiki <https://github.com/facebook/tornado/wiki/Links>`_ + +Hello, world +------------ + +Here is a simple "Hello, world" example web app for Tornado:: + + import tornado.ioloop + import tornado.web + + class MainHandler(tornado.web.RequestHandler): + def get(self): + self.write("Hello, world") + + application = tornado.web.Application([ + (r"/", MainHandler), + ]) + + if __name__ == "__main__": + application.listen(8888) + tornado.ioloop.IOLoop.instance().start() + +This example does not use any of Tornado's asynchronous features; for +that see this `simple chat room +<https://github.com/facebook/tornado/tree/master/demos/chat>`_. + +Installation +------------ + +**Automatic installation**:: + + pip install tornado + +Tornado is listed in `PyPI <http://pypi.python.org/pypi/tornado/>`_ and +can be installed with ``pip`` or ``easy_install``. Note that the +source distribution includes demo applications that are not present +when Tornado is installed in this way, so you may wish to download a +copy of the source tarball as well. + +**Manual installation**: Download the latest source from `PyPI +<http://pypi.python.org/pypi/tornado/>`_. + +.. parsed-literal:: + + tar xvzf tornado-$VERSION.tar.gz + cd tornado-$VERSION + python setup.py build + sudo python setup.py install + +The Tornado source code is `hosted on GitHub +<https://github.com/facebook/tornado>`_. + +**Prerequisites**: Tornado runs on Python 2.6, 2.7, 3.2, and 3.3. It has +no strict dependencies outside the Python standard library, although some +features may require one of the following libraries: + +* `unittest2 <https://pypi.python.org/pypi/unittest2>`_ is needed to run + Tornado's test suite on Python 2.6 (it is unnecessary on more recent + versions of Python) +* `concurrent.futures <https://pypi.python.org/pypi/futures>`_ is the + recommended thread pool for use with Tornado and enables the use of + ``tornado.netutil.ThreadedResolver``. It is needed only on Python 2; + Python 3 includes this package in the standard library. +* `pycurl <http://pycurl.sourceforge.net>`_ is used by the optional + ``tornado.curl_httpclient``. Libcurl version 7.18.2 or higher is required; + version 7.21.1 or higher is recommended. +* `Twisted <http://www.twistedmatrix.com>`_ may be used with the classes in + `tornado.platform.twisted`. +* `pycares <https://pypi.python.org/pypi/pycares>`_ is an alternative + non-blocking DNS resolver that can be used when threads are not + appropriate. +* `Monotime <https://pypi.python.org/pypi/Monotime>`_ adds support for + a monotonic clock, which improves reliability in environments + where clock adjustments are frequent. No longer needed in Python 3.3. + +**Platforms**: Tornado should run on any Unix-like platform, although +for the best performance and scalability only Linux (with ``epoll``) +and BSD (with ``kqueue``) are recommended (even though Mac OS X is +derived from BSD and supports kqueue, its networking performance is +generally poor so it is recommended only for development use). + +Discussion and support +---------------------- + +You can discuss Tornado on `the Tornado developer mailing list +<http://groups.google.com/group/python-tornado>`_, and report bugs on +the `GitHub issue trackier +<https://github.com/facebook/tornado/issues>`_. Links to additional +resources can be found on the `Tornado wiki +<https://github.com/facebook/tornado/wiki/Links>`_. + +Tornado is one of `Facebook's open source technologies +<http://developers.facebook.com/opensource/>`_. It is available under +the `Apache License, Version 2.0 +<http://www.apache.org/licenses/LICENSE-2.0.html>`_. + +This web site and all documentation is licensed under `Creative +Commons 3.0 <http://creativecommons.org/licenses/by/3.0/>`_. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/demos/benchmark/benchmark.py new/tornado-3.0.1/demos/benchmark/benchmark.py --- old/tornado-3.0/demos/benchmark/benchmark.py 2013-03-10 04:12:15.000000000 +0100 +++ new/tornado-3.0.1/demos/benchmark/benchmark.py 2013-04-07 18:57:45.000000000 +0200 @@ -39,6 +39,8 @@ # --n=15000 for its JIT to reach full effectiveness define("num_runs", type=int, default=1) +define("ioloop", type=str, default=None) + class RootHandler(RequestHandler): def get(self): self.write("Hello, world") @@ -51,6 +53,8 @@ def main(): parse_command_line() + if options.ioloop: + IOLoop.configure(options.ioloop) for i in xrange(options.num_runs): run() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/setup.py new/tornado-3.0.1/setup.py --- old/tornado-3.0/setup.py 2013-03-29 14:01:56.000000000 +0100 +++ new/tornado-3.0.1/setup.py 2013-04-09 05:26:30.000000000 +0200 @@ -25,7 +25,10 @@ kwargs = {} -version = "3.0" +version = "3.0.1" + +with open('README.rst') as f: + long_description = f.read() distutils.core.setup( name="tornado", @@ -64,5 +67,6 @@ 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ], + long_description=long_description, **kwargs ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/__init__.py new/tornado-3.0.1/tornado/__init__.py --- old/tornado-3.0/tornado/__init__.py 2013-03-29 14:02:01.000000000 +0100 +++ new/tornado-3.0.1/tornado/__init__.py 2013-04-09 05:26:46.000000000 +0200 @@ -25,5 +25,5 @@ # 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" -version_info = (3, 0, 0, 0) +version = "3.0.1" +version_info = (3, 0, 1, 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/auth.py new/tornado-3.0.1/tornado/auth.py --- old/tornado-3.0/tornado/auth.py 2013-03-19 01:55:06.000000000 +0100 +++ new/tornado-3.0.1/tornado/auth.py 2013-04-09 03:18:18.000000000 +0200 @@ -1096,6 +1096,7 @@ _OAUTH_AUTHORIZE_URL = "https://graph.facebook.com/oauth/authorize?" _OAUTH_NO_CALLBACKS = False + @_auth_return_future def get_authenticated_user(self, redirect_uri, client_id, client_secret, code, callback, extra_fields=None): """Handles the login for the Facebook user, returning a user object. @@ -1137,10 +1138,9 @@ client_secret, callback, fields)) def _on_access_token(self, redirect_uri, client_id, client_secret, - callback, fields, response): + future, fields, response): if response.error: - gen_log.warning('Facebook auth error: %s' % str(response)) - callback(None) + future.set_exception(AuthError('Facebook auth error: %s' % str(response))) return args = escape.parse_qs_bytes(escape.native_str(response.body)) @@ -1152,14 +1152,14 @@ self.facebook_request( path="/me", callback=self.async_callback( - self._on_get_user_info, callback, session, fields), + self._on_get_user_info, future, session, fields), access_token=session["access_token"], fields=",".join(fields) ) - def _on_get_user_info(self, callback, session, fields, user): + def _on_get_user_info(self, future, session, fields, user): if user is None: - callback(None) + future.set_result(None) return fieldmap = {} @@ -1167,8 +1167,9 @@ fieldmap[field] = user.get(field) fieldmap.update({"access_token": session["access_token"], "session_expires": session.get("expires")}) - callback(fieldmap) + future.set_result(fieldmap) + @_auth_return_future def facebook_request(self, path, callback, access_token=None, post_args=None, **args): """Fetches the given relative API path, e.g., "/btaylor/picture" @@ -1220,13 +1221,13 @@ else: http.fetch(url, callback=callback) - def _on_facebook_request(self, callback, response): + def _on_facebook_request(self, future, response): if response.error: - gen_log.warning("Error response %s fetching %s", response.error, - response.request.url) - callback(None) + future.set_exception(AuthError("Error response %s fetching %s", + response.error, response.request.url)) return - callback(escape.json_decode(response.body)) + + future.set_result(escape.json_decode(response.body)) def get_auth_http_client(self): """Returns the `.AsyncHTTPClient` instance to be used for auth requests. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/gen.py new/tornado-3.0.1/tornado/gen.py --- old/tornado-3.0/tornado/gen.py 2013-03-19 01:55:06.000000000 +0100 +++ new/tornado-3.0.1/tornado/gen.py 2013-04-01 00:29:44.000000000 +0200 @@ -147,7 +147,7 @@ if value is not None: raise ReturnValueIgnoredError( "@gen.engine functions cannot return values: " - "%r" % result) + "%r" % (value,)) assert value is None deactivate() runner = Runner(result, final_callback) @@ -155,7 +155,8 @@ return if result is not None: raise ReturnValueIgnoredError( - "@gen.engine functions cannot return values: %r" % result) + "@gen.engine functions cannot return values: %r" % + (result,)) deactivate() # no yield, so we're done return wrapper @@ -464,13 +465,13 @@ def register_callback(self, key): """Adds ``key`` to the list of callbacks.""" if key in self.pending_callbacks: - raise KeyReuseError("key %r is already pending" % key) + raise KeyReuseError("key %r is already pending" % (key,)) self.pending_callbacks.add(key) def is_ready(self, key): """Returns true if a result is available for ``key``.""" if key not in self.pending_callbacks: - raise UnknownKeyError("key %r is not pending" % key) + raise UnknownKeyError("key %r is not pending" % (key,)) return key in self.results def set_result(self, key, result): @@ -534,7 +535,8 @@ except Exception: self.exc_info = sys.exc_info() else: - self.exc_info = (BadYieldError("yielded unknown object %r" % yielded),) + self.exc_info = (BadYieldError( + "yielded unknown object %r" % (yielded,)),) finally: self.running = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/httpclient.py new/tornado-3.0.1/tornado/httpclient.py --- old/tornado-3.0/tornado/httpclient.py 2013-03-19 01:55:06.000000000 +0100 +++ new/tornado-3.0.1/tornado/httpclient.py 2013-04-09 03:37:22.000000000 +0200 @@ -373,7 +373,10 @@ def __init__(self, request, code, headers=None, buffer=None, effective_url=None, error=None, request_time=None, time_info=None, reason=None): - self.request = request + if isinstance(request, _RequestProxy): + self.request = request.request + else: + self.request = request self.code = code self.reason = reason or httputil.responses.get(code, "Unknown") if headers is not None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/netutil.py new/tornado-3.0.1/tornado/netutil.py --- old/tornado-3.0/tornado/netutil.py 2013-03-19 01:55:06.000000000 +0100 +++ new/tornado-3.0.1/tornado/netutil.py 2013-04-09 04:00:29.000000000 +0200 @@ -321,7 +321,7 @@ else: return ssl.wrap_socket(socket, **dict(context, **kwargs)) -if hasattr(ssl, 'match_hostname'): # python 3.2+ +if hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+ ssl_match_hostname = ssl.match_hostname SSLCertificateError = ssl.CertificateError else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/test/gen_test.py new/tornado-3.0.1/tornado/test/gen_test.py --- old/tornado-3.0/tornado/test/gen_test.py 2013-03-24 18:22:48.000000000 +0100 +++ new/tornado-3.0.1/tornado/test/gen_test.py 2013-04-01 00:28:16.000000000 +0200 @@ -125,6 +125,15 @@ self.stop() self.run_gen(f) + def test_with_arg_tuple(self): + @gen.engine + def f(): + (yield gen.Callback((1, 2)))((3, 4)) + res = yield gen.Wait((1, 2)) + self.assertEqual((3, 4), res) + self.stop() + self.run_gen(f) + def test_key_reuse(self): @gen.engine def f(): @@ -133,6 +142,14 @@ self.stop() self.assertRaises(gen.KeyReuseError, self.run_gen, f) + def test_key_reuse_tuple(self): + @gen.engine + def f(): + yield gen.Callback((1, 2)) + yield gen.Callback((1, 2)) + self.stop() + self.assertRaises(gen.KeyReuseError, self.run_gen, f) + def test_key_mismatch(self): @gen.engine def f(): @@ -141,6 +158,14 @@ self.stop() self.assertRaises(gen.UnknownKeyError, self.run_gen, f) + def test_key_mismatch_tuple(self): + @gen.engine + def f(): + yield gen.Callback((1, 2)) + yield gen.Wait((2, 3)) + self.stop() + self.assertRaises(gen.UnknownKeyError, self.run_gen, f) + def test_leaked_callback(self): @gen.engine def f(): @@ -148,6 +173,13 @@ self.stop() self.assertRaises(gen.LeakedCallbackError, self.run_gen, f) + def test_leaked_callback_tuple(self): + @gen.engine + def f(): + yield gen.Callback((1, 2)) + self.stop() + self.assertRaises(gen.LeakedCallbackError, self.run_gen, f) + def test_parallel_callback(self): @gen.engine def f(): @@ -167,6 +199,12 @@ yield 42 self.assertRaises(gen.BadYieldError, self.run_gen, f) + def test_bogus_yield_tuple(self): + @gen.engine + def f(): + yield (1, 2) + self.assertRaises(gen.BadYieldError, self.run_gen, f) + def test_reuse(self): @gen.engine def f(): @@ -404,6 +442,14 @@ with self.assertRaises(gen.ReturnValueIgnoredError): self.run_gen(f) + def test_sync_raise_return_value_tuple(self): + @gen.engine + def f(): + raise gen.Return((1, 2)) + + with self.assertRaises(gen.ReturnValueIgnoredError): + self.run_gen(f) + def test_async_raise_return_value(self): @gen.engine def f(): @@ -413,6 +459,15 @@ with self.assertRaises(gen.ReturnValueIgnoredError): self.run_gen(f) + def test_async_raise_return_value_tuple(self): + @gen.engine + def f(): + yield gen.Task(self.io_loop.add_callback) + raise gen.Return((1, 2)) + + with self.assertRaises(gen.ReturnValueIgnoredError): + self.run_gen(f) + def test_return_value(self): # It is an error to apply @gen.engine to a function that returns # a value. @@ -422,6 +477,16 @@ with self.assertRaises(gen.ReturnValueIgnoredError): self.run_gen(f) + + def test_return_value_tuple(self): + # It is an error to apply @gen.engine to a function that returns + # a value. + @gen.engine + def f(): + return (1, 2) + + with self.assertRaises(gen.ReturnValueIgnoredError): + self.run_gen(f) class GenCoroutineTest(AsyncTestCase): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/test/httpclient_test.py new/tornado-3.0.1/tornado/test/httpclient_test.py --- old/tornado-3.0/tornado/test/httpclient_test.py 2013-03-17 00:34:59.000000000 +0100 +++ new/tornado-3.0.1/tornado/test/httpclient_test.py 2013-04-09 03:42:19.000000000 +0200 @@ -334,6 +334,19 @@ self.assertEqual(e.code, 404) self.assertEqual(e.response.code, 404) + @gen_test + def test_reuse_request_from_response(self): + # The response.request attribute should be an HTTPRequest, not + # a _RequestProxy. + # This test uses self.http_client.fetch because self.fetch calls + # self.get_url on the input unconditionally. + url = self.get_url('/hello') + response = yield self.http_client.fetch(url) + self.assertEqual(response.request.url, url) + self.assertTrue(isinstance(response.request, HTTPRequest)) + response2 = yield self.http_client.fetch(response.request) + self.assertEqual(response2.body, b'Hello world!') + class RequestProxyTest(unittest.TestCase): def test_request_set(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/test/websocket_test.py new/tornado-3.0.1/tornado/test/websocket_test.py --- old/tornado-3.0/tornado/test/websocket_test.py 2013-03-17 00:34:59.000000000 +0100 +++ new/tornado-3.0.1/tornado/test/websocket_test.py 2013-04-09 05:08:51.000000000 +0200 @@ -1,17 +1,24 @@ -from tornado.testing import AsyncHTTPTestCase, gen_test -from tornado.web import Application -from tornado.websocket import WebSocketHandler, websocket_connect +from tornado.httpclient import HTTPError +from tornado.log import gen_log +from tornado.testing import AsyncHTTPTestCase, gen_test, bind_unused_port, ExpectLog +from tornado.web import Application, RequestHandler +from tornado.websocket import WebSocketHandler, websocket_connect, WebSocketError class EchoHandler(WebSocketHandler): def on_message(self, message): self.write_message(message, isinstance(message, bytes)) +class NonWebSocketHandler(RequestHandler): + def get(self): + self.write('ok') + class WebSocketTest(AsyncHTTPTestCase): def get_app(self): return Application([ ('/echo', EchoHandler), + ('/non_ws', NonWebSocketHandler), ]) @gen_test @@ -32,3 +39,30 @@ ws.read_message(self.stop) response = self.wait().result() self.assertEqual(response, 'hello') + + @gen_test + def test_websocket_http_fail(self): + with self.assertRaises(HTTPError) as cm: + yield websocket_connect( + 'ws://localhost:%d/notfound' % self.get_http_port(), + io_loop=self.io_loop) + self.assertEqual(cm.exception.code, 404) + + @gen_test + def test_websocket_http_success(self): + with self.assertRaises(WebSocketError): + yield websocket_connect( + 'ws://localhost:%d/non_ws' % self.get_http_port(), + io_loop=self.io_loop) + + @gen_test + def test_websocket_network_fail(self): + sock, port = bind_unused_port() + sock.close() + with self.assertRaises(HTTPError) as cm: + with ExpectLog(gen_log, ".*"): + yield websocket_connect( + 'ws://localhost:%d/' % port, + io_loop=self.io_loop, + connect_timeout=0.01) + self.assertEqual(cm.exception.code, 599) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/testing.py new/tornado-3.0.1/tornado/testing.py --- old/tornado-3.0/tornado/testing.py 2013-03-17 00:34:59.000000000 +0100 +++ new/tornado-3.0.1/tornado/testing.py 2013-04-03 02:27:41.000000000 +0200 @@ -40,9 +40,9 @@ import sys try: - from io import StringIO # py3 -except ImportError: from cStringIO import StringIO # py2 +except ImportError: + from io import StringIO # py3 # Tornado's own test suite requires the updated unittest module # (either py27+ or unittest2) so tornado.test.util enforces @@ -377,6 +377,11 @@ return wrapper +# Without this attribute, nosetests will try to run gen_test as a test +# anywhere it is imported. +gen_test.__test__ = False + + class LogTrapTestCase(unittest.TestCase): """A test case that captures and discards all logging output if the test passes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado/websocket.py new/tornado-3.0.1/tornado/websocket.py --- old/tornado-3.0/tornado/websocket.py 2013-03-19 01:55:06.000000000 +0100 +++ new/tornado-3.0.1/tornado/websocket.py 2013-04-09 05:03:45.000000000 +0200 @@ -46,6 +46,10 @@ xrange = range # py3 +class WebSocketError(Exception): + pass + + class WebSocketHandler(tornado.web.RequestHandler): """Subclass this class to create a basic WebSocket handler. @@ -740,12 +744,20 @@ }) super(WebSocketClientConnection, self).__init__( - io_loop, None, request, lambda: None, lambda response: None, + io_loop, None, request, lambda: None, self._on_http_response, 104857600, Resolver(io_loop=io_loop)) def _on_close(self): self.on_message(None) + def _on_http_response(self, response): + if not self.connect_future.done(): + if response.error: + self.connect_future.set_exception(response.error) + else: + self.connect_future.set_exception(WebSocketError( + "Non-websocket response")) + def _handle_1xx(self, code): assert code == 101 assert self.headers['Upgrade'].lower() == 'websocket' @@ -795,7 +807,7 @@ pass -def websocket_connect(url, io_loop=None, callback=None): +def websocket_connect(url, io_loop=None, callback=None, connect_timeout=None): """Client-side websocket support. Takes a url and returns a Future whose result is a @@ -803,7 +815,7 @@ """ if io_loop is None: io_loop = IOLoop.current() - request = httpclient.HTTPRequest(url) + request = httpclient.HTTPRequest(url, connect_timeout=connect_timeout) request = httpclient._RequestProxy( request, httpclient.HTTPRequest._DEFAULTS) conn = WebSocketClientConnection(io_loop, request) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado.egg-info/PKG-INFO new/tornado-3.0.1/tornado.egg-info/PKG-INFO --- old/tornado-3.0/tornado.egg-info/PKG-INFO 2013-03-29 14:09:07.000000000 +0100 +++ new/tornado-3.0.1/tornado.egg-info/PKG-INFO 2013-04-09 05:28:24.000000000 +0200 @@ -1,12 +1,128 @@ Metadata-Version: 1.1 Name: tornado -Version: 3.0 +Version: 3.0.1 Summary: Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. Home-page: http://www.tornadoweb.org/ Author: Facebook Author-email: [email protected] License: http://www.apache.org/licenses/LICENSE-2.0 -Description: UNKNOWN +Description: Tornado Web Server + ================== + + `Tornado <http://www.tornadoweb.org>`_ is a Python web framework and + asynchronous networking library, originally developed at `FriendFeed + <http://friendfeed.com>`_. By using non-blocking network I/O, Tornado + can scale to tens of thousands of open connections, making it ideal for + `long polling <http://en.wikipedia.org/wiki/Push_technology#Long_polling>`_, + `WebSockets <http://en.wikipedia.org/wiki/WebSocket>`_, and other + applications that require a long-lived connection to each user. + + + Quick links + ----------- + + * `Documentation <http://www.tornadoweb.org/en/stable/>`_ + * `Source (github) <https://github.com/facebook/tornado>`_ + * `Mailing list <http://groups.google.com/group/python-tornado>`_ + * `Wiki <https://github.com/facebook/tornado/wiki/Links>`_ + + Hello, world + ------------ + + Here is a simple "Hello, world" example web app for Tornado:: + + import tornado.ioloop + import tornado.web + + class MainHandler(tornado.web.RequestHandler): + def get(self): + self.write("Hello, world") + + application = tornado.web.Application([ + (r"/", MainHandler), + ]) + + if __name__ == "__main__": + application.listen(8888) + tornado.ioloop.IOLoop.instance().start() + + This example does not use any of Tornado's asynchronous features; for + that see this `simple chat room + <https://github.com/facebook/tornado/tree/master/demos/chat>`_. + + Installation + ------------ + + **Automatic installation**:: + + pip install tornado + + Tornado is listed in `PyPI <http://pypi.python.org/pypi/tornado/>`_ and + can be installed with ``pip`` or ``easy_install``. Note that the + source distribution includes demo applications that are not present + when Tornado is installed in this way, so you may wish to download a + copy of the source tarball as well. + + **Manual installation**: Download the latest source from `PyPI + <http://pypi.python.org/pypi/tornado/>`_. + + .. parsed-literal:: + + tar xvzf tornado-$VERSION.tar.gz + cd tornado-$VERSION + python setup.py build + sudo python setup.py install + + The Tornado source code is `hosted on GitHub + <https://github.com/facebook/tornado>`_. + + **Prerequisites**: Tornado runs on Python 2.6, 2.7, 3.2, and 3.3. It has + no strict dependencies outside the Python standard library, although some + features may require one of the following libraries: + + * `unittest2 <https://pypi.python.org/pypi/unittest2>`_ is needed to run + Tornado's test suite on Python 2.6 (it is unnecessary on more recent + versions of Python) + * `concurrent.futures <https://pypi.python.org/pypi/futures>`_ is the + recommended thread pool for use with Tornado and enables the use of + ``tornado.netutil.ThreadedResolver``. It is needed only on Python 2; + Python 3 includes this package in the standard library. + * `pycurl <http://pycurl.sourceforge.net>`_ is used by the optional + ``tornado.curl_httpclient``. Libcurl version 7.18.2 or higher is required; + version 7.21.1 or higher is recommended. + * `Twisted <http://www.twistedmatrix.com>`_ may be used with the classes in + `tornado.platform.twisted`. + * `pycares <https://pypi.python.org/pypi/pycares>`_ is an alternative + non-blocking DNS resolver that can be used when threads are not + appropriate. + * `Monotime <https://pypi.python.org/pypi/Monotime>`_ adds support for + a monotonic clock, which improves reliability in environments + where clock adjustments are frequent. No longer needed in Python 3.3. + + **Platforms**: Tornado should run on any Unix-like platform, although + for the best performance and scalability only Linux (with ``epoll``) + and BSD (with ``kqueue``) are recommended (even though Mac OS X is + derived from BSD and supports kqueue, its networking performance is + generally poor so it is recommended only for development use). + + Discussion and support + ---------------------- + + You can discuss Tornado on `the Tornado developer mailing list + <http://groups.google.com/group/python-tornado>`_, and report bugs on + the `GitHub issue trackier + <https://github.com/facebook/tornado/issues>`_. Links to additional + resources can be found on the `Tornado wiki + <https://github.com/facebook/tornado/wiki/Links>`_. + + Tornado is one of `Facebook's open source technologies + <http://developers.facebook.com/opensource/>`_. It is available under + the `Apache License, Version 2.0 + <http://www.apache.org/licenses/LICENSE-2.0.html>`_. + + This web site and all documentation is licensed under `Creative + Commons 3.0 <http://creativecommons.org/licenses/by/3.0/>`_. + Platform: UNKNOWN Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tornado-3.0/tornado.egg-info/SOURCES.txt new/tornado-3.0.1/tornado.egg-info/SOURCES.txt --- old/tornado-3.0/tornado.egg-info/SOURCES.txt 2013-03-29 14:09:09.000000000 +0100 +++ new/tornado-3.0.1/tornado.egg-info/SOURCES.txt 2013-04-09 05:28:26.000000000 +0200 @@ -1,4 +1,5 @@ MANIFEST.in +README.rst runtests.sh setup.py demos/appengine/README -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
