Commit Graph

1608 Commits

Author SHA1 Message Date
Ben Darnell e7d9e8a5b7 Update pyflakes version.
The new version no longer complains about all our conditional imports.
2013-02-05 19:51:51 -05:00
Ben Darnell d6d5e272b7 Add a test for non-login use of twitter_request. 2013-02-03 19:28:30 -05:00
Ben Darnell fa9534bb1b Add a script for setting up a windows VM for testing.
This works with the images provided by http://modern.ie.
2013-02-02 22:40:53 -05:00
Ben Darnell 5db74ae488 Protect the tornado.gen import in testing.py for app engine. 2013-01-27 20:16:58 -05:00
Ben Darnell 34edd2e802 Support lists of futures in @gen.engine. 2013-01-27 18:07:21 -05:00
Ben Darnell 8a9179f2d3 Add decorator for @gen.engine-like tests.
Futures are awkward to use in stop/wait tests, and this makes it possible
to be consistent between tests and regular code.

Uses the (now-renamed) deactivate_stack_context callback
to detect when a test finishes cleanly.
2013-01-27 17:54:08 -05:00
Ben Darnell 3a428c033d Rename future_wrap to return_future.
Allow exceptions from the initial synchronous phase to pass through
to the caller.  Add docs and tests.
2013-01-27 17:03:15 -05:00
Ben Darnell 747b895030 A couple of small 2.6-isms.
We can use namedtuple and the new 0o octal literal notation.
2013-01-27 16:28:35 -05:00
Ben Darnell 2baf3c02ab Centralize formatting of HTTP-style dates.
Use time.strftime, which turns out to be a bit faster than either
datetime.strftime or email.utils.formatdate.
2013-01-27 14:01:59 -05:00
Ben Darnell e5f4763938 Fix typo in next.rst. 2013-01-27 10:53:39 -05:00
Ben Darnell 9df2324656 Use httputil.HTTPHeaders for outgoing headers in RequestHandler.
It's still a bit slower, but less than the 10% noted in the old comment.
Case sensitivity here has proven more surprising and problematic than
expected as users try to overwrite headers set by the framework.
2013-01-26 15:52:28 -05:00
Ben Darnell bace588335 Note a performance improvement on PyPy in the release notes.
sys.exc_info() is very slow on pypy.  Commit
24c3d41748 removed an unconditional
call to sys.exc_info when there is no error.  Performance on
demo/benchmark/benchmark.py went from 3k qps to 5k.
2013-01-26 14:53:12 -05:00
Ben Darnell 65984591c9 Split up next.rst by module. 2013-01-26 13:33:52 -05:00
Ben Darnell b26c07b6fa Get the test suite passing on windows again. 2013-01-24 23:13:00 -05:00
Ben Darnell 279aaffa89 Get twisted_test running on python 3 too.
Twisted 12.3.0 can be installed from a source checkout on python3.
Some modules, including twisted.web, are not available so skip those
tests separately.
2013-01-23 23:23:57 -05:00
Ben Darnell efae6e04df Document --disable-ipv6 fix and only apply it when family==AF_UNSPEC. 2013-01-23 22:35:16 -05:00
bdarnell 1316fd60ce Merge pull request #670 from schlamar/patch-1
Fix bind_sockets when python is compiled with --disable-ipv6
2013-01-23 19:32:38 -08:00
Ben Darnell a5c1b54118 Preliminary support for ubuntu's python3-pycurl port. 2013-01-23 22:27:00 -05:00
Ben Darnell 60cc236c96 Add vagrant config for ubuntu 12.10.
This release is interesting because it includes a python3 port of
pycurl (which is difficult to use from tox but can at least be tested
manually).
2013-01-23 21:22:34 -05:00
Marc Schlaich 48e81baee2 Update tornado/netutil.py
`socket.getadrrinfo` yields some strange output if Python is compiled with `--disable-ipv6`, resulting in a `bad family` error.
See http://bugs.python.org/issue16208
2013-01-22 09:33:03 +01:00
Ben Darnell 443c7f34b8 Add server_hostname to IOStream.connect, for SNI and cert verification
SSL hostname verification now happens in SSLIOStream instead of
simple_httpclient (and supporting code has moved to netutil).
2013-01-20 22:33:03 -05:00
Ben Darnell 6355af9552 On py32+, methods that take ssl_options now also accept SSLContext objects.
This is necessary to support SNI and NPN.
2013-01-20 22:32:52 -05:00
Ben Darnell b3d8cd3074 Move TCPServer to its own module.
It's backwards-incompatible for people who used it directly, but that's
what 3.0 is for. ;)  TCPServer made it impossible to import netutil
from iostream due to cyclic imports, which seems backwards.
2013-01-20 22:32:52 -05:00
bdarnell ec884dbe3d Merge pull request #669 from mleonhard/master
Fix s3server.py to stop truncating downloads of images and other non-text files
2013-01-20 19:32:27 -08:00
Michael Leonhard 56fcc364f7 Fix s3server.py to stop truncating downloads of images and other non-text files 2013-01-20 16:48:05 -08:00
Ben Darnell 553145c755 Fix typos in TwistedIOLoop that always sent both read and write events to all handlers. 2013-01-20 16:06:57 -05:00
Ben Darnell 0c3c8f7620 Make autoreload close the IOLoop through the standard interface.
This makes it compatible with TwistedIOLoop.
2013-01-20 15:59:10 -05:00
Ben Darnell 9c26f969ab Fix some iter{items,keys,values} calls that slipped through the cracks.
Add tests for the functions that were thereby revealed to have none.
2013-01-20 15:59:01 -05:00
Ben Darnell 769bc52e11 Fix memory leak with gen.engine, RequestHandler.flush, and closed connections.
This was unfortunately difficult to reproduce in a unit test, even though
the test program attached to bug 660 easily reproduces it.

Closes #660.
2013-01-20 11:39:18 -05:00
Ben Darnell 45b2c30e89 web_test's wsgi_safe can be a class decorator too. 2013-01-19 17:14:25 -05:00
Ben Darnell 1532914422 Save the address family when an HTTPConnection is created.
Previously, if a non-IP socket was closed prematurely,
we would still try to reference stream.socket.family to decide
what format self.address was in, resulting in an uncaught exception.

Closes #656.
2013-01-19 17:05:32 -05:00
Ben Darnell dec2d7444d No more need to check for 'ssl is None' or 'multiprocessing is None' 2013-01-19 14:35:28 -05:00
Ben Darnell 05b8d05143 Use real class decorators and remove other py25-era workarounds 2013-01-19 14:33:37 -05:00
Ben Darnell e582e58792 Update autopep8 to 0.8.5 and run it. 2013-01-19 13:48:02 -05:00
Ben Darnell 3a8a0ebfc9 Remove conditional imports for py25.
ssl, json, and multiprocessing are now ubiquitous.

Also misc pyflakes cleanups (unused imports)
2013-01-19 13:38:48 -05:00
Ben Darnell 925302600f Remove the remaining traces of tornado.util.b. 2013-01-19 13:29:10 -05:00
Ben Darnell 16c6893ab4 Replace (most) calls to tornado.util.b() with byte literals.
sed -E -e "s/b\('([^']*)'\)/b'\1'/g" -i '' tornado/*.py
sed -E -e 's/b\("([^"]*)"\)/b"\1"/g' -i '' tornado/*.py
2013-01-19 13:17:02 -05:00
Ben Darnell 356045e7a8 Doc updates for py25 removal 2013-01-19 12:58:54 -05:00
Ben Darnell 6abdb91619 Remove py25 from travis.yml 2013-01-13 22:30:22 -05:00
Ben Darnell 217b7eb5fc Remove our custom epoll module now that we only support 2.6+. 2013-01-13 21:59:48 -05:00
Ben Darnell 7faeeb1537 Remove more py25 testing configs 2013-01-13 21:59:48 -05:00
Ben Darnell 900d5a2697 Get all the tests passing under py3 without 2to3 2013-01-13 21:31:55 -05:00
Ben Darnell ed78651057 Get autoreload working in py3 without 2to3. 2013-01-13 21:19:45 -05:00
Ben Darnell 051cd609e1 Checkpoint: tests can now be imported in python 3 without 2to3.
The tests are not passing, but this fixes up all the import-time problems.
The tests still work under 2to3 or python 2.
2013-01-13 21:15:45 -05:00
Ben Darnell 65df55da40 Convert print to a function and add future imports.
Automated with 2to3 and custom fixer.
2to3 -f print tornado > print.diff
2to3 -f print -d tornado > print_doctest.diff
maint/scripts/run_fixers.py -f future_import tornado > future.diff
cd tornado
git apply ../{print,print_doctest,future}.diff
2013-01-13 19:35:04 -05:00
Ben Darnell 0d693ee09d Change "except Type, value" to "except Type as value".
Necessary for py3, supported since py26.
2to3 -n -w -f except tornado
2013-01-13 19:16:33 -05:00
Ben Darnell d1bb68e38d Convert all unicode literals to tornado.util.u.
Mostly done by the fixer script with manual import updates,
although the raw literal in escape.py needed special handling.
2013-01-13 19:11:03 -05:00
Ben Darnell 45789e3f08 Add a simple sanity-check test for locale data. 2013-01-13 18:41:26 -05:00
Ben Darnell 8b40fafec7 Add tornado.util.u and a fixer script to start using it. 2013-01-13 18:40:18 -05:00
Ben Darnell 5cb63c9ca8 Drop py25 from the main tox.ini 2013-01-13 18:40:17 -05:00