]> git.ipfire.org Git - thirdparty/tornado.git/log
thirdparty/tornado.git
4 weeks agoMerge pull request #3371 from tornadoweb/dependabot/pip/idna-3.7 master
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

4 weeks 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>
2 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

3 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

3 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

3 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>
5 months agoMerge pull request #3352 from bdarnell/master branch6.4 stable v6.4.0
Ben Darnell [Wed, 29 Nov 2023 03:18:59 +0000 (22:18 -0500)] 
Merge pull request #3352 from bdarnell/master

Set version to 6.4 final

5 months agoSet version to 6.4 final 3352/head
Ben Darnell [Wed, 29 Nov 2023 02:55:46 +0000 (21:55 -0500)] 
Set version to 6.4 final

5 months agoMerge pull request #3348 from bdarnell/iostream-hostname-test v6.4.0b1
Ben Darnell [Thu, 16 Nov 2023 01:21:57 +0000 (20:21 -0500)] 
Merge pull request #3348 from bdarnell/iostream-hostname-test

iostream_test: Test check_hostname functionality.

5 months agoiostream_test: Don't require server-side log on windows 3348/head
Ben Darnell [Tue, 14 Nov 2023 03:11:59 +0000 (22:11 -0500)] 
iostream_test: Don't require server-side log on windows

5 months agoiostream_test: Test check_hostname functionality.
Ben Darnell [Tue, 14 Nov 2023 03:02:32 +0000 (22:02 -0500)] 
iostream_test: Test check_hostname functionality.

In #3337, the removal of ssl.match_hostname revealed that we did not
have any test coverage of hostname checking in tornado.iostream.
Since we were forced to remove the manual check that we had in place
for old versions of Python, we need a test to make sure that we didn't
inadvertently break hostname checking.

6 months agoMerge pull request #3341 from bdarnell/more-utcnow
Ben Darnell [Thu, 2 Nov 2023 01:48:50 +0000 (21:48 -0400)] 
Merge pull request #3341 from bdarnell/more-utcnow

web,demos: Remove more uses of deprecated datetime utc methods

6 months agoweb,demos: Remove more uses of deprecated datetime utc methods 3341/head
Ben Darnell [Thu, 2 Nov 2023 01:40:54 +0000 (21:40 -0400)] 
web,demos: Remove more uses of deprecated datetime utc methods

Add a simple test case to give us some basic coverage of this
code path.

Closes #3335

6 months agoMerge pull request #3339 from tornadoweb/dependabot/pip/urllib3-1.26.18
Ben Darnell [Sun, 29 Oct 2023 23:57:55 +0000 (19:57 -0400)] 
Merge pull request #3339 from tornadoweb/dependabot/pip/urllib3-1.26.18

build(deps): bump urllib3 from 1.26.17 to 1.26.18

6 months agoMerge pull request #3332 from bdarnell/selector-thread-atexit
Ben Darnell [Sun, 29 Oct 2023 23:56:38 +0000 (19:56 -0400)] 
Merge pull request #3332 from bdarnell/selector-thread-atexit

Revert "asyncio: Remove atexit hook"

6 months agobuild(deps): bump urllib3 from 1.26.17 to 1.26.18 3339/head
dependabot[bot] [Wed, 18 Oct 2023 01:28:06 +0000 (01:28 +0000)] 
build(deps): bump urllib3 from 1.26.17 to 1.26.18

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

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

Signed-off-by: dependabot[bot] <support@github.com>
6 months agotest: Close the thread pool in run_on_executor test 3332/head
Ben Darnell [Wed, 11 Oct 2023 00:39:25 +0000 (20:39 -0400)] 
test: Close the thread pool in run_on_executor test

If this executor was left around it would be GC'd at an unpredictable
time and would often be reported as a failure in other circlerefs tests.
(For unknown reasons this would occur most often in i686 (i.e. 32-bit)
linux builds).

6 months agoRevert "asyncio: Remove atexit hook"
Ben Darnell [Tue, 3 Oct 2023 01:39:39 +0000 (21:39 -0400)] 
Revert "asyncio: Remove atexit hook"

This reverts commit 62363740c1cc0e137ff4344c3afc3d52e070f200.

We are again seeing hangs at shutdown in
SyncHTTPClientTest.test_destructor_log. Maybe putting this back will
help.

6 months agoMerge pull request #3337 from bdarnell/py312-updates
Ben Darnell [Sat, 14 Oct 2023 02:46:47 +0000 (22:46 -0400)] 
Merge pull request #3337 from bdarnell/py312-updates

Updates for python 3.12 final

6 months ago*: Lint on the newest version of python too. 3337/head
Ben Darnell [Sat, 14 Oct 2023 02:39:41 +0000 (22:39 -0400)] 
*: Lint on the newest version of python too.

We previously only typechecked on the oldest version of python we
supported, incorrectly assuming nothing we depended on would be
removed. Now we typecheck on the latest version of python.

Assume support for modern version of ssl and remove some pre-SNI
code paths which rely on functions that are now removed.

6 months agodocs: Update intersphinx references for python 3.12
Ben Darnell [Sat, 14 Oct 2023 01:27:20 +0000 (21:27 -0400)] 
docs: Update intersphinx references for python 3.12

Intersphinx links are currently an unpinned dependency, so when
a new version of python is released it's possible (although relatively
rare) for it to break our links. 3.12 removed a few members of
the ssl module.

7 months agoMerge pull request #3333 from tornadoweb/dependabot/pip/urllib3-1.26.17
Ben Darnell [Sun, 8 Oct 2023 18:18:49 +0000 (14:18 -0400)] 
Merge pull request #3333 from tornadoweb/dependabot/pip/urllib3-1.26.17

build(deps): bump urllib3 from 1.26.14 to 1.26.17

7 months agobuild(deps): bump urllib3 from 1.26.14 to 1.26.17 3333/head
dependabot[bot] [Tue, 3 Oct 2023 01:47:22 +0000 (01:47 +0000)] 
build(deps): bump urllib3 from 1.26.14 to 1.26.17

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

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

Signed-off-by: dependabot[bot] <support@github.com>
7 months agoMerge pull request #3331 from bdarnell/wintest
Ben Darnell [Tue, 3 Oct 2023 01:44:48 +0000 (21:44 -0400)] 
Merge pull request #3331 from bdarnell/wintest

ci: Add windows to the main test config

7 months agoci: Add windows to the main test config 3331/head
Ben Darnell [Sat, 30 Sep 2023 19:39:53 +0000 (15:39 -0400)] 
ci: Add windows to the main test config

I've caused enough broken builds that aren't caught until the final
release pipeline; time to add this to the main test config.

7 months agoMerge pull request #3325 from bdarnell/version-6.4b1
Ben Darnell [Wed, 27 Sep 2023 00:57:12 +0000 (20:57 -0400)] 
Merge pull request #3325 from bdarnell/version-6.4b1

Set version number to 6.4b1

7 months agoSet version number to 6.4b1 3325/head
Ben Darnell [Wed, 27 Sep 2023 00:52:14 +0000 (20:52 -0400)] 
Set version number to 6.4b1

7 months agoMerge pull request #3324 from bdarnell/relnotes-6.4
Ben Darnell [Wed, 27 Sep 2023 00:50:45 +0000 (20:50 -0400)] 
Merge pull request #3324 from bdarnell/relnotes-6.4

docs: Release notes for 6.4.0

7 months agodocs: Release notes for 6.4.0 3324/head
Ben Darnell [Wed, 27 Sep 2023 00:16:00 +0000 (20:16 -0400)] 
docs: Release notes for 6.4.0

8 months agoMerge pull request #3308 from TnTomato/fix-WebSocketClientConnection-parameter
Ben Darnell [Sat, 2 Sep 2023 14:03:40 +0000 (10:03 -0400)] 
Merge pull request #3308 from TnTomato/fix-WebSocketClientConnection-parameter

Fix WebSocketClientConnection parameter

8 months agoMerge pull request #3317 from bdarnell/escape-updates
Ben Darnell [Wed, 23 Aug 2023 01:42:27 +0000 (21:42 -0400)] 
Merge pull request #3317 from bdarnell/escape-updates

escape: Use the standard library where possible

8 months agoescape: Remove noqa: F811 tags from overloads 3317/head
Ben Darnell [Wed, 23 Aug 2023 01:33:44 +0000 (21:33 -0400)] 
escape: Remove noqa: F811 tags from overloads

Newer versions of pyflakes no longer require this.

8 months agoescape: Use the standard library where possible
Ben Darnell [Wed, 23 Aug 2023 01:27:05 +0000 (21:27 -0400)] 
escape: Use the standard library where possible

Many of these functions were necessary in Python 2, but are now
redundant. We can simply use the standard library in many cases.
The only major change is in xhtml_unescape, where we now reject
invalid character references such as surrogates and control characters.

Update docs throughout to be more specific about differences from the
standard library. Also be more complete about the ``plus`` option to
the url escaping functions.

Fixes #3186

8 months agoMerge pull request #3316 from bdarnell/fix-docs-build
Ben Darnell [Wed, 23 Aug 2023 00:17:22 +0000 (20:17 -0400)] 
Merge pull request #3316 from bdarnell/fix-docs-build

docs: Fix build after readthedocs/readthedocs.org#10638

8 months agodocs: Fix build after readthedocs/readthedocs.org#10638 3316/head
Ben Darnell [Wed, 23 Aug 2023 00:01:34 +0000 (20:01 -0400)] 
docs: Fix build after readthedocs/readthedocs.org#10638

The old magic for sphinx_rtd_theme has been removed; now we should
handle the theme in the same way we do for local builds.

8 months agoMerge pull request #3315 from bdarnell/circlerefs
Ben Darnell [Tue, 22 Aug 2023 23:49:02 +0000 (19:49 -0400)] 
Merge pull request #3315 from bdarnell/circlerefs

ioloop,concurrent: Fix reference cycles

8 months agotest: Skip circlerefs test on pypy 3315/head
Ben Darnell [Tue, 22 Aug 2023 13:28:13 +0000 (09:28 -0400)] 
test: Skip circlerefs test on pypy

Pypy doesn't have the same refcount fast-path as cpython so the
gc behavior is different and this test is irrelevant.

8 months agotest: Fix circlerefs test on python 3.10 and before
Ben Darnell [Tue, 22 Aug 2023 03:14:49 +0000 (23:14 -0400)] 
test: Fix circlerefs test on python 3.10 and before

Local/attribute dicts are reported a bit differently here.

8 months agoioloop,concurrent: Fix reference cycles
Ben Darnell [Tue, 22 Aug 2023 03:03:39 +0000 (23:03 -0400)] 
ioloop,concurrent: Fix reference cycles

In a few places we were referring to a future via a closure instead
of using the reference passed as an argument to the callback.  This
sometimes causes a reference cycle that can slow GC. This commit
adds a test which covers two of the cases (chain_future and the
concurrent.future branch of add_future) while the third was found by
inspecting other calls to add_done_callback for obvious instances of
this pattern.

Fixes #2620

8 months agotest: Refactor circlerefs script into a test
Ben Darnell [Tue, 22 Aug 2023 02:20:34 +0000 (22:20 -0400)] 
test: Refactor circlerefs script into a test

This script was only ever run irregularly on its own; bring it in
to the test suite so it can be run automatically.

8 months agoMerge pull request #3312 from bdarnell/destructor-log-timeout
Ben Darnell [Sun, 13 Aug 2023 00:55:15 +0000 (20:55 -0400)] 
Merge pull request #3312 from bdarnell/destructor-log-timeout

httpclient_test: Increase test_destructor_log timeout

8 months agohttpclient_test: Increase test_destructor_log timeout 3312/head
Ben Darnell [Sun, 13 Aug 2023 00:42:15 +0000 (20:42 -0400)] 
httpclient_test: Increase test_destructor_log timeout

This test has recently become flaky on windows CI, and before
investigating further, see if it's just because the CI machines are
overloaded and subprocesses are slower on windows.

8 months agoMerge pull request #3309 from bdarnell/relnotes-633
Ben Darnell [Fri, 11 Aug 2023 15:40:19 +0000 (11:40 -0400)] 
Merge pull request #3309 from bdarnell/relnotes-633

Release notes for 6.3.3

8 months agoRelease notes for 6.3.3 3309/head
Ben Darnell [Fri, 11 Aug 2023 02:38:19 +0000 (22:38 -0400)] 
Release notes for 6.3.3

8 months agoFix WebSocketClientConnection parameter 3308/head
Chengzzzi [Fri, 11 Aug 2023 09:32:59 +0000 (17:32 +0800)] 
Fix WebSocketClientConnection parameter

9 months agoMerge pull request #3306 from bdarnell/fix-ci
Ben Darnell [Fri, 11 Aug 2023 01:48:27 +0000 (21:48 -0400)] 
Merge pull request #3306 from bdarnell/fix-ci

httpserver_test: Add ExpectLog to fix CI

9 months agohttpserver_test: Add ExpectLog to fix CI 3306/head
Ben Darnell [Fri, 11 Aug 2023 01:41:40 +0000 (21:41 -0400)] 
httpserver_test: Add ExpectLog to fix CI

The github security advisory feature lets you make private PRs but
it apparently doesn't support CI so this log failure wasn't caught
until after the PR was merged.

9 months agoMerge pull request from GHSA-qppv-j76h-2rpx
Ben Darnell [Fri, 11 Aug 2023 01:05:53 +0000 (21:05 -0400)] 
Merge pull request from GHSA-qppv-j76h-2rpx

http1connection: Make content-length parsing more strict

9 months agohttp1connection: Make content-length parsing more strict
Ben Darnell [Wed, 9 Aug 2023 01:55:02 +0000 (21:55 -0400)] 
http1connection: Make content-length parsing more strict

Content-length and chunk size parsing now strictly matches the RFCs.
We previously used the python int() function which accepted leading
plus signs and internal underscores, which are not allowed by the
HTTP RFCs (it also accepts minus signs, but these are less problematic
in this context since they'd result in errors elsewhere)

It is important to fix this because when combined with certain proxies,
the lax parsing could result in a request smuggling vulnerability (if
both Tornado and the proxy accepted an invalid content-length but
interpreted it differently). This is known to occur with old versions
of haproxy, although the current version of haproxy is unaffected.

9 months agoMerge pull request #3305 from bdarnell/redirect-test-windows
Ben Darnell [Wed, 9 Aug 2023 00:33:06 +0000 (20:33 -0400)] 
Merge pull request #3305 from bdarnell/redirect-test-windows

web_test: Fix open redirect test on windows

9 months agoweb_test: Fix open redirect test on windows 3305/head
Ben Darnell [Wed, 9 Aug 2023 00:23:19 +0000 (20:23 -0400)] 
web_test: Fix open redirect test on windows

Drive letters in windows absolute paths mess up this test,
so remove them and use a path relative to the drive root instead.

9 months agoMerge pull request #3304 from Alnusjaponica/fix-typo
Ben Darnell [Mon, 7 Aug 2023 01:44:12 +0000 (21:44 -0400)] 
Merge pull request #3304 from Alnusjaponica/fix-typo

Fix syntax error in docstring

9 months agoFix syntax error in docstring 3304/head
Shinichi Hemmi [Fri, 4 Aug 2023 04:40:02 +0000 (13:40 +0900)] 
Fix syntax error in docstring

9 months agoMerge pull request #3303 from bdarnell/type-updates
Ben Darnell [Thu, 27 Jul 2023 02:13:29 +0000 (22:13 -0400)] 
Merge pull request #3303 from bdarnell/type-updates

Update mypy/typeshed, update a few types

9 months agoioloop: Annotate run_in_executor returning Future, not Awaitable 3303/head
Ben Darnell [Thu, 27 Jul 2023 02:00:20 +0000 (22:00 -0400)] 
ioloop: Annotate run_in_executor returning Future, not Awaitable

This required a recent update to typeshed/mypy.

Fixes #3093

9 months agolint: Update mypy
Ben Darnell [Thu, 27 Jul 2023 01:55:12 +0000 (21:55 -0400)] 
lint: Update mypy

9 months agobuild: Upgrade pip-tools
Ben Darnell [Thu, 27 Jul 2023 01:51:56 +0000 (21:51 -0400)] 
build: Upgrade pip-tools

Fixes a conflict between pip-tools and pip.

9 months agobuild: Move linters to python 3.11
Ben Darnell [Thu, 27 Jul 2023 01:48:03 +0000 (21:48 -0400)] 
build: Move linters to python 3.11

9 months agoMerge pull request #3302 from bdarnell/autoreload-updates
Ben Darnell [Thu, 27 Jul 2023 01:39:07 +0000 (21:39 -0400)] 
Merge pull request #3302 from bdarnell/autoreload-updates

autoreload: Various updates

9 months agoautoreload: Modernize type annotations 3302/head
Ben Darnell [Thu, 27 Jul 2023 01:17:34 +0000 (21:17 -0400)] 
autoreload: Modernize type annotations

9 months agoautoreload: Remove some code for MacOS 10.5 compatibility
Ben Darnell [Thu, 27 Jul 2023 01:02:12 +0000 (21:02 -0400)] 
autoreload: Remove some code for MacOS 10.5 compatibility

9 months agoautoreload: Remove some code for compatibility with py3.3
Ben Darnell [Thu, 27 Jul 2023 01:01:35 +0000 (21:01 -0400)] 
autoreload: Remove some code for compatibility with py3.3

9 months agoautoreload: Add --until-success flag
Ben Darnell [Thu, 27 Jul 2023 00:15:12 +0000 (20:15 -0400)] 
autoreload: Add --until-success flag

This flag terminates the autoreload loop after the first successful
run. This makes it possible to cleanly shut down a process that is using
"python -m tornado.autoreload" without printing a traceback.

Fixes #2398

9 months agoMerge pull request #3300 from tornadoweb/dependabot/pip/certifi-2023.7.22
Ben Darnell [Wed, 26 Jul 2023 00:18:21 +0000 (20:18 -0400)] 
Merge pull request #3300 from tornadoweb/dependabot/pip/certifi-2023.7.22

build(deps): bump certifi from 2022.12.7 to 2023.7.22

9 months agobuild(deps): bump certifi from 2022.12.7 to 2023.7.22 3300/head
dependabot[bot] [Tue, 25 Jul 2023 21:07:47 +0000 (21:07 +0000)] 
build(deps): bump certifi from 2022.12.7 to 2023.7.22

Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.12.7 to 2023.7.22.
- [Commits](https://github.com/certifi/python-certifi/compare/2022.12.07...2023.07.22)

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

Signed-off-by: dependabot[bot] <support@github.com>
9 months agoautoreload: Support directories in CLI wrapper
Ben Darnell [Sun, 23 Jul 2023 02:10:18 +0000 (22:10 -0400)] 
autoreload: Support directories in CLI wrapper

A previous commit added support for using autoreload within programs
that were started as directories; this commit supports them when
run with the -m tornado.autoreload wrapper.

This change may have side effects for file mode since we now use
runpy.run_path instead of executing the file by hand (I don't think
the run_path function existed when this code was originally written).

9 months agoautoreload_test: Reduce repetition
Ben Darnell [Sun, 23 Jul 2023 01:42:22 +0000 (21:42 -0400)] 
autoreload_test: Reduce repetition

9 months agoautoreload: Switch to a real option parser
Ben Darnell [Sun, 23 Jul 2023 01:09:36 +0000 (21:09 -0400)] 
autoreload: Switch to a real option parser

This will make it easier to add other options (for #2398)

9 months agoautoreload: Support the ability to run a directory instead of a module
Ben Darnell [Fri, 14 Jul 2023 00:57:11 +0000 (20:57 -0400)] 
autoreload: Support the ability to run a directory instead of a module

Running a directory has some but not all of the behavior of
running a module, including setting __spec__, so we must be careful
not to break things by assuming that __spec__ means module mode.

Fixes #2855

9 months agoMerge pull request #3297 from tornadoweb/dependabot/pip/pygments-2.15.0
Ben Darnell [Sat, 22 Jul 2023 18:20:42 +0000 (14:20 -0400)] 
Merge pull request #3297 from tornadoweb/dependabot/pip/pygments-2.15.0

build(deps): bump pygments from 2.14.0 to 2.15.0

9 months agobuild(deps): bump pygments from 2.14.0 to 2.15.0 3297/head
dependabot[bot] [Thu, 20 Jul 2023 12:05:51 +0000 (12:05 +0000)] 
build(deps): bump pygments from 2.14.0 to 2.15.0

Bumps [pygments](https://github.com/pygments/pygments) from 2.14.0 to 2.15.0.
- [Release notes](https://github.com/pygments/pygments/releases)
- [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES)
- [Commits](https://github.com/pygments/pygments/compare/2.14.0...2.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
10 months agoMerge pull request #3295 from bdarnell/remove-asyncio-atexit
Ben Darnell [Sat, 8 Jul 2023 01:26:30 +0000 (21:26 -0400)] 
Merge pull request #3295 from bdarnell/remove-asyncio-atexit

asyncio: Remove atexit hook

10 months agoasyncio: Remove atexit hook 3295/head
Ben Darnell [Sat, 8 Jul 2023 01:19:18 +0000 (21:19 -0400)] 
asyncio: Remove atexit hook

This hook was added because of an only-in-CI issue, but we have since
improved our cleanup of the selector thread. As long as this passes
CI, I think we can remove the atexit hook.

Fixes #3291

10 months agoMerge pull request #3294 from bdarnell/auth-updates
Ben Darnell [Sat, 8 Jul 2023 01:17:46 +0000 (21:17 -0400)] 
Merge pull request #3294 from bdarnell/auth-updates

auth: Various updates

10 months agoauth: Fix doctests 3294/head
Ben Darnell [Sat, 8 Jul 2023 00:46:14 +0000 (20:46 -0400)] 
auth: Fix doctests

10 months agoauth: Copy google mixin comment to top-of-file
Ben Darnell [Sat, 8 Jul 2023 00:31:18 +0000 (20:31 -0400)] 
auth: Copy google mixin comment to top-of-file

10 months agoauth: Use a setting for facebook redirect url
Ben Darnell [Sat, 8 Jul 2023 00:09:36 +0000 (20:09 -0400)] 
auth: Use a setting for facebook redirect url

Matches a change made to the Google auth mixin in a previous commit.

Fixes #756

10 months agoauth: Update facebook scope
Ben Darnell [Sat, 8 Jul 2023 00:04:27 +0000 (20:04 -0400)] 
auth: Update facebook scope

The read_stream scope was replaced with user_posts; this change
was made to demos/facebook/facebook.py in #1674 but the corresponding
comment was not updated. The offline_access scope has also been removed
but seems irrelvant to this comment.

Fixes #1566

10 months agodemos: Add a demo app for google auth
Ben Darnell [Fri, 7 Jul 2023 23:37:45 +0000 (19:37 -0400)] 
demos: Add a demo app for google auth

Add some more detail to app registration docs.

This was done mainly to verify that we don't need to introduce
new parameters as requested in #2140

Closes #2140

10 months agoauth: Deprecate TwitterMixin
Ben Darnell [Mon, 19 Jun 2023 20:12:24 +0000 (16:12 -0400)] 
auth: Deprecate TwitterMixin

It's unclear to what extent this class still works given Twitter's
recent API changes. Deprecate it since I don't intend to track
future changes here.

10 months agoauth: Deprecate unused client_secret parameter
Ben Darnell [Mon, 19 Jun 2023 19:54:01 +0000 (15:54 -0400)] 
auth: Deprecate unused client_secret parameter

OAuth2Mixin.authorize_redirect has never used this argument
and similar methods in this module don't have it.

Closes #1122

10 months agoMerge pull request #3276 from bdarnell/open-redirect-test
Ben Darnell [Thu, 22 Jun 2023 01:33:38 +0000 (21:33 -0400)] 
Merge pull request #3276 from bdarnell/open-redirect-test

test: Add test for open redirect fixed in 6.3.2

10 months agotest: Add test for open redirect fixed in 6.3.2 3276/head
Ben Darnell [Wed, 7 Jun 2023 02:48:05 +0000 (22:48 -0400)] 
test: Add test for open redirect fixed in 6.3.2

10 months agoMerge pull request #3288 from bdarnell/enable-312
Ben Darnell [Thu, 22 Jun 2023 01:15:05 +0000 (21:15 -0400)] 
Merge pull request #3288 from bdarnell/enable-312

Updates for Python 3.12

10 months ago*: Adapt to deprecation of datetime utc methods 3288/head
Ben Darnell [Fri, 9 Jun 2023 02:52:19 +0000 (22:52 -0400)] 
*: Adapt to deprecation of datetime utc methods

Python 3.12 deprecates the utcnow and utcfromtimestamp methods and
discourages the use of naive datetimes to represent UTC. This was
previously the main way that Tornado used datetimes (since it was
the only option available in Python 2 before the introduction
of datetime.timezone.utc in Python 3.2).

- httpclient_test: Test-only change to test that both kinds of datetimes
  are supported in If-Modified-Since (this just calls
  httputil.format_timestamp)
- httputil: No functional changes, but format_timestamp's
  support for both naive and aware datetimes is now tested.
- locale: format_timestamp now supports aware datetimes (in
  addition to the existing support for naive datetimes).
- web: Cookie expirations internally use aware datetimes.
  StaticFileHandler.get_modified_time now supports both and the
  standard implementation returns aware.

It feels fragile that "naive" and "aware" datetimes are not distinct
types but subject to data-dependent behavior. This change uses
"aware" datetimes throughout Tornado, but some operations (comparisons
and subtraction) fail with mixed datetime types and if I missed any
in this change may cause errors if naive datetimes were used (where
previously naive datetimes would have been required). But that's
apparently the API we have to work with.

10 months agobuild: Upgrade tox to support python 3.12
Ben Darnell [Wed, 7 Jun 2023 03:25:38 +0000 (23:25 -0400)] 
build: Upgrade tox to support python 3.12

10 months agoci: Re-enable python 3.12
Ben Darnell [Thu, 22 Jun 2023 00:53:19 +0000 (20:53 -0400)] 
ci: Re-enable python 3.12

Now that python/cpython#105808 is fixed in beta 3.

10 months agoMerge pull request #3284 from bdarnell/asyncio-test
Ben Darnell [Mon, 19 Jun 2023 19:39:00 +0000 (15:39 -0400)] 
Merge pull request #3284 from bdarnell/asyncio-test

asyncio_test: Use inequality when looking for thread leaks

10 months agoasyncio_test: Remove obsolete py3.4 compatibility 3284/head
Ben Darnell [Mon, 19 Jun 2023 19:30:48 +0000 (15:30 -0400)] 
asyncio_test: Remove obsolete py3.4 compatibility

10 months agoasyncio_test: Use inequality when checking thread leaks
Ben Darnell [Mon, 19 Jun 2023 19:28:45 +0000 (15:28 -0400)] 
asyncio_test: Use inequality when checking thread leaks

Sometimes we have a net reduction in the thread count
because there was an extra thread running at the time captured
the starting count, so use inequality instead of exact matches.

10 months agoMerge pull request #3283 from bdarnell/asyncio-types
Ben Darnell [Mon, 19 Jun 2023 19:31:05 +0000 (15:31 -0400)] 
Merge pull request #3283 from bdarnell/asyncio-types

asyncio: Modernize type annotations

10 months agoasyncio: Modernize type annotations 3283/head
Ben Darnell [Mon, 19 Jun 2023 19:24:54 +0000 (15:24 -0400)] 
asyncio: Modernize type annotations

10 months agoMerge pull request #3272 from bdarnell/asyncio-canary
Ben Darnell [Mon, 19 Jun 2023 17:45:41 +0000 (13:45 -0400)] 
Merge pull request #3272 from bdarnell/asyncio-canary

asyncio: Use a canary task to detect end of event loop

10 months agoasyncio: Manage the selector thread with an async generator 3272/head
Ben Darnell [Wed, 17 May 2023 00:57:50 +0000 (20:57 -0400)] 
asyncio: Manage the selector thread with an async generator

Async generators have a special shutdown protocol which allows
us to detect the end of the event loop and stop our thread.
This lets us clean up the thread reliably when the event loop
is started/stopped via the tornado IOLoop interfaces (which
explicitly know about the selector thread), or when the
latest asyncio interfaces are used (asyncio.run or manually
calling shutdown_asyncgens).

The thread is still leaked when older versions of the asyncio
interfaces are used (loop.close *without* shutdown_asyncgens), but
I've been unable to find a solution that does not print leak warnings
even in the event of a clean shutdown. Use of shutdown_asyncgens is
now effectively required for apps combining asyncio and tornado.
This is unfortunate since leaking a thread is relatively expensive
compared to the usual consequences of failing to call
shutdown_asyncgens, but it seems to be the best we can do.

Fixes #3173

10 months agoMerge pull request #3280 from bdarnell/disable-312
Ben Darnell [Thu, 15 Jun 2023 01:41:51 +0000 (21:41 -0400)] 
Merge pull request #3280 from bdarnell/disable-312

ci: Disable Python 3.12 in CI

10 months agoci: Disable Python 3.12 in CI 3280/head
Ben Darnell [Thu, 15 Jun 2023 01:31:32 +0000 (21:31 -0400)] 
ci: Disable Python 3.12 in CI

Current betas have a bug in GzipFile we can't easily work around.
https://github.com/python/cpython/issues/105808

11 months agoMerge pull request #3273 from tornadoweb/dependabot/pip/requests-2.31.0
Ben Darnell [Sat, 27 May 2023 03:00:42 +0000 (23:00 -0400)] 
Merge pull request #3273 from tornadoweb/dependabot/pip/requests-2.31.0

build(deps): bump requests from 2.28.2 to 2.31.0

11 months agobuild(deps): bump requests from 2.28.2 to 2.31.0 3273/head
dependabot[bot] [Tue, 23 May 2023 05:57:30 +0000 (05:57 +0000)] 
build(deps): bump requests from 2.28.2 to 2.31.0

Bumps [requests](https://github.com/psf/requests) from 2.28.2 to 2.31.0.
- [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.28.2...v2.31.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
11 months agoMerge pull request #3029 from minrk/reuse-selector
Ben Darnell [Mon, 15 May 2023 02:15:04 +0000 (22:15 -0400)] 
Merge pull request #3029 from minrk/reuse-selector

separate SelectorThread into its own object

11 months agoMerge branch 'master' into pr/minrk/3029 3029/head
Ben Darnell [Mon, 15 May 2023 02:02:44 +0000 (22:02 -0400)] 
Merge branch 'master' into pr/minrk/3029