]> git.ipfire.org Git - thirdparty/tornado.git/log
thirdparty/tornado.git
10 months agodocs: Add readthedocs configuration 3420/head
Ben Darnell [Wed, 4 Sep 2024 19:14:30 +0000 (15:14 -0400)] 
docs: Add readthedocs configuration

RTD will no longer do this automagically, so we need to add these
lines explicitly for compatibility. See
https://about.readthedocs.com/blog/2024/07/addons-by-default/

11 months agoMerge pull request #3417 from cjwatson/twisted-24.7.0
Ben Darnell [Mon, 19 Aug 2024 12:25:15 +0000 (08:25 -0400)] 
Merge pull request #3417 from cjwatson/twisted-24.7.0

Fix tests with Twisted 24.7.0

11 months agoFix tests with Twisted 24.7.0 3417/head
Colin Watson [Sun, 18 Aug 2024 17:58:11 +0000 (18:58 +0100)] 
Fix tests with Twisted 24.7.0

`twisted.internet.defer.returnValue` was needed on Python 2, but on
Python 3 a simple `return` statement works fine.  Twisted 24.7.0
deprecated the former, causing
`tornado.test.twisted_test.ConvertDeferredTest.test_success` to fail.

12 months agoMerge pull request #3414 from bdarnell/test-skip-cleanup
Ben Darnell [Fri, 26 Jul 2024 13:51:43 +0000 (09:51 -0400)] 
Merge pull request #3414 from bdarnell/test-skip-cleanup

test: Clean up code related to old versions of python

12 months agoweb: do not send 500 on invalid If-Modified-Since header (#3412)
Ronak Gajrawala [Mon, 15 Jul 2024 16:47:18 +0000 (09:47 -0700)] 
web: do not send 500 on invalid If-Modified-Since header (#3412)

https://github.com/tornadoweb/tornado/issues/3408

12 months agotest.util: Remove our private compatibility shim for subTests 3414/head
Ben Darnell [Thu, 11 Jul 2024 19:50:21 +0000 (15:50 -0400)] 
test.util: Remove our private compatibility shim for subTests

12 months agoweb_test: Remove obsolete compatibility with python 3.4
Ben Darnell [Thu, 11 Jul 2024 19:46:50 +0000 (15:46 -0400)] 
web_test: Remove obsolete compatibility with python 3.4

12 months ago*: Remove references to old python versions
Ben Darnell [Thu, 11 Jul 2024 19:43:32 +0000 (15:43 -0400)] 
*: Remove references to old python versions

Mainly in docs that say things like "you can only use this if you're
using python 3.2".

12 months agotest: Remove some obsolete checks for old python versions
Ben Darnell [Thu, 11 Jul 2024 19:26:14 +0000 (15:26 -0400)] 
test: Remove some obsolete checks for old python versions

12 months agotest: Remove skipOnTravis
Ben Darnell [Thu, 11 Jul 2024 19:21:09 +0000 (15:21 -0400)] 
test: Remove skipOnTravis

We haven't used Travis for CI in a long time, and our current CI
system is much less overloaded so these timing-sensitive tests are
no longer flaky.

12 months agoMerge pull request #3413 from bdarnell/test-mixins
Ben Darnell [Thu, 11 Jul 2024 19:08:27 +0000 (15:08 -0400)] 
Merge pull request #3413 from bdarnell/test-mixins

Extract abstract base test logic from UnixSocketTest

12 months agotest: Adopt abstract_base_test in websocket_test.py 3413/head
Ben Darnell [Thu, 11 Jul 2024 18:57:54 +0000 (14:57 -0400)] 
test: Adopt abstract_base_test in websocket_test.py

12 months agotest: Adopt abstract_base_test in simple_httpclient_test.py
Ben Darnell [Thu, 11 Jul 2024 18:49:17 +0000 (14:49 -0400)] 
test: Adopt abstract_base_test in simple_httpclient_test.py

12 months agotest: Adopt abstract_base_test in netutil_test.py
Ben Darnell [Thu, 11 Jul 2024 18:35:32 +0000 (14:35 -0400)] 
test: Adopt abstract_base_test in netutil_test.py

12 months agotest: Remove broken tests for legacy TLS versions
Ben Darnell [Thu, 11 Jul 2024 18:28:10 +0000 (14:28 -0400)] 
test: Remove broken tests for legacy TLS versions

The get_ssl_version method in these tests has been
silently ignored for a long time (forever?) due to
MRO issues (if they weren't ignored, they'd have
started throwing deprecation warnings), and they
were never updated for more recent versions of
TLS. There doesn't appear to be much value in
rehabilitating these tests so just get rid of all
but the base configuration.

12 months agotest: Remove an obsolete mixin pattern in concurrent_test
Ben Darnell [Thu, 11 Jul 2024 18:09:12 +0000 (14:09 -0400)] 
test: Remove an obsolete mixin pattern in concurrent_test

All but one implementation of this mixin has been removed, so we
no longer need the abstraction.

12 months agotest: Adopt @abstract_base_test in iostream_test
Ben Darnell [Thu, 11 Jul 2024 18:04:55 +0000 (14:04 -0400)] 
test: Adopt @abstract_base_test in iostream_test

Removes some typing-related hacks, but unfortunately introduces
another MRO-related hack.

12 months agotest: Extract "abstract" test logic into a decorator
Ben Darnell [Thu, 11 Jul 2024 17:41:31 +0000 (13:41 -0400)] 
test: Extract "abstract" test logic into a decorator

This makes the pattern reusable (and discoverable) for other tests.

Also exclude these skipped tests from the reporting that is meant
to highlight environmental issues.

This could potentially move to tornado.testing (or even upstream to
the stdlib) if it proves generally useful.

12 months agotest: Fix names of test cases added in #3405
Ben Darnell [Thu, 11 Jul 2024 15:39:10 +0000 (11:39 -0400)] 
test: Fix names of test cases added in #3405

Oops, these tests were named backwards.

12 months agoAdd support for binding Unix sockets in Linux's abstract namespace. (#3405)
Peter Stokes [Tue, 9 Jul 2024 14:26:46 +0000 (15:26 +0100)] 
Add support for binding Unix sockets in Linux's abstract namespace. (#3405)

12 months agoMerge pull request #3411 from tornadoweb/dependabot/pip/certifi-2024.7.4
Ben Darnell [Mon, 8 Jul 2024 20:17:43 +0000 (16:17 -0400)] 
Merge pull request #3411 from tornadoweb/dependabot/pip/certifi-2024.7.4

build(deps): bump certifi from 2024.6.2 to 2024.7.4

12 months agobuild(deps): bump certifi from 2024.6.2 to 2024.7.4 3411/head
dependabot[bot] [Sat, 6 Jul 2024 02:23:54 +0000 (02:23 +0000)] 
build(deps): bump certifi from 2024.6.2 to 2024.7.4

Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.6.2 to 2024.7.4.
- [Commits](https://github.com/certifi/python-certifi/compare/2024.06.02...2024.07.04)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
12 months agoMerge pull request #3404 from yuemxu/typing-get-cookie
Ben Darnell [Mon, 1 Jul 2024 19:57:14 +0000 (15:57 -0400)] 
Merge pull request #3404 from yuemxu/typing-get-cookie

web: More accurate typing for get_cookie

13 months agoMerge pull request #3410 from bdarnell/util-test
Ben Darnell [Sat, 29 Jun 2024 18:25:30 +0000 (14:25 -0400)] 
Merge pull request #3410 from bdarnell/util-test

test: Verify that tornado.version and version_info match

13 months agoutil_test: Slightly clean up old-style type annotations 3410/head
Ben Darnell [Fri, 28 Jun 2024 20:39:30 +0000 (16:39 -0400)] 
util_test: Slightly clean up old-style type annotations

13 months agotest: Replace a long-skipped test for tornado.util.exec_in
Ben Darnell [Fri, 28 Jun 2024 20:27:55 +0000 (16:27 -0400)] 
test: Replace a long-skipped test for tornado.util.exec_in

This test was first written to rely on the print_function future import
in Python 2.7, so it's been skipped since we dropped Python 2.
Use the annotations future import introduced in Python 3.7 instead.

13 months agotest: Verify that tornado.version and version_info match
Ben Darnell [Fri, 28 Jun 2024 20:11:14 +0000 (16:11 -0400)] 
test: Verify that tornado.version and version_info match

These two values should always match, but they're updated
manually so test to catch mistakes.

Closes #3406

13 months agoMerge pull request #3407 from tornadoweb/dependabot/pip/urllib3-2.2.2
Ben Darnell [Tue, 25 Jun 2024 18:24:37 +0000 (14:24 -0400)] 
Merge pull request #3407 from tornadoweb/dependabot/pip/urllib3-2.2.2

build(deps): bump urllib3 from 2.2.1 to 2.2.2

13 months agoMerge pull request #3403 from bdarnell/pyupgrade
Ben Darnell [Tue, 25 Jun 2024 18:10:26 +0000 (14:10 -0400)] 
Merge pull request #3403 from bdarnell/pyupgrade

*: Automated changes from pyupgrade

13 months agobuild(deps): bump urllib3 from 2.2.1 to 2.2.2 3407/head
dependabot[bot] [Mon, 17 Jun 2024 23:51:06 +0000 (23:51 +0000)] 
build(deps): bump urllib3 from 2.2.1 to 2.2.2

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.1...2.2.2)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
13 months agoweb: More accurate typing for get_cookie 3404/head
Yuemao Xu (yuemxu) [Mon, 17 Jun 2024 10:27:20 +0000 (12:27 +0200)] 
web: More accurate typing for get_cookie

13 months ago*: Switch from percent formatting to f-strings 3403/head
Ben Darnell [Thu, 13 Jun 2024 19:25:50 +0000 (15:25 -0400)] 
*: Switch from percent formatting to f-strings

Automated change using pyupgrade in two passes (once to go from percent
formatting to str.format, then to go from str.format to f-strings),
followed by black.

This left a few uses of str.format for unknown reasons.

13 months agolint: Set black target version to 3.8+
Ben Darnell [Thu, 13 Jun 2024 19:08:18 +0000 (15:08 -0400)] 
lint: Set black target version to 3.8+

This makes black use trailing commas consistently across the codebase.
Without this, it uses certain trailing commas only in files that
contain fstrings (because this marks them as requiring Python 3.6+).

13 months ago*: More small pyupgrade cleanups
Ben Darnell [Thu, 13 Jun 2024 18:52:19 +0000 (14:52 -0400)] 
*: More small pyupgrade cleanups

- Unpack list comprehension
- Redundant calls to str() on string literals
- Unnecessary args to super()

With the previous commits, this brings us up to
pyupgrade --py3-plus --keep-percent-format

13 months agowsgi: Avoid deprecated typing.Text alias
Ben Darnell [Thu, 13 Jun 2024 18:49:03 +0000 (14:49 -0400)] 
wsgi: Avoid deprecated typing.Text alias

This alias existed only for python 2 compatibility.
This commit was partially made by pyupgrade and then I manually fixed
the unused import.

13 months ago*: Use default argument for str.encode()
Ben Darnell [Thu, 13 Jun 2024 18:43:57 +0000 (14:43 -0400)] 
*: Use default argument for str.encode()

I had missed that this became hard-coded to utf-8 in py3k,
instead of being overridable as in python 2.

Automated change with modified pyupgrade.

13 months ago*: Use OSError instead of its aliases
Ben Darnell [Thu, 13 Jun 2024 18:06:26 +0000 (14:06 -0400)] 
*: Use OSError instead of its aliases

Various errors were merged into OSError in Python 3.4.

Automated change with modified pyupgrade.

13 months ago*: Use dict comprehensions where applicable
Ben Darnell [Thu, 13 Jun 2024 18:03:12 +0000 (14:03 -0400)] 
*: Use dict comprehensions where applicable

Another feature that's been around since Python 2.7
Automated change with modified pyupgrade and black.

13 months ago*: Use set literals and comprehensions where applicable
Ben Darnell [Thu, 13 Jun 2024 17:58:33 +0000 (13:58 -0400)] 
*: Use set literals and comprehensions where applicable

These features have been available since Python 2.7.

This change was made with a version of pyupgrade modified to perform
only this change, then postprocessed with black.

13 months ago*: Remove redundant (object) base classes
Ben Darnell [Thu, 13 Jun 2024 17:51:48 +0000 (13:51 -0400)] 
*: Remove redundant (object) base classes

This was only necessary in python 3.

This change was made with a version of pyupgrade that was modified
to perform only this change.

13 months agoMerge pull request #3358 from stefanor/relative-pythonpath
Ben Darnell [Wed, 12 Jun 2024 15:06:57 +0000 (11:06 -0400)] 
Merge pull request #3358 from stefanor/relative-pythonpath

autoreload_test: Handle a relative PYTHONPATH

13 months agoMerge pull request #3402 from bdarnell/update-sphinx
Ben Darnell [Wed, 12 Jun 2024 14:04:06 +0000 (10:04 -0400)] 
Merge pull request #3402 from bdarnell/update-sphinx

docs: Update sphinx (and the rest of the deps)

13 months agoMerge pull request #3395 from bdarnell/test-313b2
Ben Darnell [Wed, 12 Jun 2024 13:59:18 +0000 (09:59 -0400)] 
Merge pull request #3395 from bdarnell/test-313b2

process_test: Remove compatibility hack for python 3.13 beta 1

13 months agodocs: Sync readthedocs python version with tox.ini 3402/head
Ben Darnell [Wed, 12 Jun 2024 13:57:44 +0000 (09:57 -0400)] 
docs: Sync readthedocs python version with tox.ini

13 months agodocs: Remove empty testoutput blocks
Ben Darnell [Wed, 12 Jun 2024 02:21:20 +0000 (22:21 -0400)] 
docs: Remove empty testoutput blocks

These were once needed (I think) to get the tests to run at all, even
though they triggered warnings from sphinx. Now it works without them.

13 months agodocs: Add sphinx coverage check to docs tox build
Ben Darnell [Wed, 12 Jun 2024 02:01:42 +0000 (22:01 -0400)] 
docs: Add sphinx coverage check to docs tox build

13 months agodocs: Update sphinx (and the rest of the deps)
Ben Darnell [Wed, 12 Jun 2024 01:35:51 +0000 (21:35 -0400)] 
docs: Update sphinx (and the rest of the deps)

Remove pin to sphinx 5.x and remove sphinx-asyncio. Sphinx now supports
asyncio out of the box. Everything I've checked looks fine although I
haven't looked at every page.

Fixes #3239

13 months agoMerge pull request #3400 from bdarnell/update-lint
Ben Darnell [Wed, 12 Jun 2024 01:32:57 +0000 (21:32 -0400)] 
Merge pull request #3400 from bdarnell/update-lint

lint: Update flake8 and friends

13 months agoMerge pull request #3399 from bdarnell/default-encoding
Ben Darnell [Wed, 12 Jun 2024 01:21:13 +0000 (21:21 -0400)] 
Merge pull request #3399 from bdarnell/default-encoding

test: Address warnings about using the default encoding

13 months agolint: Update flake8 and friends 3400/head
Ben Darnell [Wed, 12 Jun 2024 01:20:20 +0000 (21:20 -0400)] 
lint: Update flake8 and friends

Use "is" instead of "==" for type comparisons.

13 months agotest: Address warnings about using the default encoding 3399/head
Ben Darnell [Wed, 12 Jun 2024 01:09:34 +0000 (21:09 -0400)] 
test: Address warnings about using the default encoding

I'm not sure exactly how these warnings are getting logged without
causing the build to fail, but they are.

13 months agoMerge pull request #3398 from bdarnell/skip-test-mac-curl
Ben Darnell [Tue, 11 Jun 2024 17:30:28 +0000 (13:30 -0400)] 
Merge pull request #3398 from bdarnell/skip-test-mac-curl

test: Skip a closed connection test with curl and macOS

13 months agotest: Skip a closed connection test with curl and macOS 3398/head
Ben Darnell [Tue, 11 Jun 2024 17:25:19 +0000 (13:25 -0400)] 
test: Skip a closed connection test with curl and macOS

Unclear what the issue is but skip the test for now.

13 months agoMerge pull request #3397 from bdarnell/rm-twisted-resolver
Ben Darnell [Tue, 11 Jun 2024 17:01:44 +0000 (13:01 -0400)] 
Merge pull request #3397 from bdarnell/rm-twisted-resolver

twisted: Delete TwistedResolver class

13 months agotwisted: Delete TwistedResolver class 3397/head
Ben Darnell [Tue, 11 Jun 2024 16:16:55 +0000 (12:16 -0400)] 
twisted: Delete TwistedResolver class

This class was deprecated and slated for deletion in Tornado 7.0.
However, it has become broken due to the adoption of RFC 8482
(which limits the use of the ANY query type in DNS) and it now fails
for most domain names (with the exception of localhost).
The upstream issue https://github.com/twisted/twisted/issues/10062
has been open for years which is a pretty good sign that no one
is depending on this class and it's safe to remove it ahead of
schedule.

This class was primarily intended to provide thread-free non-blocking
DNS resolution. If that is still required,
`tornado.platform.caresresolver` is the next best option, although it
has its own limitations which differ from TwistedResolver.

13 months agoprocess_test: Remove compatibility hack for python 3.13 beta 1 3395/head
Ben Darnell [Mon, 10 Jun 2024 16:09:20 +0000 (12:09 -0400)] 
process_test: Remove compatibility hack for python 3.13 beta 1

13 months agoMerge pull request #3396 from bdarnell/fix-test-lint
Ben Darnell [Mon, 10 Jun 2024 16:28:12 +0000 (12:28 -0400)] 
Merge pull request #3396 from bdarnell/fix-test-lint

test: Fix some lint issues after #3298

13 months agotest: Fix some lint issues after #3298 3396/head
Ben Darnell [Mon, 10 Jun 2024 16:22:54 +0000 (12:22 -0400)] 
test: Fix some lint issues after #3298

That PR arrived while our CI was broken and I
manually verified that the tests passed but didn't
run the linters. These changes are running in to
https://github.com/python/mypy/issues/5088

13 months agoRefactor test cases to improve unit test quality (#3298)
Han Wang [Sat, 8 Jun 2024 18:09:27 +0000 (04:09 +1000)] 
Refactor test cases to improve unit test quality (#3298)

* refactor the code to avoid suboptimal asserts.

* Handle ParseError with assertRaises

Signed-off-by: Han Wang <freddie.wanah@gmail.com>
13 months agoMerge pull request #3394 from bdarnell/python-versions
Ben Darnell [Sat, 8 Jun 2024 17:56:17 +0000 (13:56 -0400)] 
Merge pull request #3394 from bdarnell/python-versions

Add python 3.13 betas to test configs

13 months agoprocess_test: Remove reference to deleted LayeredTwistedIOLoop 3394/head
Ben Darnell [Sat, 8 Jun 2024 01:25:29 +0000 (21:25 -0400)] 
process_test: Remove reference to deleted LayeredTwistedIOLoop

13 months agoutil: Remove pre-py35 is_finalizing compatibility
Ben Darnell [Fri, 7 Jun 2024 20:36:52 +0000 (16:36 -0400)] 
util: Remove pre-py35 is_finalizing compatibility

This code appears to be unused and in any case is unnecessary since
is_finalizing has been in the standard library since 3.5.

13 months agoAdd python 3.13 betas to test configs
Ben Darnell [Fri, 7 Jun 2024 20:20:54 +0000 (16:20 -0400)] 
Add python 3.13 betas to test configs

Belatedly promote 3.12 to non-beta status

13 months agoMerge pull request #3393 from bdarnell/typing
Ben Darnell [Fri, 7 Jun 2024 20:03:17 +0000 (16:03 -0400)] 
Merge pull request #3393 from bdarnell/typing

Update mypy and various typing improvements

13 months agoconcurrent: Update type hint on chain_future to match implementation 3393/head
Ben Darnell [Fri, 7 Jun 2024 19:54:08 +0000 (15:54 -0400)] 
concurrent: Update type hint on chain_future to match implementation

This method has always accepted both asyncio and concurrent futures,
but the type hint incorrectly indicated that it only accepted asyncio
futures.

Fixes #3314

13 months agoweb: Improve typing for UIModule.render
Ben Darnell [Fri, 7 Jun 2024 19:23:45 +0000 (15:23 -0400)] 
web: Improve typing for UIModule.render

In practice, UIModule.render often returns the
result of self.render_string, which returns bytes.
In fact, we have an example of that in this file
which had a type ignore comment. UIModule.render
may now return either str or bytes and downstream
code is responsible for handling this. (Note that
the new call to _unicode appears to be redundant
since the Template module's bytes return was
already working correctly, but this conversion is
necessary to satisfy the type checker.)

Fixes #3050

13 months agoMerge pull request #3378 from pcavalar/typing-get-body-query-argument
Ben Darnell [Fri, 7 Jun 2024 19:16:44 +0000 (15:16 -0400)] 
Merge pull request #3378 from pcavalar/typing-get-body-query-argument

web: More accurate typing for get_{body,query}_argument()

13 months agoMerge pull request #3381 from pcavalar/typing-loader-autoescape
Ben Darnell [Fri, 7 Jun 2024 19:06:08 +0000 (15:06 -0400)] 
Merge pull request #3381 from pcavalar/typing-loader-autoescape

template: type BaseLoader autoescape kwarg as optional

13 months agoMerge pull request #3330 from mslynch/use-typing-namedtuple
Ben Darnell [Fri, 7 Jun 2024 19:00:43 +0000 (15:00 -0400)] 
Merge pull request #3330 from mslynch/use-typing-namedtuple

use typing.NamedTuple instead of collections.namedtuple

13 months agoweb: Type SUPPORTED_METHODS so it can be overridden
Ben Darnell [Fri, 7 Jun 2024 18:51:34 +0000 (14:51 -0400)] 
web: Type SUPPORTED_METHODS so it can be overridden

Its default type is `Tuple[str, str, str, str, str, str, str]`, which
can only be overridden by a tuple of the exact same length.

This change originated in #3354 (thanks alexmv and andersk).

Closes #3354

13 months agohttputil: Add types for elements of HTTPHeaders
Ben Darnell [Fri, 7 Jun 2024 18:42:28 +0000 (14:42 -0400)] 
httputil: Add types for elements of HTTPHeaders

Revealed an issue in websocket.py in which bytes were used when it
should have been str. This avoided being a bug because something
down the line was converting it to str but it was still a logical
type error.

The change to httputil.py was taken from #3329 (thanks mslynch).

Closes #3329
Fixes #3328

13 months agoUpdate mypy and typing packages to latest
Ben Darnell [Fri, 7 Jun 2024 18:28:07 +0000 (14:28 -0400)] 
Update mypy and typing packages to latest

Adapt to newer upstream types for AbstractEventLoop

13 months agoMerge pull request #3389 from bdarnell/bump-65
Ben Darnell [Thu, 6 Jun 2024 19:06:21 +0000 (15:06 -0400)] 
Merge pull request #3389 from bdarnell/bump-65

Version bump for 6.5.dev1

13 months agoVersion bump for 6.5.dev1 3389/head
Ben Darnell [Thu, 6 Jun 2024 18:56:51 +0000 (14:56 -0400)] 
Version bump for 6.5.dev1

13 months agoMerge pull request #3388 from bdarnell/release-641 v6.4.1
Ben Darnell [Thu, 6 Jun 2024 18:11:31 +0000 (14:11 -0400)] 
Merge pull request #3388 from bdarnell/release-641

Release notes and version bump for version 6.4.1

13 months agoRelease notes and version bump for version 6.4.1 3388/head
Ben Darnell [Thu, 6 Jun 2024 17:56:41 +0000 (13:56 -0400)] 
Release notes and version bump for version 6.4.1

13 months agoMerge pull request #3387 from bdarnell/chunked-parsing
Ben Darnell [Thu, 6 Jun 2024 17:40:06 +0000 (13:40 -0400)] 
Merge pull request #3387 from bdarnell/chunked-parsing

http1connection: Stricter handling of transfer-encoding and whitespace

13 months agohttputil: Only strip tabs and spaces from header values 3387/head
Ben Darnell [Wed, 5 Jun 2024 20:50:37 +0000 (16:50 -0400)] 
httputil: Only strip tabs and spaces from header values

The RFC specifies that only tabs and spaces should be stripped.
Removing additonal whitespace characters can lead to framing
errors with certain proxies.

13 months agoMerge pull request #3386 from bdarnell/curl-crlf
Ben Darnell [Thu, 6 Jun 2024 17:31:17 +0000 (13:31 -0400)] 
Merge pull request #3386 from bdarnell/curl-crlf

curl_httpclient,http1connection: Prohibit CR and LF in headers

13 months agohttp1connection: Stricter handling of transfer-encoding
Ben Darnell [Wed, 5 Jun 2024 20:50:11 +0000 (16:50 -0400)] 
http1connection: Stricter handling of transfer-encoding

Unexpected transfer-encoding values were previously ignored and treated
as the HTTP/1.0 default of read-until-close. This can lead to framing
issues with certain proxies. We now treat any unexpected value as an
error.

13 months agocurl_httpclient,http1connection: Prohibit CR and LF in headers 3386/head
Ben Darnell [Wed, 5 Jun 2024 19:43:45 +0000 (15:43 -0400)] 
curl_httpclient,http1connection: Prohibit CR and LF in headers

libcurl does not check for CR and LF in headers, making this the
application's responsibility. However, Tornado's other HTTP interfaces
check for linefeeds so we should do the same here so that switching
between the simple and curl http clients does not introduce header
injection vulnerabilties.

http1connection previously checked only for LF in headers (alone or in a
CRLF pair). It now prohibits bare CR as well, following the requirement
in RFC 9112.

13 months agoMerge pull request #3385 from bdarnell/update-black
Ben Darnell [Tue, 4 Jun 2024 18:25:10 +0000 (14:25 -0400)] 
Merge pull request #3385 from bdarnell/update-black

*: Update black

13 months agoMerge pull request #3384 from tornadoweb/dependabot/pip/requests-2.32.2
Ben Darnell [Tue, 4 Jun 2024 18:24:45 +0000 (14:24 -0400)] 
Merge pull request #3384 from tornadoweb/dependabot/pip/requests-2.32.2

build(deps): bump requests from 2.31.0 to 2.32.2

13 months ago*: Update black 3385/head
Ben Darnell [Tue, 4 Jun 2024 18:19:52 +0000 (14:19 -0400)] 
*: Update black

Closes #3367

13 months agobuild(deps): bump requests from 2.31.0 to 2.32.2 3384/head
dependabot[bot] [Tue, 4 Jun 2024 18:09:16 +0000 (18:09 +0000)] 
build(deps): bump requests from 2.31.0 to 2.32.2

Bumps [requests](https://github.com/psf/requests) from 2.31.0 to 2.32.2.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.31.0...v2.32.2)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
13 months agoMerge pull request #3377 from tornadoweb/dependabot/pip/jinja2-3.1.4
Ben Darnell [Tue, 4 Jun 2024 18:07:43 +0000 (14:07 -0400)] 
Merge pull request #3377 from tornadoweb/dependabot/pip/jinja2-3.1.4

build(deps): bump jinja2 from 3.1.3 to 3.1.4

13 months agoMerge pull request #3383 from bdarnell/ci-update
Ben Darnell [Tue, 4 Jun 2024 18:02:51 +0000 (14:02 -0400)] 
Merge pull request #3383 from bdarnell/ci-update

ci: Update action versions for node deprecation

13 months agoci: Update action versions for node deprecation 3383/head
Ben Darnell [Tue, 4 Jun 2024 01:05:22 +0000 (21:05 -0400)] 
ci: Update action versions for node deprecation

The changes to checkout and setup-python shouldn't have been major
version bumps. upload-artifact and download-artifact should have had
updated node versions on v3 so we don't have to adapt to incompatible
changes here. But anyway, here we are.

build.yml has updates from
https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml

This commit also moves the pypi upload step to use OIDC instead of
a static token.

13 months agoMerge pull request #3382 from bdarnell/remove-testmethodwrapper
Ben Darnell [Mon, 3 Jun 2024 20:38:31 +0000 (16:38 -0400)] 
Merge pull request #3382 from bdarnell/remove-testmethodwrapper

testing: Replace _TestMethodWrapper with _callTestMethod

13 months agotesting: Replace _TestMethodWrapper with _callTestMethod 3382/head
Ben Darnell [Mon, 3 Jun 2024 19:49:59 +0000 (15:49 -0400)] 
testing: Replace _TestMethodWrapper with _callTestMethod

Overriding _callTestMethod (which was introduced in python 3.8) is a
less hacky way to detect tests that fail to use ``@gen_test`` where
needed. It's not documented, but since Python 3.11 has introduced a
similar check to the standard library we'll be able to remove it in the
near future.

The major impetus for this change is an incompatibility with
Pytest 8.2, which has made a change that tries to instantiate test
classes at discovery time without an existing method name.

Fixes #3375
Closes #3374

14 months agotemplate: type BaseLoader autoescape kwarg as optional 3381/head
Philippe Cavalaria [Tue, 28 May 2024 08:54:08 +0000 (10:54 +0200)] 
template: type BaseLoader autoescape kwarg as optional

14 months agoweb: More accurate typing for get_{body,query}_argument() 3378/head
Philippe Cavalaria [Fri, 17 May 2024 10:41:44 +0000 (12:41 +0200)] 
web: More accurate typing for get_{body,query}_argument()

Use the same overload technique as get_argument().

Fixes https://github.com/tornadoweb/tornado/issues/3336

14 months agobuild(deps): bump jinja2 from 3.1.3 to 3.1.4 3377/head
dependabot[bot] [Mon, 6 May 2024 20:43:46 +0000 (20:43 +0000)] 
build(deps): bump jinja2 from 3.1.3 to 3.1.4

Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
15 months agoMerge pull request #3371 from tornadoweb/dependabot/pip/idna-3.7
Ben Darnell [Fri, 12 Apr 2024 14:24:33 +0000 (10:24 -0400)] 
Merge pull request #3371 from tornadoweb/dependabot/pip/idna-3.7

build(deps): bump idna from 3.4 to 3.7

15 months agobuild(deps): bump idna from 3.4 to 3.7 3371/head
dependabot[bot] [Fri, 12 Apr 2024 01:57:06 +0000 (01:57 +0000)] 
build(deps): bump idna from 3.4 to 3.7

Bumps [idna](https://github.com/kjd/idna) from 3.4 to 3.7.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.4...v3.7)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
16 months agoMerge pull request #3357 from danigm/openssl-3.2
Ben Darnell [Sun, 3 Mar 2024 17:04:16 +0000 (12:04 -0500)] 
Merge pull request #3357 from danigm/openssl-3.2

OpenSSL 3.2 compatibility

18 months agoautoreload_test: Handle a relative PYTHONPATH 3358/head
Stefano Rivera [Sun, 21 Jan 2024 19:55:16 +0000 (15:55 -0400)] 
autoreload_test: Handle a relative PYTHONPATH

This came up in the Debian package build of tornado, where we run the
tests from a staged build of the module.

18 months agoOpenSSL 3.2 compatibility 3357/head
Daniel Garcia Moreno [Mon, 15 Jan 2024 08:48:00 +0000 (09:48 +0100)] 
OpenSSL 3.2 compatibility

Fix https://github.com/tornadoweb/tornado/issues/3355

18 months agoMerge pull request #3356 from tornadoweb/dependabot/pip/jinja2-3.1.3
Ben Darnell [Fri, 12 Jan 2024 01:45:58 +0000 (20:45 -0500)] 
Merge pull request #3356 from tornadoweb/dependabot/pip/jinja2-3.1.3

build(deps): bump jinja2 from 3.1.2 to 3.1.3

18 months agobuild(deps): bump jinja2 from 3.1.2 to 3.1.3 3356/head
dependabot[bot] [Thu, 11 Jan 2024 20:27:48 +0000 (20:27 +0000)] 
build(deps): bump jinja2 from 3.1.2 to 3.1.3

Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>