]> git.ipfire.org Git - thirdparty/tornado.git/log
thirdparty/tornado.git
8 years agoFix various typos in testing.py 1825/head
Samuel Dion-Girardeau [Fri, 9 Sep 2016 01:42:51 +0000 (21:42 -0400)] 
Fix various typos in testing.py

8 years agoMerge pull request #1823 from SuminAndrew/update-curl-version
Ben Darnell [Tue, 6 Sep 2016 09:24:53 +0000 (17:24 +0800)] 
Merge pull request #1823 from SuminAndrew/update-curl-version

deprecate libcurl < 7.22.0 and remove Ubuntu 10.04 Vagrant configs

8 years agodeprecate libcurl < 7.22.0 and remove Ubuntu 10.04 Vagrant configs 1823/head
Andrey Sumin [Tue, 6 Sep 2016 08:28:28 +0000 (11:28 +0300)] 
deprecate libcurl < 7.22.0 and remove Ubuntu 10.04 Vagrant configs

8 years agodocs: Document some subtleties of native coroutines
Ben Darnell [Mon, 5 Sep 2016 13:35:57 +0000 (21:35 +0800)] 
docs: Document some subtleties of native coroutines

8 years agowebsocket: Add security warning to check_origin docs
Ben Darnell [Mon, 5 Sep 2016 13:18:20 +0000 (21:18 +0800)] 
websocket: Add security warning to check_origin docs

8 years agohttpserver_test: increase timeout
Ben Darnell [Mon, 5 Sep 2016 13:13:32 +0000 (21:13 +0800)] 
httpserver_test: increase timeout

This test was flaky in https://travis-ci.org/tornadoweb/tornado/jobs/157573739

8 years agoMerge pull request #1818 from zakkie/fix/doc-string-print
Ben Darnell [Mon, 5 Sep 2016 13:08:00 +0000 (21:08 +0800)] 
Merge pull request #1818 from zakkie/fix/doc-string-print

use print function insted of stetement at doc-string

8 years agomake sure to same output on python 2 and 3 1818/head
Akihiro Yamazaki [Mon, 5 Sep 2016 12:36:37 +0000 (21:36 +0900)] 
make sure to same output on python 2 and 3

8 years agoMerge pull request #1819 from wonderay/master
Ben Darnell [Mon, 5 Sep 2016 11:52:31 +0000 (19:52 +0800)] 
Merge pull request #1819 from wonderay/master

curl_httpclient: Add proxy_auth_mode to support 'digest' for proxy authentication

8 years agoMerge pull request #1782 from AaronOpfer/1769
Ben Darnell [Mon, 5 Sep 2016 08:06:51 +0000 (16:06 +0800)] 
Merge pull request #1782 from AaronOpfer/1769

Tie Runner lifetime to lifetime of result future or coroutine function (whichever is GCed first)

8 years agocurl_httpclient: Add proxy_auth_mode to support digest for proxy authentication 1819/head
zhimin [Fri, 2 Sep 2016 09:23:09 +0000 (17:23 +0800)] 
curl_httpclient: Add proxy_auth_mode to support digest for proxy authentication

8 years agouse print function insted of stetement at doc-string
Akihiro Yamazaki [Fri, 2 Sep 2016 05:52:06 +0000 (14:52 +0900)] 
use print function insted of stetement at doc-string

8 years agoMerge pull request #1815 from mike820324/master
A. Jesse Jiryu Davis [Mon, 29 Aug 2016 16:42:04 +0000 (12:42 -0400)] 
Merge pull request #1815 from mike820324/master

Add import tcpclient test in import_test

8 years agoUpdate import_test. 1815/head
mike820324 [Mon, 29 Aug 2016 02:03:09 +0000 (10:03 +0800)] 
Update import_test.

- Add test for import tcpclient
- Remove comment line.

8 years agoMerge pull request #1808 from darabos/patch-1
A. Jesse Jiryu Davis [Fri, 26 Aug 2016 02:06:04 +0000 (22:06 -0400)] 
Merge pull request #1808 from darabos/patch-1

Fix "resuse_port" typo in documentation

8 years agoFix typo in documentation. 1808/head
Daniel Darabos [Wed, 24 Aug 2016 14:39:58 +0000 (16:39 +0200)] 
Fix typo in documentation.

8 years agoMerge pull request #1805 from nvllsvm/master
Ben Darnell [Sat, 20 Aug 2016 15:56:15 +0000 (11:56 -0400)] 
Merge pull request #1805 from nvllsvm/master

Fix comment typos

8 years agoFix typos 1805/head
Andrew Rabert [Sat, 20 Aug 2016 15:25:21 +0000 (11:25 -0400)] 
Fix typos

8 years agoTie Runner lifetime to Future's existence 1782/head
Aaron Opfer [Tue, 26 Jul 2016 13:45:08 +0000 (08:45 -0500)] 
Tie Runner lifetime to Future's existence

Fixes #1769

8 years agoMerge pull request #1797 from mivade/chat-demo-update
A. Jesse Jiryu Davis [Sun, 14 Aug 2016 19:17:58 +0000 (15:17 -0400)] 
Merge pull request #1797 from mivade/chat-demo-update

Chat demo update

8 years agoClear input when submitting message 1797/head
Michael V. DePalatis [Fri, 12 Aug 2016 14:53:05 +0000 (16:53 +0200)] 
Clear input when submitting message

8 years agoUpdate chat demo for jQuery 3.1
Michael V. DePalatis [Fri, 12 Aug 2016 14:37:20 +0000 (16:37 +0200)] 
Update chat demo for jQuery 3.1

8 years agoMerge pull request #1794 from mivade/tcp-demo
Ben Darnell [Fri, 12 Aug 2016 13:59:13 +0000 (09:59 -0400)] 
Merge pull request #1794 from mivade/tcp-demo

Add TCP echo demo

8 years agoAdd suffix to README 1794/head
Michael V. DePalatis [Fri, 12 Aug 2016 06:29:55 +0000 (08:29 +0200)] 
Add suffix to README

8 years agoRemove unused clients set
Michael V. DePalatis [Fri, 12 Aug 2016 06:29:24 +0000 (08:29 +0200)] 
Remove unused clients set

8 years agoInclude pared-down version of echo server in docs
Michael V. DePalatis [Wed, 10 Aug 2016 20:04:20 +0000 (22:04 +0200)] 
Include pared-down version of echo server in docs

8 years agoAdd TCP echo demo
Michael V. DePalatis [Wed, 10 Aug 2016 19:55:55 +0000 (21:55 +0200)] 
Add TCP echo demo

8 years agoMerge pull request #1795 from ajdavis/fix-add-reader-sphinx-err
Ben Darnell [Fri, 12 Aug 2016 00:50:02 +0000 (20:50 -0400)] 
Merge pull request #1795 from ajdavis/fix-add-reader-sphinx-err

Update reference to asyncio's add_reader doc

8 years agoUpdate reference to asyncio's add_reader doc 1795/head
A. Jesse Jiryu Davis [Thu, 11 Aug 2016 19:24:27 +0000 (15:24 -0400)] 
Update reference to asyncio's add_reader doc

8 years agoMerge pull request #1792 from samuelchen/demo_websocket_update 1487/head
A. Jesse Jiryu Davis [Tue, 9 Aug 2016 02:19:50 +0000 (22:19 -0400)] 
Merge pull request #1792 from samuelchen/demo_websocket_update

update demo/websocket for updating JQuery to 3.1.0

8 years agoupdate demo/websocket for updating JQuery to 3.1.0 1792/head
Samuel Chen [Mon, 8 Aug 2016 08:01:50 +0000 (16:01 +0800)] 
update demo/websocket for updating JQuery to 3.1.0

9 years agoMerge pull request #1786 from mr-ping/master
A. Jesse Jiryu Davis [Tue, 2 Aug 2016 12:46:51 +0000 (08:46 -0400)] 
Merge pull request #1786 from mr-ping/master

Change the address of Morsel description

9 years agoChange the address of Morsel description 1786/head
Ping Yang [Tue, 2 Aug 2016 11:37:37 +0000 (19:37 +0800)] 
Change the address of Morsel description

9 years agoMerge pull request #1783 from matee911/master 1634/head
Ben Darnell [Wed, 27 Jul 2016 18:47:56 +0000 (14:47 -0400)] 
Merge pull request #1783 from matee911/master

docs: Fixed typo in release notes

9 years agoFixed typo in release notes 1783/head
matee [Wed, 27 Jul 2016 14:10:12 +0000 (16:10 +0200)] 
Fixed typo in release notes

9 years agoMerge pull request #1781 from bdarnell/options-path
Ben Darnell [Tue, 26 Jul 2016 14:05:10 +0000 (10:05 -0400)] 
Merge pull request #1781 from bdarnell/options-path

options_test: Absolutize `__file__`

9 years agooptions_test: Absolutize __file__ 1781/head
Ben Darnell [Tue, 26 Jul 2016 04:03:11 +0000 (00:03 -0400)] 
options_test: Absolutize __file__

Python 3.4 guarantees an absolute path, but in older versions relative
paths are used in some cases.

Fixes #1780

9 years agotravis.yml: Reproduce #1780 in CI
Ben Darnell [Tue, 26 Jul 2016 03:45:45 +0000 (23:45 -0400)] 
travis.yml: Reproduce #1780 in CI

9 years agoMerge pull request #1778 from protoss-player/master
Ben Darnell [Mon, 25 Jul 2016 01:35:46 +0000 (21:35 -0400)] 
Merge pull request #1778 from protoss-player/master

Fix for uppercase "Transfer-Encoding" values

9 years agohttpclient: clarify docs of HTTPResponse.body
Ben Darnell [Mon, 25 Jul 2016 00:58:27 +0000 (20:58 -0400)] 
httpclient: clarify docs of HTTPResponse.body

Closes #1775

9 years agoMerge pull request #1776 from SuminAndrew/exec_in-rewrite
Ben Darnell [Mon, 25 Jul 2016 00:52:23 +0000 (20:52 -0400)] 
Merge pull request #1776 from SuminAndrew/exec_in-rewrite

simplify tornado.util.exec_in

9 years agoMerge pull request #1772 from stiletto/master
Ben Darnell [Mon, 25 Jul 2016 00:45:13 +0000 (20:45 -0400)] 
Merge pull request #1772 from stiletto/master

curl_httpclient: Set curl PROTOCOLS and REDIR_PROTOCOLS to HTTP|HTTPS

9 years agoBump master version number to 4.5.dev1
Ben Darnell [Sat, 23 Jul 2016 17:26:17 +0000 (13:26 -0400)] 
Bump master version number to 4.5.dev1

9 years agoSet version number to 4.4.1 v4.4.1
Ben Darnell [Sat, 23 Jul 2016 16:27:16 +0000 (12:27 -0400)] 
Set version number to 4.4.1

9 years agoMerge pull request #1777 from bdarnell/non-reversible-url
Ben Darnell [Sat, 23 Jul 2016 16:13:51 +0000 (12:13 -0400)] 
Merge pull request #1777 from bdarnell/non-reversible-url

web: URLs that cannot be unescaped should be allowed

9 years agoFix handling of chunked-encoded requests with uppercase "Transfer-Encoding" value 1778/head
Vadim Semenov [Fri, 22 Jul 2016 19:28:30 +0000 (22:28 +0300)] 
Fix handling of chunked-encoded requests with uppercase "Transfer-Encoding" value

`HTTP1Connection._can_keep_alive` applied lower() to the header's value, but
`_read_body` didn't.

9 years agoweb: URLs that cannot be unescaped should be allowed 1777/head
Ben Darnell [Fri, 22 Jul 2016 18:28:52 +0000 (14:28 -0400)] 
web: URLs that cannot be unescaped should be allowed

Fixes a regression in version 4.4

Fixes #1770

9 years agosimplify tornado.util.exec_in 1776/head
Andrey Sumin [Thu, 21 Jul 2016 13:11:06 +0000 (16:11 +0300)] 
simplify tornado.util.exec_in

9 years agocurl_httpclient: Set curl PROTOCOLS and REDIR_PROTOCOLS to HTTP|HTTPS 1772/head
stiletto [Tue, 19 Jul 2016 20:46:02 +0000 (00:46 +0400)] 
curl_httpclient: Set curl PROTOCOLS and REDIR_PROTOCOLS to HTTP|HTTPS

9 years agoSet version number to 4.4 v4.4.0
Ben Darnell [Fri, 15 Jul 2016 14:53:37 +0000 (10:53 -0400)] 
Set version number to 4.4

9 years agoMerge pull request #1544 from gitter-badger/gitter-badge
Ben Darnell [Wed, 13 Jul 2016 02:52:05 +0000 (22:52 -0400)] 
Merge pull request #1544 from gitter-badger/gitter-badge

Add a Gitter chat badge to README.rst

9 years agoAdd ExpectLog to a noisy test case
Ben Darnell [Sun, 10 Jul 2016 15:04:21 +0000 (11:04 -0400)] 
Add ExpectLog to a noisy test case

9 years agodemos/benchmark: use current() instead of instance()
Ben Darnell [Sun, 10 Jul 2016 13:54:22 +0000 (09:54 -0400)] 
demos/benchmark: use current() instead of instance()

Improves compatibility with some IOLoop implementations.

9 years agoSet version number to 4.4b1 v4.4.0b1
Ben Darnell [Fri, 8 Jul 2016 18:16:41 +0000 (14:16 -0400)] 
Set version number to 4.4b1

9 years agoDocs and release notes for 4.4
Ben Darnell [Fri, 8 Jul 2016 18:07:26 +0000 (14:07 -0400)] 
Docs and release notes for 4.4

9 years agoMerge pull request #1743 from nickcoutsos/204-content-length
Ben Darnell [Fri, 1 Jul 2016 16:06:39 +0000 (18:06 +0200)] 
Merge pull request #1743 from nickcoutsos/204-content-length

Allow 204 responses without Content-Length/Transfer-Encoding

9 years agoSkip testing malformed 204 responses for curl http client 1743/head
Nick Coutsos [Thu, 23 Jun 2016 02:45:53 +0000 (22:45 -0400)] 
Skip testing malformed 204 responses for curl http client

9 years agoReorganize 204-related test cases
Nick Coutsos [Tue, 21 Jun 2016 23:34:55 +0000 (19:34 -0400)] 
Reorganize 204-related test cases

9 years agohttputil: Remove extraneous whitespace in str(HTTPHeaders)
Ben Darnell [Thu, 16 Jun 2016 01:53:34 +0000 (21:53 -0400)] 
httputil: Remove extraneous whitespace in str(HTTPHeaders)

9 years agohttputil: add __str__ method to HTTPHeader
zjjott [Wed, 4 May 2016 09:52:33 +0000 (17:52 +0800)] 
httputil: add __str__ method to HTTPHeader

9 years agoMerge pull request #1750 from bdarnell/nightly
Ben Darnell [Sun, 12 Jun 2016 22:40:11 +0000 (15:40 -0700)] 
Merge pull request #1750 from bdarnell/nightly

test: Silence PendingDeprecationWarning on nightly

9 years agotest: Silence PendingDeprecationWarning on nightly python 1750/head
Ben Darnell [Sun, 12 Jun 2016 20:28:35 +0000 (16:28 -0400)] 
test: Silence PendingDeprecationWarning on nightly python

9 years agoMerge pull request #1744 from zhulongcheng/line-too-long
Ben Darnell [Sun, 12 Jun 2016 19:26:27 +0000 (12:26 -0700)] 
Merge pull request #1744 from zhulongcheng/line-too-long

line too long

9 years agonetutil_test: use 127.0.0.1 instead of localhost
Ben Darnell [Sun, 12 Jun 2016 18:12:45 +0000 (14:12 -0400)] 
netutil_test: use 127.0.0.1 instead of localhost

The first binding of the port was to 127.0.0.1, so the second should be
too. This may solve #1734.

9 years agoAllow any yieldable in with_timeout
Ben Darnell [Sun, 12 Jun 2016 17:41:20 +0000 (13:41 -0400)] 
Allow any yieldable in with_timeout

9 years agoStandardize exceptions raised by Resolvers
Ben Darnell [Sun, 12 Jun 2016 16:22:44 +0000 (12:22 -0400)] 
Standardize exceptions raised by Resolvers

Fixes #1721

9 years agoline too long 1744/head
zhulongcheng [Wed, 8 Jun 2016 14:41:27 +0000 (22:41 +0800)] 
line too long

9 years agoAllow 204 responses without Content-Length/Transfer-Encoding
Nick Coutsos [Wed, 8 Jun 2016 01:15:17 +0000 (21:15 -0400)] 
Allow 204 responses without Content-Length/Transfer-Encoding

9 years agoMerge pull request #1728 from mivade/aiomainloop-hint
Ben Darnell [Sat, 4 Jun 2016 22:13:31 +0000 (18:13 -0400)] 
Merge pull request #1728 from mivade/aiomainloop-hint

Add hint about installing AsyncIOMainLoop early

9 years agoMerge pull request #1731 from adamchainz/readthedocs.io
Ben Darnell [Sat, 4 Jun 2016 22:12:26 +0000 (18:12 -0400)] 
Merge pull request #1731 from adamchainz/readthedocs.io

Convert readthedocs link for their .org -> .io migration for hosted projects

9 years agoConvert readthedocs link for their .org -> .io migration for hosted projects 1731/head
Adam Chainz [Sun, 29 May 2016 14:04:33 +0000 (15:04 +0100)] 
Convert readthedocs link for their .org -> .io migration for hosted projects

As per their email ‘Changes to project subdomains’:

> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.

Test Plan: Manually visited all the links I’ve modified.

9 years agoMake note on alternative IOLoops more general 1728/head
Michael V. DePalatis [Sat, 28 May 2016 17:37:48 +0000 (19:37 +0200)] 
Make note on alternative IOLoops more general

9 years agoMerge pull request #1727 from xiyanxiyan10/master
Ben Darnell [Sat, 28 May 2016 17:29:56 +0000 (13:29 -0400)] 
Merge pull request #1727 from xiyanxiyan10/master

better format for process.py

9 years agoMerge pull request #1729 from dvolodin7/patch-1
Ben Darnell [Sat, 28 May 2016 17:01:37 +0000 (13:01 -0400)] 
Merge pull request #1729 from dvolodin7/patch-1

_Timeout.__lt__ speedup

9 years agoMerge pull request #1725 from LocutusOfBorg/patch-1
Ben Darnell [Sat, 28 May 2016 16:43:01 +0000 (12:43 -0400)] 
Merge pull request #1725 from LocutusOfBorg/patch-1

Fix testsuite failure when sockets is not defined

9 years agoMerge pull request #1720 from daftshady/master
Ben Darnell [Sat, 28 May 2016 16:08:27 +0000 (12:08 -0400)] 
Merge pull request #1720 from daftshady/master

Fixed #1718

9 years ago_Timeout.__lt__ speedup 1729/head
Dmitry Volodin [Wed, 25 May 2016 22:17:38 +0000 (02:17 +0400)] 
_Timeout.__lt__ speedup

One of our services uses a lots of callbacks (~15k per IOLoop) and performs massive network IO. During profiling we'd found that significant amount of time consumed in the _Timeout.__lt__ method. Current implementation constantly builds two tuples per comparison. Proposed one pre-builds tuple
during _Timeout creation. Its about ~40% faster.

In [1]: from tornado.ioloop import _Timeout, IOLoop
In [2]: io = IOLoop.current()
In [3]: t0 = _Timeout(io.time(), None, io)
In [4]: t1 = _Timeout(io.time(), None, io)
In [5]: %timeit t0 < t1
1000000 loops, best of 3: 587 ns per loop
In [6]: %timeit t0 < t1
1000000 loops, best of 3: 336 ns per loop

9 years agoAdd hint about installing AsyncIOMainLoop early
Michael V. DePalatis [Wed, 25 May 2016 17:56:34 +0000 (19:56 +0200)] 
Add hint about installing AsyncIOMainLoop early

9 years agobetter format for process.py 1727/head
xiyanxiyan10 [Wed, 25 May 2016 09:27:06 +0000 (17:27 +0800)] 
better format for process.py

9 years agoFix testsuite failure when sockets is not defined 1725/head
Gianfranco Costamagna [Tue, 24 May 2016 10:29:51 +0000 (12:29 +0200)] 
Fix testsuite failure when sockets is not defined

this fixes the UnboundLocalError issue
"UnboundLocalError: local variable 'sockets' referenced before assignment"
Thanks Ondřej Nový for the help

9 years agoUsed read_until_close instead of relying on timing 1720/head
daftshady [Sun, 22 May 2016 05:05:08 +0000 (14:05 +0900)] 
Used read_until_close instead of relying on timing

9 years agoSkip a flaky test on AsyncIOLoop
Ben Darnell [Sun, 22 May 2016 04:35:44 +0000 (00:35 -0400)] 
Skip a flaky test on AsyncIOLoop

9 years agoSkip another subprocess test that is flaky on twisted
Ben Darnell [Sun, 22 May 2016 04:09:58 +0000 (00:09 -0400)] 
Skip another subprocess test that is flaky on twisted

9 years agoMerge pull request #1722 from bdarnell/windows-error-test
Ben Darnell [Sun, 22 May 2016 01:55:21 +0000 (21:55 -0400)] 
Merge pull request #1722 from bdarnell/windows-error-test

Fix error raised in set_close_exec on windows

9 years agoDocument Subprocess as posix-only 1722/head
Ben Darnell [Sun, 22 May 2016 01:32:13 +0000 (21:32 -0400)] 
Document Subprocess as posix-only

Fixes #1585

9 years agoFix error raised in set_close_exec on windows
Ben Darnell [Sun, 22 May 2016 00:23:51 +0000 (20:23 -0400)] 
Fix error raised in set_close_exec on windows

This slightly improves error messaging when tornado.process.Subprocess
is used in windows.

Fixes #1703

9 years agoIncrease timeout on a flaky test
Ben Darnell [Sun, 22 May 2016 00:15:20 +0000 (20:15 -0400)] 
Increase timeout on a flaky test

9 years agoMerge pull request #1712 from yegorich/python2-deps
Ben Darnell [Sat, 21 May 2016 23:44:54 +0000 (19:44 -0400)] 
Merge pull request #1712 from yegorich/python2-deps

Don't require backports.ssl_match_hostname on Python 2.7.9 and newer

9 years agoDisable intrusive codecov features
Ben Darnell [Sat, 21 May 2016 22:51:33 +0000 (18:51 -0400)] 
Disable intrusive codecov features

9 years agoAdd invalid content-length testcase
daftshady [Sun, 15 May 2016 14:02:43 +0000 (23:02 +0900)] 
Add invalid content-length testcase

9 years agoHandle invalid content-length
daftshady [Sun, 15 May 2016 14:01:17 +0000 (23:01 +0900)] 
Handle invalid content-length

9 years agoDon't require backports.ssl_match_hostname on Python 2.7.9 and newer 1712/head
Yegor Yefremov [Wed, 4 May 2016 07:26:22 +0000 (09:26 +0200)] 
Don't require backports.ssl_match_hostname on Python 2.7.9 and newer

As Python 3.2 support was dropped one can check 2.7.x dependency only.

Tornado running on Python 2.7.9+ doesn't need this backported package,
but some Python packages like circus check package dependencies at
runtime and insist on having backports.ssl_match_hostname installed,
though they don't even use this particular feature.

So checking for exact version makes life of package maintainer easier
especially on embedded Linux distributions like Buildroot.

9 years agoMerge pull request #1704 from thinkerou/master
Ben Darnell [Sat, 30 Apr 2016 15:50:24 +0000 (17:50 +0200)] 
Merge pull request #1704 from thinkerou/master

Add shebang for webspider.py

9 years agoAdd shebang for webspider.py 1704/head
thinkerou [Sat, 30 Apr 2016 00:28:10 +0000 (08:28 +0800)] 
Add shebang for webspider.py

9 years agoMerge pull request #1689 from harboecp/master
Ben Darnell [Sun, 24 Apr 2016 18:39:10 +0000 (14:39 -0400)] 
Merge pull request #1689 from harboecp/master

Avoid uncaught exception when _xsrf argument could not be decoded

9 years agoAdd type annotations to util.py
Ben Darnell [Sun, 24 Apr 2016 16:43:14 +0000 (12:43 -0400)] 
Add type annotations to util.py

Mypy now reports "15% imprecise", down from 25%.

9 years agoAdd .mypy_cache to gitignore
Ben Darnell [Sun, 24 Apr 2016 16:17:21 +0000 (12:17 -0400)] 
Add .mypy_cache to gitignore

9 years agoRemove some no-longer-necessary mypy workarounds
Ben Darnell [Sun, 24 Apr 2016 14:04:15 +0000 (10:04 -0400)] 
Remove some no-longer-necessary mypy workarounds

Made obsolete by python/mypy#1010

9 years agoMerge pull request #1699 from bdarnell/header-types
Ben Darnell [Sun, 24 Apr 2016 00:11:54 +0000 (20:11 -0400)] 
Merge pull request #1699 from bdarnell/header-types

Begin to fix type confusion in HTTPHeaders.

9 years agoBegin to fix type confusion in HTTPHeaders. 1699/head
Ben Darnell [Sat, 23 Apr 2016 23:34:23 +0000 (19:34 -0400)] 
Begin to fix type confusion in HTTPHeaders.

Values in HTTPHeaders were typed inconsistently: the class itself
assumed that values were of type str, while many callers assumed they
were bytes. Since headers are practically restricted to ascii, this
would work on python 2 but fail when certain combinations were
encountered on python 3 (notably the combination of GzipContentEncoding
with multiple preexisting Vary headers).

This commit adds a test and fixes the bug, and also adds enough type
annotations that mypy was able to report errors in the old incorrect
code.

Fixes #1670