Commit Graph

4145 Commits

Author SHA1 Message Date
Ben Darnell 4575264b67 test: Add gitattributes for test data files
This ensures that the tests pass on Windows regardless of the user's git
CRLF settings.
2020-01-18 14:18:50 -05:00
Ben Darnell 74a4ba0b3f
Merge pull request #2783 from kinow/fix-1824
Use bcrypt's checkpw instead of == in demo blog app
2019-12-08 16:01:27 -05:00
Bruno P. Kinoshita 0e6ec1728c use bcrypt's checkpw instead of == 2019-11-29 23:49:35 +13:00
Ben Darnell 18d7026853
Merge pull request #2780 from bdarnell/lint-updates
lint: Update black and mypy
2019-11-23 15:48:43 -05:00
Ben Darnell 44ae52ceb4 lint: Use newer mypy
This required some minor code changes, mainly some adjustments in tests
(which are now analyzed more thoroughly in spite of being mostly
unannotated), and some changes to placement of type:ignore comments.
2019-11-23 15:40:37 -05:00
Ben Darnell 8837c30037 lint: Upgrade to new version of black 2019-11-23 14:44:11 -05:00
Ben Darnell 29b19991a1 build: Run docs and lint on py38
This requires moving some noqa comments due to 3.8's changes to the
ast module.
2019-11-23 14:44:11 -05:00
Mike DePalatis 2054f476cc web: Update hashing algorithm in StaticFileHandler (#2778)
Addresses #2776.
2019-11-23 14:42:56 -05:00
Ben Darnell 1418880b2b
Merge pull request #2777 from mivade/remove-speedups-py2-support
Housekeeping: Remove legacy Python support in speedups.c
2019-11-23 13:08:34 -05:00
Ben Darnell 5225704634
Merge pull request #2779 from bdarnell/ci-fix
ci: Don't run the full test suite on python 3.5.2
2019-11-23 12:25:41 -05:00
Ben Darnell f1f27efeec ci: Don't run full test suite on python 3.5.2 2019-11-23 12:09:27 -05:00
Michael V. DePalatis 8b231e0716 Remove legacy Python support in speedups.c 2019-11-21 12:31:55 -07:00
Ben Darnell 682ff8dec2
Merge pull request #2772 from ploxiln/fork_doc_exit
process: correct docs of fork_processes exit behavior
2019-11-11 21:49:40 -05:00
Pierce Lopez a761eff849 process: correct docs of fork_processes exit behavior
fixes #2771
2019-11-10 12:43:27 -05:00
Ben Darnell 984aba0a20
Merge pull request #2768 from bdarnell/ci-revamp
build: Revamp test/CI configuration
2019-11-03 17:08:52 -05:00
Ben Darnell e145a36992 build: Revamp test/CI configuration
Reduce tox matrix to one env per python version, with two extra builds
for lint and docs. Delegate to tox from travis-ci.

Add 3.8 to testing. Simplify by dropping coverage reporting and
"no-deps" test runs.
2019-11-03 16:57:25 -05:00
Ben Darnell 467dfb0d70
Merge pull request #2767 from bdarnell/fix-lint
demos: Fix lint in webspider demo
2019-11-03 10:49:55 -05:00
Ben Darnell 4f5965827e demos: Fix lint in webspider demo
Updates #2765
2019-11-03 09:57:48 -05:00
Ben Darnell 234f9b863b
Merge pull request #2765 from jvansan:master
Dead link handling in webspider example
2019-11-03 09:51:18 -05:00
Ben Darnell d218026376
Merge pull request #2766 from tornadoweb/pin-black
ci: Pin version of black
2019-11-03 09:47:37 -05:00
Ben Darnell 2b153ad534 ci: Pin version of black
A new release of black changed the way some of our files are formatted,
so use a fixed version in CI.
2019-11-02 17:37:36 -04:00
Jeff van Santen 90ef9a1bf7
Dead link handling
Added an extra set for handling dead links, and reporting.

One consequence of this is that using this script will "work" offline, but will report that some all the links were not fetched.
2019-11-01 17:11:52 -07:00
Ben Darnell d81d685dd6
Merge pull request #2727 from andersk/304
Clear fewer headers on 1xx/204/304 responses
2019-10-20 22:34:18 -04:00
Ben Darnell 32377f2c2c
Merge pull request #2745 from remram44/re-unescape
Fix unescaping of regex routes
2019-10-20 22:16:10 -04:00
Ben Darnell 865b6f7298
Merge pull request #2748 from supakeen/readme-improvements
Use HTTPS link for tornado website.
2019-10-16 21:45:58 -04:00
Ben Darnell 8615af4411
Merge pull request #2750 from jbampton/simplify-statements
Simplify chained comparisons.
2019-10-16 21:34:13 -04:00
Ben Darnell dc36d124bc
Merge pull request #2755 from tornadoweb/dependabot/pip/maint/twisted-19.7.0
build(deps): bump twisted from 19.2.1 to 19.7.0 in /maint
2019-10-16 21:31:40 -04:00
dependabot[bot] 089ea22ac4
build(deps): bump twisted from 19.2.1 to 19.7.0 in /maint
Bumps [twisted](https://github.com/twisted/twisted) from 19.2.1 to 19.7.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst)
- [Commits](https://github.com/twisted/twisted/compare/twisted-19.2.1...twisted-19.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-17 01:14:26 +00:00
Ben Darnell 280478cc13
Merge pull request #2741 from khasanovbi/fix_head_transfer_encoding_chunked
Fix extra data sending at HEAD response with Transfer-Encoding: Chunked
2019-10-16 20:54:06 -04:00
John Bampton ed1c34fde3 Simplify chained comparison. 2019-10-06 13:05:58 +10:00
supakeen 3cc3a13d45 Use HTTPS link for tornado website. 2019-10-05 10:52:09 +00:00
Remi Rampin 5b9adb4a59 Fix unescaping of regex routes
Previously, only the part before the first '(' would be correctly
unescaped.
2019-10-04 11:24:44 -04:00
Remi Rampin 318b95dd4f Add test for unescaping with groups 2019-10-04 11:24:44 -04:00
Bulat Khasanov f1d90f71b0 Omit Transfer-Encoding header for HEAD response 2019-09-08 18:06:55 +03:00
Bulat Khasanov 9c927ffb85 Fix extra data sending at HEAD response with Transfer-Encoding: Chunked 2019-09-08 16:31:34 +03:00
Anders Kaseorg f19f868915 Clear fewer headers on 1xx/204/304 responses
This function is called on more than just 304 responses; it’s
important to permit the Allow header on 204 responses.  Also, the
relevant RFCs have changed significantly.

Fixes #2726.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-09-03 20:10:02 -07:00
Ben Darnell ff985fe509
Merge pull request #2723 from bluetech/perf1
httputil: A couple of small performance improvements
2019-09-02 13:20:28 -04:00
Ben Darnell 0cdaca462b
Merge pull request #2735 from ploxiln/body_args_bytes
parse_body_arguments: allow incomplete url-escaping
2019-09-02 12:12:02 -04:00
Pierce Lopez 3d30ca1ad9 httputil.parse_body_arguments: allow incomplete url-escaping
support x-www-form-urlencoded body with values consisting of
encoded bytes which are not url-encoded into ascii
(it seems other web frameworks often support this)

add bytes qs support to escape.parse_qs_bytes,
leave str qs support for backwards compatibility
2019-08-31 00:26:59 -04:00
Pierce Lopez 500adb0d8c tests: replace remaining assertEquals() with assertEqual()
assertEquals() is deprecated, and python3.7/pytest can warn about it
2019-08-31 00:16:08 -04:00
Semen Zhydenko 8e5ecad25e spelling corrections
* maintainance -> maintenance

* recieving -> receiving
2019-08-11 19:44:12 -04:00
Ben Darnell 131eee0299
Merge pull request #2725 from bdarnell/ssl-win-py374
test: Disable TLS 1.3 in one test
2019-08-11 19:43:01 -04:00
Ben Darnell 4172483c35 test: Disable TLS 1.3 in one test
This test started failing on windows CI with an upgrade to python
3.7.4 (which bundles a newer version of openssl). Disable tls 1.3 for
now.

Possibly related to #2536
2019-08-10 23:05:00 -04:00
Ran Benita 61a535b261 httputil: use compiled re patterns
This is slightly faster than using the builtin cache, e.g.:

With benchmark below (Python 3.7, Linux):

before: 0.7284867879934609
after:  0.2657967659761198

```py
import re
from time import perf_counter

line = 'HTTP/1.1'

_http_version_re = re.compile(r"^HTTP/1\.[0-9]$")

start = perf_counter()
for i in range(1000000):
    _http_version_re.match(line)
print(perf_counter() - start)

start = perf_counter()
for i in range(1000000):
    re.match(r"^HTTP/1\.[0-9]$", line)
print(perf_counter() - start)
```
2019-08-06 19:24:52 +03:00
Ran Benita 549edaf64d httputil: cache header normalization with @lru_cache instead of hand-rolling
Tornado is now py3-only so @lru_cache is always available.

Performance is about the same. Benchmark below. Python 3.7 on Linux.

before, cached:   0.9121252089971676
before, uncached: 13.358482279989403

after, cached:    0.9175888689933345
after, uncached:  11.085199063003529

```py
from time import perf_counter

names = [f'sOMe-RanDOM-hEAdeR-{i}' for i in range(1000)]

from tornado.httputil import _normalize_header
start = perf_counter()
for i in range(10000):
    # _normalize_header.cache_clear()
    for name in names:
        _normalize_header(name)
print(perf_counter() - start)

from tornado.httputil import _NormalizedHeaderCache
start = perf_counter()
_normalized_headers = _NormalizedHeaderCache(1000)
for i in range(10000):
    # _normalized_headers = _NormalizedHeaderCache(1000)
    for name in names:
        _normalized_headers[name]
print(perf_counter() - start)
```
2019-08-06 18:33:33 +03:00
Ben Darnell 444f4cd198
Merge pull request #2692 from mivade/docs-blog-example-update
Update database backend reference
2019-08-02 10:38:08 -04:00
Ben Darnell 2f33503c6b
Merge pull request #2715 from mivade/template-optional-autoescape-typing
Mark Template autoescape kwarg as Optional
2019-08-02 09:44:11 -04:00
Ben Darnell 4ac3d54396
Merge pull request #2707 from remram44/patch-1
Strip documentation about removed argument
2019-08-02 09:38:12 -04:00
Michael V. DePalatis 1bef9de6e6 Mark Template autoescape kwarg as Optional 2019-07-26 11:01:11 -06:00
Remi Rampin 71e3eb7bf6
Strip documentation about removed argument 2019-07-17 14:50:19 -07:00