]> git.ipfire.org Git - thirdparty/tornado.git/log
thirdparty/tornado.git
2 weeks agoUpdate all deps in requirements.txt 3602/head
Ben Darnell [Mon, 23 Mar 2026 17:00:14 +0000 (13:00 -0400)] 
Update all deps in requirements.txt

Most notably includes a new mypy which required a few small
changes.

Closes #3580

3 weeks agoMerge pull request #3600 from bdarnell/more-archs
Ben Darnell [Fri, 20 Mar 2026 11:40:59 +0000 (07:40 -0400)] 
Merge pull request #3600 from bdarnell/more-archs

ci: Build wheels for more architectures under emulation

3 weeks agoci: Build wheels for more architectures under emulation 3600/head
Ben Darnell [Fri, 20 Mar 2026 01:36:17 +0000 (21:36 -0400)] 
ci: Build wheels for more architectures under emulation

This commit also fixes the macos build to use universal2 wheels,
which was broken with the addition of riscv64 support.

Support for these architectures is experimental, but we have had
a request for ppc64le in #3449. As long as emulation gives us a turnkey
solution, we might as well build for them, but if the emulation
pipeline turns out to be unstable we will reconsider. (armv7l is also
experimentally supported by cibuildwheel and even shows up more
frequently in our download stats than ppc64le and s390x, but I got
a cryptic failure when I tried it so I'm leaving it out for now.)

This commit reduces the amount of testing we do for emulated
builds because they are otherwise the slowest part of the build
pipeline.

3 weeks agoMerge pull request #3599 from bdarnell/isort
Ben Darnell [Fri, 20 Mar 2026 03:11:27 +0000 (23:11 -0400)] 
Merge pull request #3599 from bdarnell/isort

*: Rewrite imports with isort

3 weeks ago*: Rewrite imports with isort 3599/head
Ben Darnell [Fri, 20 Mar 2026 03:05:22 +0000 (23:05 -0400)] 
*: Rewrite imports with isort

Today's type import changes have caused a lot of churn in the import
statements and we've never had a consistent style. Run a one-time
cleanup with isort to tidy things up. I'm not (currently) planning
to make this a CI-enforced rule.

3 weeks agoMerge pull request #3598 from bdarnell/ci-3.15
Ben Darnell [Fri, 20 Mar 2026 02:56:46 +0000 (22:56 -0400)] 
Merge pull request #3598 from bdarnell/ci-3.15

ci: Test under python 3.15 dev builds

3 weeks agoci: Test under python 3.15 dev builds 3598/head
Ben Darnell [Fri, 20 Mar 2026 01:55:56 +0000 (21:55 -0400)] 
ci: Test under python 3.15 dev builds

Clean up after ThreadedResolver tests to avoid failures related to
calling os.fork in a multithreaded process.

3 weeks agoMerge pull request #3546 from justeph/justeph/ci-add-riscv64
Ben Darnell [Fri, 20 Mar 2026 01:31:03 +0000 (21:31 -0400)] 
Merge pull request #3546 from justeph/justeph/ci-add-riscv64

ci: add riscv64 manylinux/musllinux wheels

3 weeks agoci: add riscv64 manylinux/musllinux wheels 3546/head
Julien Stephan [Wed, 26 Nov 2025 17:09:48 +0000 (18:09 +0100)] 
ci: add riscv64 manylinux/musllinux wheels

Now that cibuildwheel and PyPI support riscv64, we can start building
riscv64 wheels for Tornado.

Because there is no native riscv64 runner available, this PR adds a
QEMU-based riscv64 job to the cibuildwheel workflow.

Due to emulation, we need to:
- Increase ASYNC_TEST_TIMEOUT to 30s to accommodate slower runs
- Increase timeout for test_request_timeout
- Skip test_unquote_large

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
3 weeks agoMerge pull request #3597 from bdarnell/unconditional-typing
Ben Darnell [Thu, 19 Mar 2026 23:11:04 +0000 (19:11 -0400)] 
Merge pull request #3597 from bdarnell/unconditional-typing

Remove obsolete conditional imports (mostly typing-related)

3 weeks agogen,test: Remove conditional imports of modules that are now standard 3597/head
Ben Darnell [Thu, 19 Mar 2026 19:50:32 +0000 (15:50 -0400)] 
gen,test: Remove conditional imports of modules that are now standard

3 weeks ago*: Remove obsolete noqa comments
Ben Darnell [Thu, 19 Mar 2026 19:10:22 +0000 (15:10 -0400)] 
*: Remove obsolete noqa comments

Mostly thanks to pyflakes improving compatibility with type
annotations and overloads.

3 weeks ago*: Remove most typing.TYPE_CHECKING guards and F401 noqa comments
Ben Darnell [Thu, 19 Mar 2026 19:03:46 +0000 (15:03 -0400)] 
*: Remove most typing.TYPE_CHECKING guards and F401 noqa comments

Flake8 now understands type annotations and no longer emits
"unused import" warnings for type imports. Most imports that
were previously behind TYPE_CHECKING guards are no longer
needed, or can be moved to unguarded imports.

3 weeks agoMerge pull request #3596 from bdarnell/pyupgrade
Ben Darnell [Thu, 19 Mar 2026 16:14:34 +0000 (12:14 -0400)] 
Merge pull request #3596 from bdarnell/pyupgrade

Use pyupgrade to adopt python 3.9 and 3.10 features

3 weeks ago*: Import Callable from collections.abc instead of typing (py310+) 3596/head
Ben Darnell [Thu, 19 Mar 2026 15:36:02 +0000 (11:36 -0400)] 
*: Import Callable from collections.abc instead of typing (py310+)

Automated change by pyupgrade ("imports" plugin)

3 weeks ago*: Update type annotations to use python 3.10 features
Ben Darnell [Thu, 19 Mar 2026 15:28:25 +0000 (11:28 -0400)] 
*: Update type annotations to use python 3.10 features

Automated change by pyupgrade (typing plugins) followed by manual
fixes of unused imports

3 weeks ago*: Rewrite typing imports to use their new (3.9+) locations
Ben Darnell [Thu, 19 Mar 2026 15:24:02 +0000 (11:24 -0400)] 
*: Rewrite typing imports to use their new (3.9+) locations

Automated change by pyupgrade ("imports" plugin)

3 weeks ago*: Update type annotations to use Python 3.9 features
Ben Darnell [Thu, 19 Mar 2026 14:22:16 +0000 (10:22 -0400)] 
*: Update type annotations to use Python 3.9 features

Automated change with pyupgrade (restricted to the typing plugins)
followed by manual removal of unused imports.

3 weeks ago*: Remaining pyupgrade 3.8 fixes
Ben Darnell [Thu, 19 Mar 2026 14:15:13 +0000 (10:15 -0400)] 
*: Remaining pyupgrade 3.8 fixes

3 weeks ago*: Update type annotations with py3.8 features
Ben Darnell [Thu, 19 Mar 2026 14:06:12 +0000 (10:06 -0400)] 
*: Update type annotations with py3.8 features

Automated change with pyupgrade (restricted to the typing plugins),
followed by manual removal of unused imports.

3 weeks agoMerge pull request #3595 from hauntsaninja/typcom
Ben Darnell [Thu, 19 Mar 2026 13:51:42 +0000 (09:51 -0400)] 
Merge pull request #3595 from hauntsaninja/typcom

Modernise all type comments

3 weeks agoModernise all type comments 3595/head
hauntsaninja [Wed, 18 Mar 2026 23:57:38 +0000 (16:57 -0700)] 
Modernise all type comments

3 weeks agoUse variable annotations to avoid None defaults (#3575)
Shantanu [Wed, 18 Mar 2026 19:36:28 +0000 (12:36 -0700)] 
Use variable annotations to avoid None defaults (#3575)

PEP 526 landed in Python 3.5 which is quite dead now

3 weeks agoMerge pull request #3593 from bdarnell/contributing
Ben Darnell [Tue, 17 Mar 2026 19:24:12 +0000 (15:24 -0400)] 
Merge pull request #3593 from bdarnell/contributing

doc: Add CONTRIBUTING.md

3 weeks agodoc: Add CONTRIBUTING.md 3593/head
Ben Darnell [Tue, 17 Mar 2026 18:13:32 +0000 (14:13 -0400)] 
doc: Add CONTRIBUTING.md

Closes #2675
Closes #2668

3 weeks agoMerge pull request #3592 from bdarnell/update-black
Ben Darnell [Mon, 16 Mar 2026 19:36:00 +0000 (15:36 -0400)] 
Merge pull request #3592 from bdarnell/update-black

build(deps): bump black from 25.1.0 to 26.3.1

3 weeks agoMerge pull request #3591 from bdarnell/incomplete-comment
Ben Darnell [Mon, 16 Mar 2026 19:31:38 +0000 (15:31 -0400)] 
Merge pull request #3591 from bdarnell/incomplete-comment

web: Fix an incomplete comment that was omitted from 459e1c3d3b

3 weeks agobuild(deps): bump black from 25.1.0 to 26.3.1 3592/head
Ben Darnell [Mon, 16 Mar 2026 19:30:11 +0000 (15:30 -0400)] 
build(deps): bump black from 25.1.0 to 26.3.1

This fixes a security issue in black. Original dependabot PR
is #3590, but we had to do it manually to apply the new formatting
changes and pass lint.

Closes #3590

3 weeks agoweb: Fix an incomplete comment that was omitted from 459e1c3d3b 3591/head
Ben Darnell [Mon, 16 Mar 2026 19:21:50 +0000 (15:21 -0400)] 
web: Fix an incomplete comment that was omitted from 459e1c3d3b

4 weeks agoMerge pull request #3582 from charles2910/fix-tests-with-curl-8-19-0
Ben Darnell [Thu, 12 Mar 2026 18:50:25 +0000 (14:50 -0400)] 
Merge pull request #3582 from charles2910/fix-tests-with-curl-8-19-0

Make tests compatible with curl 8.19.0

4 weeks agoMake tests compatible with curl 8.19.0 3582/head
Carlos Henrique Lima Melara [Fri, 6 Mar 2026 03:56:17 +0000 (00:56 -0300)] 
Make tests compatible with curl 8.19.0

In 8.19.0-rc2, the error logic has been changed so any later errors are
preserved. This changes what is returned by curl and therefore what tornado
sees. For HTTPError variant of the test, which uses CurlAsyncHTTPClient, we get
the error from pycurl and now it contains "Failed binding local connection
end". This logic handles both the old version of libcurl and also the newer
one.

Co-Authored-By: Samuel Henrique <samueloph@debian.org>
4 weeks agoMerge pull request #3589 from bdarnell/update-cibw2
Ben Darnell [Wed, 11 Mar 2026 01:59:15 +0000 (21:59 -0400)] 
Merge pull request #3589 from bdarnell/update-cibw2

build: Update cibuildwheel to v3.4.0

4 weeks agobuild: Update cibuildwheel to v3.4.0 3589/head
Ben Darnell [Wed, 11 Mar 2026 01:12:26 +0000 (21:12 -0400)] 
build: Update cibuildwheel to v3.4.0

This matches the version used in branch6.5

4 weeks agoMerge pull request #3588 from bdarnell/relnotes-65
Ben Darnell [Wed, 11 Mar 2026 01:05:43 +0000 (21:05 -0400)] 
Merge pull request #3588 from bdarnell/relnotes-65

Copy release notes from branch6.5 to master

4 weeks agodocs: Use correct link syntax, not markdown. 3588/head
Ben Darnell [Wed, 11 Mar 2026 00:48:55 +0000 (20:48 -0400)] 
docs: Use correct link syntax, not markdown.

4 weeks agoRelease notes and version bump for v6.5.5
Ben Darnell [Tue, 10 Mar 2026 17:00:44 +0000 (13:00 -0400)] 
Release notes and version bump for v6.5.5

4 weeks agoRelease notes and version bump for 6.5.4
Ben Darnell [Mon, 15 Dec 2025 18:36:01 +0000 (13:36 -0500)] 
Release notes and version bump for 6.5.4

4 weeks agoMerge pull request #3584 from bdarnell/security-655
Ben Darnell [Tue, 10 Mar 2026 16:39:03 +0000 (12:39 -0400)] 
Merge pull request #3584 from bdarnell/security-655

Security fixes for release 6.5.5

4 weeks agohttputil: Add CRLF to _FORBIDDEN_HEADER_CHARS_RE 3584/head
Ben Darnell [Tue, 10 Mar 2026 16:19:50 +0000 (12:19 -0400)] 
httputil: Add CRLF to _FORBIDDEN_HEADER_CHARS_RE

I think these were omitted due to quirks of an older version of the
parsing code. Linefeeds are already effectively prohibited within
header values since they are interpreted as delimiters, so the net
effect of this change is to prohibit bare carriage returns within
header values. This RE is used only when parsing headers inside
multipart/form-data bodies; for HTTP headers CR was already prohibited.

4 weeks agoweb: Validate characters in all cookie attributes.
Ben Darnell [Fri, 6 Mar 2026 19:50:25 +0000 (14:50 -0500)] 
web: Validate characters in all cookie attributes.

Our previous control character check was missing a check for
U+007F, and also semicolons, which are only allowed in quoted
parts of values. This commit checks all attributes and
updates the set of disallowed characters.

4 weeks agohttputil: Add limits on multipart form data parsing
Ben Darnell [Tue, 3 Mar 2026 19:36:14 +0000 (14:36 -0500)] 
httputil: Add limits on multipart form data parsing

The new default limits prevent a DoS vulnerability involving
requests with many multipart parts. It also adds a defense-in-depth
limit on the size of multipart headers, which would have mitigated
the vulnerability fixed in 6.5.3.

New data structures are added to allow users to configure these limits,
and to disable multipart parsing entirely if they choose. However,
due to the complexity of the plumbing required to pass these
configuration options through the stack, the only configuration
provided in this commit is the ability to set a global default.

2 months agoMerge pull request #3573 from tornadoweb/dependabot/pip/wheel-0.46.2
Ben Darnell [Fri, 23 Jan 2026 01:16:18 +0000 (20:16 -0500)] 
Merge pull request #3573 from tornadoweb/dependabot/pip/wheel-0.46.2

build(deps): bump wheel from 0.45.1 to 0.46.2

2 months agobuild(deps): bump wheel from 0.45.1 to 0.46.2 3573/head
dependabot[bot] [Thu, 22 Jan 2026 19:16:25 +0000 (19:16 +0000)] 
build(deps): bump wheel from 0.45.1 to 0.46.2

Bumps [wheel](https://github.com/pypa/wheel) from 0.45.1 to 0.46.2.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.45.1...0.46.2)

---
updated-dependencies:
- dependency-name: wheel
  dependency-version: 0.46.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoMerge pull request #3572 from takluyver/compat-cleanup
Ben Darnell [Tue, 20 Jan 2026 14:26:57 +0000 (09:26 -0500)] 
Merge pull request #3572 from takluyver/compat-cleanup

Clean up some compatibility for older Python versions

2 months agoClean up some compatibility for older Python versions 3572/head
Thomas Kluyver [Sat, 17 Jan 2026 18:44:06 +0000 (18:44 +0000)] 
Clean up some compatibility for older Python versions

2 months agoMerge pull request #3570 from tornadoweb/dependabot/pip/filelock-3.20.3
Ben Darnell [Tue, 13 Jan 2026 20:41:56 +0000 (15:41 -0500)] 
Merge pull request #3570 from tornadoweb/dependabot/pip/filelock-3.20.3

build(deps): bump filelock from 3.20.1 to 3.20.3

2 months agobuild(deps): bump filelock from 3.20.1 to 3.20.3 3570/head
dependabot[bot] [Tue, 13 Jan 2026 20:28:22 +0000 (20:28 +0000)] 
build(deps): bump filelock from 3.20.1 to 3.20.3

Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.20.1 to 3.20.3.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/py-filelock/compare/3.20.1...3.20.3)

---
updated-dependencies:
- dependency-name: filelock
  dependency-version: 3.20.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoMerge pull request #3569 from tornadoweb/dependabot/pip/virtualenv-20.36.1
Ben Darnell [Tue, 13 Jan 2026 20:26:43 +0000 (15:26 -0500)] 
Merge pull request #3569 from tornadoweb/dependabot/pip/virtualenv-20.36.1

build(deps): bump virtualenv from 20.31.2 to 20.36.1

2 months agobuild(deps): bump virtualenv from 20.31.2 to 20.36.1 3569/head
dependabot[bot] [Tue, 13 Jan 2026 20:00:18 +0000 (20:00 +0000)] 
build(deps): bump virtualenv from 20.31.2 to 20.36.1

Bumps [virtualenv](https://github.com/pypa/virtualenv) from 20.31.2 to 20.36.1.
- [Release notes](https://github.com/pypa/virtualenv/releases)
- [Changelog](https://github.com/pypa/virtualenv/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pypa/virtualenv/compare/20.31.2...20.36.1)

---
updated-dependencies:
- dependency-name: virtualenv
  dependency-version: 20.36.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoMerge pull request #3568 from tornadoweb/dependabot/pip/urllib3-2.6.3
Ben Darnell [Mon, 12 Jan 2026 18:40:19 +0000 (13:40 -0500)] 
Merge pull request #3568 from tornadoweb/dependabot/pip/urllib3-2.6.3

build(deps): bump urllib3 from 2.6.0 to 2.6.3

3 months agobuild(deps): bump urllib3 from 2.6.0 to 2.6.3 3568/head
dependabot[bot] [Thu, 8 Jan 2026 06:35:07 +0000 (06:35 +0000)] 
build(deps): bump urllib3 from 2.6.0 to 2.6.3

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.0 to 2.6.3.
- [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.6.0...2.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 months agoMerge pull request #3566 from tornadoweb/dependabot/pip/filelock-3.20.1
Ben Darnell [Wed, 17 Dec 2025 18:38:43 +0000 (13:38 -0500)] 
Merge pull request #3566 from tornadoweb/dependabot/pip/filelock-3.20.1

build(deps): bump filelock from 3.18.0 to 3.20.1

3 months agobuild(deps): bump filelock from 3.18.0 to 3.20.1 3566/head
dependabot[bot] [Tue, 16 Dec 2025 22:45:34 +0000 (22:45 +0000)] 
build(deps): bump filelock from 3.18.0 to 3.20.1

Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.18.0 to 3.20.1.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/py-filelock/compare/3.18.0...3.20.1)

---
updated-dependencies:
- dependency-name: filelock
  dependency-version: 3.20.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
3 months agoMerge pull request #3563 from arnaudsjs/issue/fix-case-insensitivity-in-operator
Ben Darnell [Mon, 15 Dec 2025 18:28:18 +0000 (13:28 -0500)] 
Merge pull request #3563 from arnaudsjs/issue/fix-case-insensitivity-in-operator

Make sure that the in-operator on HTTPHeaders is case insensitive

3 months agoMake sure that the in-operator on HTTPHeaders is case insensitive 3563/head
Arnaud Schoonjans [Mon, 15 Dec 2025 11:12:18 +0000 (12:12 +0100)] 
Make sure that the in-operator on HTTPHeaders is case insensitive

3 months agoMerge pull request #3559 from bdarnell/relnotes-653-master
Ben Darnell [Thu, 11 Dec 2025 14:59:09 +0000 (09:59 -0500)] 
Merge pull request #3559 from bdarnell/relnotes-653-master

Release notes for 6.5.3

3 months agoRelease notes for 6.5.3 3559/head
Ben Darnell [Thu, 11 Dec 2025 02:58:28 +0000 (21:58 -0500)] 
Release notes for 6.5.3

3 months agoMerge pull request #3556 from bdarnell/perf-counter
Ben Darnell [Thu, 11 Dec 2025 03:16:17 +0000 (22:16 -0500)] 
Merge pull request #3556 from bdarnell/perf-counter

test: Use time.perf_counter instead of time.time for performance tests

3 months agotox: Pin pycares version 4 due to backwards-incompatible changes 3556/head
Ben Darnell [Thu, 11 Dec 2025 03:10:20 +0000 (22:10 -0500)] 
tox: Pin pycares version 4 due to backwards-incompatible changes

3 months agotest: Use time.perf_counter instead of time.time for performance tests
Ben Darnell [Thu, 11 Dec 2025 03:00:03 +0000 (22:00 -0500)] 
test: Use time.perf_counter instead of time.time for performance tests

On windows, time.time has low resolution (about 15ms), which makes
performance tests flaky. time.perf_counter has much higher resolution
and is the recommended way to measure elapsed time.

3 months agoMerge pull request #3554 from bdarnell/parseparam
Ben Darnell [Wed, 10 Dec 2025 20:55:02 +0000 (15:55 -0500)] 
Merge pull request #3554 from bdarnell/parseparam

httputil: Fix quadratic behavior in _parseparam

3 months agoMerge pull request #3553 from bdarnell/header-concat
Ben Darnell [Wed, 10 Dec 2025 20:54:49 +0000 (15:54 -0500)] 
Merge pull request #3553 from bdarnell/header-concat

httputil: Fix quadratic performance of repeated header lines

3 months agoMerge pull request #3552 from bdarnell/http-reason
Ben Darnell [Wed, 10 Dec 2025 20:54:32 +0000 (15:54 -0500)] 
Merge pull request #3552 from bdarnell/http-reason

web: Harden against invalid HTTP reason phrases

3 months agoweb: Harden against invalid HTTP reason phrases 3552/head
Ben Darnell [Wed, 10 Dec 2025 20:15:25 +0000 (15:15 -0500)] 
web: Harden against invalid HTTP reason phrases

We allow applications to set custom reason phrases for the HTTP status
line (to support custom status codes), but if this were exposed to
untrusted data it could be exploited in various ways. This commit
guards against invalid reason phrases in both HTTP headers and in
error pages.

3 months agohttputil: Fix quadratic behavior in _parseparam 3554/head
Ben Darnell [Wed, 10 Dec 2025 15:55:02 +0000 (10:55 -0500)] 
httputil: Fix quadratic behavior in _parseparam

Prior to this change, _parseparam had O(n^2) behavior when parsing
certain inputs, which could be a DoS vector. This change adapts
logic from the equivalent function in the python standard library
in https://github.com/python/cpython/pull/136072/files

4 months agohttputil: Fix quadratic performance of repeated header lines 3553/head
Ben Darnell [Tue, 9 Dec 2025 18:27:27 +0000 (13:27 -0500)] 
httputil: Fix quadratic performance of repeated header lines

Previouisly, when many header lines with the same name were found
in an HTTP request or response, repeated string concatenation would
result in quadratic performance. This change does the concatenation
lazily (with a cache) so that repeated headers can be processed
efficiently.

Security: The previous behavior allowed a denial of service attack
via a maliciously crafted HTTP message, but only if the
max_header_size was increased from its default of 64kB.

4 months agoprocess_test: Use isolated mode for subprocess tests
Ben Darnell [Tue, 9 Dec 2025 17:10:18 +0000 (12:10 -0500)] 
process_test: Use isolated mode for subprocess tests

Prompt customizations (notably the PYTHONSTARTUP file used by
vscode's terminal integration) can interfere with tests that run
interactive interpreters in a subprocess. Run those interpreters
in isolated mode to avoid this problem.)

4 months agoMerge pull request #3551 from bdarnell/demo-cleanup
Ben Darnell [Tue, 9 Dec 2025 15:51:18 +0000 (10:51 -0500)] 
Merge pull request #3551 from bdarnell/demo-cleanup

demos: Fix open redirects, remove s3server.py

4 months agodemos: Fix open redirects 3551/head
Ben Darnell [Tue, 9 Dec 2025 15:40:18 +0000 (10:40 -0500)] 
demos: Fix open redirects

Several demos had handlers that redirected to a "next" URL
provided as a query parameter without validating it first.

4 months agodemos: Remove s3server demo
Ben Darnell [Tue, 9 Dec 2025 15:19:34 +0000 (10:19 -0500)] 
demos: Remove s3server demo

This program does not demonstrate anything particularly interesting
about Tornado, nor is it a good stylistic example to follow. Its
handling of path validation is rudimentary and can be insecure in
some configurations. It makes more sense to remove it than to
try and improve it.

4 months agodemos: Remove obsolete note in demos/README.rst
Ben Darnell [Tue, 9 Dec 2025 15:18:36 +0000 (10:18 -0500)] 
demos: Remove obsolete note in demos/README.rst

This note referred to Tornado 6.3, which has been released.

4 months agoMerge pull request #3550 from tornadoweb/dependabot/pip/urllib3-2.6.0
Ben Darnell [Mon, 8 Dec 2025 16:30:18 +0000 (11:30 -0500)] 
Merge pull request #3550 from tornadoweb/dependabot/pip/urllib3-2.6.0

build(deps): bump urllib3 from 2.5.0 to 2.6.0

4 months agobuild(deps): bump urllib3 from 2.5.0 to 2.6.0 3550/head
dependabot[bot] [Sat, 6 Dec 2025 04:51:33 +0000 (04:51 +0000)] 
build(deps): bump urllib3 from 2.5.0 to 2.6.0

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.5.0 to 2.6.0.
- [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.5.0...2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
4 months agoMerge pull request #3542 from amn/amn/make-requesthandler-uri-attr-mandatory
Ben Darnell [Fri, 21 Nov 2025 18:59:46 +0000 (13:59 -0500)] 
Merge pull request #3542 from amn/amn/make-requesthandler-uri-attr-mandatory

Make `uri` and `method` attributes on `HTTPServerRequest` mandatory

5 months agoMake `uri` and `method` attributes on `HTTPServerRequest` mandatory 3542/head
Armen Michaeli [Sun, 9 Nov 2025 11:53:32 +0000 (12:53 +0100)] 
Make `uri` and `method` attributes on `HTTPServerRequest` mandatory

This adds assertion checks during initialisation of `HTTPServerRequest` object, to ensure the corresponding attributes of the object being created, won't end up being `None`. To be clear, it is still permitted to provide `None` or omit specification for both `uri` and `method` parameters to the constructor if the `start_line` parameter specifies [good] values instead.

This is motivated by the idea that per HTTP, requests _always_ feature a method and a URI, and so the model implemented with `HTTPServerRequest` is amended accordingly. Beyond the seemingly idealistic motivation, this helps with _typed_ Tornado applications using e.g. `self.request.uri` as part of request handling -- i.e. in code with `self` being a `RequestHandler` -- to safely assume e.g. `uri` or `method` are `str` and not `str | None` / `Optional[str]` which would require ad-hoc assertions ala `assert self.request.uri is not None` (or `assert self.request.uri`) in _application code_, which IMO is a case of "surprising the user" -- as everyone would expect a HTTP request to have an URI and method be clearly defined as e.g. strings -- certainly excluding the `None` value.

Again, because semantics of `start_line` are preserved, the initialisation of the object _may_ omit parameters `uri` and/or `method` if `start_line` specifies valid values for these instead. In any case, it is the _attributes_ of the object being constructed, that end up being effectively validated with `assert` -- which make the type checker (tested with MyPy 1.18.2 here) assume `str` instead of `str | None`.

6 months agoPermit streaming_callback of AsyncHTTPClient to be a coroutine. (#3471)
Aaron Gibson [Wed, 17 Sep 2025 17:43:47 +0000 (10:43 -0700)] 
Permit streaming_callback of AsyncHTTPClient to be a coroutine. (#3471)

Co-authored-by: Aaron Gibson <eulersidcrisis@yahoo.com>
7 months agoMerge pull request #3536 from bdarnell/cog
Ben Darnell [Thu, 21 Aug 2025 14:14:13 +0000 (10:14 -0400)] 
Merge pull request #3536 from bdarnell/cog

setup: Use cog to automate the annual chore of updating Python versions

7 months agosetup: Use cog to automate the annual chore of updating Python versions 3536/head
Ben Darnell [Wed, 20 Aug 2025 18:37:14 +0000 (14:37 -0400)] 
setup: Use cog to automate the annual chore of updating Python versions

We must specify our supported python versions in a variety of places
and formats, so use cog to update them all at once.

This commit drops support for Python 3.9, which will no longer be
supported by the time of the next release, and formalizes support for
Python 3.14.

7 months agoMerge pull request #3534 from bdarnell/typo-652
Ben Darnell [Tue, 12 Aug 2025 13:21:38 +0000 (09:21 -0400)] 
Merge pull request #3534 from bdarnell/typo-652

docs: Fix a broken link in release notes

7 months agodocs: Fix a broken link in release notes 3534/head
Ben Darnell [Tue, 12 Aug 2025 13:09:55 +0000 (09:09 -0400)] 
docs: Fix a broken link in release notes

Updates #3532

7 months agoMerge pull request #3532 from thijsvandien/master
Ben Darnell [Mon, 11 Aug 2025 13:31:12 +0000 (09:31 -0400)] 
Merge pull request #3532 from thijsvandien/master

Fix typo in release notes for 6.5.2

8 months agoFix typo in release notes for 6.5.2 3532/head
Thijs van Dien [Sat, 9 Aug 2025 04:06:49 +0000 (06:06 +0200)] 
Fix typo in release notes for 6.5.2

8 months agoMerge pull request #3531 from bdarnell/relnotes-652-master
Ben Darnell [Fri, 8 Aug 2025 18:27:33 +0000 (14:27 -0400)] 
Merge pull request #3531 from bdarnell/relnotes-652-master

Release notes for 6.5.2

8 months agoMerge pull request #3530 from bdarnell/context-aware-warnings
Ben Darnell [Fri, 8 Aug 2025 17:59:25 +0000 (13:59 -0400)] 
Merge pull request #3530 from bdarnell/context-aware-warnings

web_test: Move an ignore_deprecation block

8 months agoRelease notes for 6.5.2 3531/head
Ben Darnell [Fri, 8 Aug 2025 17:41:47 +0000 (13:41 -0400)] 
Release notes for 6.5.2

8 months agoweb_test: Move an ignore_deprecation block 3530/head
Ben Darnell [Fri, 8 Aug 2025 17:50:45 +0000 (13:50 -0400)] 
web_test: Move an ignore_deprecation block

When warnings are in context-aware mode (the default in free-threaded
Python 3.14), the server captures the context from setUp and does not
see the warning filter installed in the test method. Move the warning
filter into the handler so it works consistently regardless of the
context_aware_warnings flag.

Updates #3501

8 months agoBuild cp314 & cp314t wheels (#3525)
Lysandros Nikolaou [Fri, 8 Aug 2025 17:26:19 +0000 (20:26 +0300)] 
Build cp314 & cp314t wheels (#3525)

* Build cp314 & cp314t wheels

* Fix formatting

8 months agoMerge pull request #3528 from bdarnell/ping-interval-fix
Ben Darnell [Thu, 7 Aug 2025 21:07:48 +0000 (17:07 -0400)] 
Merge pull request #3528 from bdarnell/ping-interval-fix

websocket_ping: fix ping interval with non-zero timeout

8 months agoMerge pull request #3524 from hroncok/patch-1
Ben Darnell [Thu, 7 Aug 2025 21:06:58 +0000 (17:06 -0400)] 
Merge pull request #3524 from hroncok/patch-1

Do not require wheel for building

8 months agowebsocket: Expand testing of next-ping calculation 3528/head
Ben Darnell [Thu, 24 Jul 2025 20:37:48 +0000 (20:37 +0000)] 
websocket: Expand testing of next-ping calculation

Includes end-to-end tests that the correct number of pings are sent
(piggybacking on an existing test) and a unit test for the
`ping_sleep_time` calculation.

8 months agowebsocket_ping: fix ping interval with non-zero timeout and improve docs.
Oliver Sanders [Thu, 19 Jun 2025 10:06:29 +0000 (11:06 +0100)] 
websocket_ping: fix ping interval with non-zero timeout and improve docs.

* Fix a bug that caused the ping interval to be less frequent than
  configured.
* Fix erroneous documentation of the websocket_ping_timeout default and
  clarify units for the ping interval.

8 months agoMerge pull request #3526 from bdarnell/windows-file-test
Ben Darnell [Thu, 7 Aug 2025 20:37:48 +0000 (16:37 -0400)] 
Merge pull request #3526 from bdarnell/windows-file-test

web_test: Add test for windows special filenames in StaticFileHandler

8 months agoweb_test: Add test for windows special filenames in StaticFileHandler 3526/head
Ben Darnell [Thu, 7 Aug 2025 20:07:25 +0000 (16:07 -0400)] 
web_test: Add test for windows special filenames in StaticFileHandler

8 months agoMerge pull request #3523 from killerdevildog/fix-file-uploader-coroutine-issue-3182
Ben Darnell [Tue, 5 Aug 2025 20:18:17 +0000 (16:18 -0400)] 
Merge pull request #3523 from killerdevildog/fix-file-uploader-coroutine-issue-3182

Fix ValueError in file_uploader.py by converting @gen.coroutine to as…

8 months agoDo not require wheel for building 3524/head
Miro Hrončok [Mon, 28 Jul 2025 11:33:52 +0000 (13:33 +0200)] 
Do not require wheel for building

 - current version of setuptools (70.1+) does not need wheel at all
 - older versions of setuptools would fetch wheel when building wheels (but not sdists)

8 months agoFix ValueError in file_uploader.py by converting @gen.coroutine to async/await 3523/head
Quaylyn Rimer [Mon, 28 Jul 2025 02:45:49 +0000 (20:45 -0600)] 
Fix ValueError in file_uploader.py by converting @gen.coroutine to async/await

Fixes #3182

The file_uploader.py demo was failing with ValueError when trying to upload files
because @gen.coroutine decorated functions return tornado.concurrent.Future objects,
but asyncio.run() expects native coroutines.

This change converts the @gen.coroutine decorated functions to native async/await
syntax, which is the modern recommended approach and resolves the compatibility
issue with asyncio.run().

Changes:
- Remove tornado.gen import
- Convert @gen.coroutine decorators to async def
- Convert all yield statements to await
- Maintains backward compatibility with existing Tornado versions

8 months agoMerge pull request #3521 from bdarnell/host-error-handling
Ben Darnell [Tue, 22 Jul 2025 20:43:43 +0000 (16:43 -0400)] 
Merge pull request #3521 from bdarnell/host-error-handling

http1connection: Improve error logging for invalid host headers

8 months agohttp1connection: Improve error logging for invalid host headers 3521/head
Ben Darnell [Tue, 22 Jul 2025 17:54:03 +0000 (17:54 +0000)] 
http1connection: Improve error logging for invalid host headers

This was previously being logged as an uncaught exception in application
code, which is wrong for a malformed request. HTTPInputError now passes
through the app-error logging to be caught and reported as a 400
(which logs at the warning level to the access log and info to the
general log).

Fixes #3510

8 months agoMerge pull request #3519 from bdarnell/fix-host-argument
Ben Darnell [Mon, 21 Jul 2025 19:03:32 +0000 (15:03 -0400)] 
Merge pull request #3519 from bdarnell/fix-host-argument

httputil: Restore the host argument to HTTPServerRequest

9 months agohttputil: Restore the host argument to HTTPServerRequest 3519/head
Ben Darnell [Thu, 3 Jul 2025 21:40:55 +0000 (17:40 -0400)] 
httputil: Restore the host argument to HTTPServerRequest

This argument was mistakenly removed in Tornado 6.5.0 with no warning;
it is now back but deprecated. The host header should be used instead.

Updates #3468