Repository: twisted/twisted

Issue:
Release 22.1.0
|[<img alt="adiroiban's avatar" src="https://avatars.githubusercontent.com/u/204609?s=50" width="50" height="50">](https://github.com/adiroiban)| @adiroiban reported|
|-|-|
|Trac ID|trac#10296|
|Type|enhancement|
|Created|2022-01-26 23:00:40Z|



<details><summary>Searchable metadata</summary>

```
trac-id__10296 10296
type__enhancement enhancement
reporter__adiroiban adiroiban
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__new new
resolution__None None
component__core core
keywords__None None
time__1643238040096069 1643238040096069
changetime__1643238699617231 1643238699617231
version__None None
owner__None None

```
</details>


Discussion:

Patch:
diff --git a/LICENSE b/LICENSE
index 10950834ae..0a1dd5572f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2001-2021
+Copyright (c) 2001-2022
 Allen Short
 Amber Hawkie Brown
 Andrew Bennetts
diff --git a/NEWS.rst b/NEWS.rst
index 5ff8aaa1dd..b688059071 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -3,6 +3,109 @@ http://twistedmatrix.com/trac/ticket/<number>
 
 .. towncrier release notes start
 
+Twisted 22.1.0 (2022-02-03)
+===========================
+
+Features
+--------
+
+- Python 3.10 is now a supported platform (#10224)
+- Type annotations have been added to the twisted.python.fakepwd module. (#10287)
+
+
+Bugfixes
+--------
+
+- twisted.internet.defer.inlineCallbacks has an improved type annotation, to avoid typing errors when it is used on a function which returns a non-None result. (#10231)
+- ``twisted.internet.base.DelayedCall.__repr__`` and ``twisted.internet.task.LoopingCall.__repr__`` had the changes from #10155 reverted to accept non-function callables.  (#10235)
+- Revert the removal of .whl building that was done as part of #10177. (#10236)
+- The type annotation of the host parameter to twisted.internet.interfaces.IReactorTCP.connectTCP has been corrected from bytes to str. (#10251)
+- Deprecated ``twisted.python.threading.ThreadPool.currentThread()`` in favor of ``threading.current_thread()``.
+  Switched ``twisted.python.threading.ThreadPool.currentThread()`` and ``twisted.python.threadable.getThreadID()`` to use `threading.current_thread()`` to avoid the deprecation warnings introduced for ``threading.currentThread()`` in Python 3.10. (#10273)
+
+
+Improved Documentation
+----------------------
+
+- twisted.internet.utils.runWithWarningsSupressed behavior of waiting on deferreds has been documented. (#10238)
+- Sync API docs templates with pydoctor 21.9.0 release, using new theming capabilities. (#10267)
+
+
+Misc
+----
+
+- #1681, #9944, #10198, #10218, #10219, #10228, #10229, #10234, #10239, #10240, #10245, #10246, #10248, #10250, #10255, #10277, #10288, #10292
+
+
+Conch
+-----
+
+Bugfixes
+--------
+
+- SSHTransportBase.ssh_KEXINIT now uses the remote peer preferred MAC list for negotiation. In previous versions  it was only using the local preferred MAC list. (#10241)
+
+
+Features
+~~~~~~~~
+
+- twisted.conch.ssh now supports SSH extension negotiation (RFC 8308). (#10266)
+
+
+Bugfixes
+~~~~~~~~
+
+- twisted.conch now uses constant-time comparisons for MACs. (#8199)
+- twisted.conch.ssh.filetransfer.FileTransferServer will now return an ENOENT error status if an SFTP client tries to close an unrecognized file handle. (#10293)
+
+
+Web
+---
+
+Bugfixes
+~~~~~~~~
+
+- twisted.web.client.RedirectAgent and twisted.web.client.BrowserLikeRedirectAgent now properly remove sensitive headers when redirecting to a different origin. (#10294)
+
+
+Improved Documentation
+----------------------
+
+- Add type annotations for twisted.web.client.readBody. (#10269)
+
+
+Deprecations and Removals
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- twisted.web.client.getPage, twisted.web.client.downladPage, and the associated implementation classes (HTTPPageGetter, HTTPPageDownloader, HTTPClientFactory, HTTPDownloader) have been removed because they do not segregate cookies by domain. They were deprecated in Twisted 16.7.0 in favor of twisted.web.client.Agent. GHSA-92x2-jw7w-xvvx. (#10295)
+
+
+Mail
+----
+
+No significant changes.
+
+
+Words
+-----
+
+No significant changes.
+
+
+Names
+-----
+
+No significant changes.
+
+
+Trial
+-----
+
+Bugfixes
+~~~~~~~~
+
+- trial.runner.filenameToModule now sets the correct module.__name__ and sys.modules key (#10230)
+
 
 Twisted 21.7.0 (2021-07-26)
 ===========================
diff --git a/README.rst b/README.rst
index 08fece83df..8504ef5ef0 100644
--- a/README.rst
+++ b/README.rst
@@ -87,7 +87,7 @@ Or, for speed, use pre-commit directly::
 Copyright
 ---------
 
-All of the code in this distribution is Copyright (c) 2001-2021 Twisted Matrix Laboratories.
+All of the code in this distribution is Copyright (c) 2001-2022 Twisted Matrix Laboratories.
 
 Twisted is made available under the MIT license.
 The included `LICENSE <LICENSE>`_ file describes this in detail.
diff --git a/src/twisted/_version.py b/src/twisted/_version.py
index ebdcbe73a7..ae72bd784d 100644
--- a/src/twisted/_version.py
+++ b/src/twisted/_version.py
@@ -7,5 +7,5 @@ Provides Twisted version information.
 
 from incremental import Version
 
-__version__ = Version("Twisted", 21, 7, 0, post=0)
+__version__ = Version("Twisted", 22, 1, 0, post=0)
 __all__ = ["__version__"]
diff --git a/src/twisted/conch/newsfragments/10266.feature b/src/twisted/conch/newsfragments/10266.feature
deleted file mode 100644
index 63c394fc4b..0000000000
--- a/src/twisted/conch/newsfragments/10266.feature
+++ /dev/null
@@ -1,1 +0,0 @@
-twisted.conch.ssh now supports SSH extension negotiation (RFC 8308).
diff --git a/src/twisted/conch/newsfragments/10293.bugfix b/src/twisted/conch/newsfragments/10293.bugfix
deleted file mode 100644
index ba00280afe..0000000000
--- a/src/twisted/conch/newsfragments/10293.bugfix
+++ /dev/null
@@ -1,1 +0,0 @@
-twisted.conch.ssh.filetransfer.FileTransferServer will now return an ENOENT error status if an SFTP client tries to close an unrecognized file handle.
diff --git a/src/twisted/conch/newsfragments/8199.bugfix b/src/twisted/conch/newsfragments/8199.bugfix
deleted file mode 100644
index 6efccba407..0000000000
--- a/src/twisted/conch/newsfragments/8199.bugfix
+++ /dev/null
@@ -1,1 +0,0 @@
-twisted.conch now uses constant-time comparisons for MACs.
diff --git a/src/twisted/copyright.py b/src/twisted/copyright.py
index 18b30e2c5a..53c8994108 100644
--- a/src/twisted/copyright.py
+++ b/src/twisted/copyright.py
@@ -13,7 +13,7 @@ from twisted import __version__ as version, version as _longversion
 longversion = str(_longversion)
 
 copyright = """\
-Copyright (c) 2001-2021 Twisted Matrix Laboratories.
+Copyright (c) 2001-2022 Twisted Matrix Laboratories.
 See LICENSE for details."""
 
 disclaimer = """
diff --git a/src/twisted/newsfragments/10198.misc b/src/twisted/newsfragments/10198.misc
deleted file mode 100644
index 1c3a99137c..0000000000
--- a/src/twisted/newsfragments/10198.misc
+++ /dev/null
@@ -1,1 +0,0 @@
-Add type hints to twisted.internet.test.test_core
diff --git a/src/twisted/newsfragments/10218.misc b/src/twisted/newsfragments/10218.misc
deleted file mode 100644
index 25aa54e3ab..0000000000
--- a/src/twisted/newsfragments/10218.misc
+++ /dev/null
@@ -1,1 +0,0 @@
-rerun pre-commit autoupdate for 2021-07-17
diff --git a/src/twisted/newsfragments/10219.misc b/src/twisted/newsfragments/10219.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10224.feature b/src/twisted/newsfragments/10224.feature
deleted file mode 100644
index 379fc522d9..0000000000
--- a/src/twisted/newsfragments/10224.feature
+++ /dev/null
@@ -1,1 +0,0 @@
-support Python 3.10b4
diff --git a/src/twisted/newsfragments/10228.misc b/src/twisted/newsfragments/10228.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10229.misc b/src/twisted/newsfragments/10229.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10231.bugfix b/src/twisted/newsfragments/10231.bugfix
deleted file mode 100644
index e464ec1810..0000000000
--- a/src/twisted/newsfragments/10231.bugfix
+++ /dev/null
@@ -1,1 +0,0 @@
-twisted.internet.defer.inlineCallbacks has an improved type annotation, to avoid typing errors when it is used on a function which returns a non-None result.
diff --git a/src/twisted/newsfragments/10234.misc b/src/twisted/newsfragments/10234.misc
deleted file mode 100644
index 8b13789179..0000000000
--- a/src/twisted/newsfragments/10234.misc
+++ /dev/null
@@ -1,1 +0,0 @@
-
diff --git a/src/twisted/newsfragments/10235.bugfix b/src/twisted/newsfragments/10235.bugfix
deleted file mode 100644
index c69cc4541f..0000000000
--- a/src/twisted/newsfragments/10235.bugfix
+++ /dev/null
@@ -1,1 +0,0 @@
-revert changes to ``DelayedCall.__repr__`` and ``LoopingCall.__repr__``
diff --git a/src/twisted/newsfragments/10236.bugfix b/src/twisted/newsfragments/10236.bugfix
deleted file mode 100644
index c1a2159f3a..0000000000
--- a/src/twisted/newsfragments/10236.bugfix
+++ /dev/null
@@ -1,1 +0,0 @@
-restore .whl building
diff --git a/src/twisted/newsfragments/10238.doc b/src/twisted/newsfragments/10238.doc
deleted file mode 100644
index 97b4f58a51..0000000000
--- a/src/twisted/newsfragments/10238.doc
+++ /dev/null
@@ -1,1 +0,0 @@
-twisted.internet.utils.runWithWarningsSupressed behavior of waiting on deferreds has been documented.
diff --git a/src/twisted/newsfragments/10239.misc b/src/twisted/newsfragments/10239.misc
deleted file mode 100644
index fd39610f01..0000000000
--- a/src/twisted/newsfragments/10239.misc
+++ /dev/null
@@ -1,1 +0,0 @@
-A battle against entropy has been won, but the war rages on.
diff --git a/src/twisted/newsfragments/10240.misc b/src/twisted/newsfragments/10240.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10241.bugfix b/src/twisted/newsfragments/10241.bugfix
deleted file mode 100644
index ce57c54413..0000000000
--- a/src/twisted/newsfragments/10241.bugfix
+++ /dev/null
@@ -1,2 +0,0 @@
-SSHTransportBase.ssh_KEXINIT now uses the remote peer preferred MAC list for negotiation. In previous versions  it was only using the local preferred MAC list.
-
diff --git a/src/twisted/newsfragments/10245.misc b/src/twisted/newsfragments/10245.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10246.misc b/src/twisted/newsfragments/10246.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10248.misc b/src/twisted/newsfragments/10248.misc
deleted file mode 100644
index fe1ab98237..0000000000
--- a/src/twisted/newsfragments/10248.misc
+++ /dev/null
@@ -1,1 +0,0 @@
-automatically sort imports with isort. This should have no observable change in behaviour.
diff --git a/src/twisted/newsfragments/10250.misc b/src/twisted/newsfragments/10250.misc
deleted file mode 100644
index 51ea7eb269..0000000000
--- a/src/twisted/newsfragments/10250.misc
+++ /dev/null
@@ -1,1 +0,0 @@
-Document official support for Py3.10. (Metadata change only)
diff --git a/src/twisted/newsfragments/10251.bugfix b/src/twisted/newsfragments/10251.bugfix
deleted file mode 100644
index 7d004829ec..0000000000
--- a/src/twisted/newsfragments/10251.bugfix
+++ /dev/null
@@ -1,1 +0,0 @@
-The type annotation of the host parameter to twisted.internet.interfaces.IReactorTCP.connectTCP has been corrected from bytes to str.
diff --git a/src/twisted/newsfragments/10255.misc b/src/twisted/newsfragments/10255.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10267.doc b/src/twisted/newsfragments/10267.doc
deleted file mode 100644
index 5213577afa..0000000000
--- a/src/twisted/newsfragments/10267.doc
+++ /dev/null
@@ -1,1 +0,0 @@
-Sync API docs templates with pydoctor 21.9.0 release, using new theming capabilities.
diff --git a/src/twisted/newsfragments/10269.doc b/src/twisted/newsfragments/10269.doc
deleted file mode 100644
index f385fc7907..0000000000
--- a/src/twisted/newsfragments/10269.doc
+++ /dev/null
@@ -1,1 +0,0 @@
-Add type annotations for twisted.web.client.readBody.
diff --git a/src/twisted/newsfragments/10273.bugfix b/src/twisted/newsfragments/10273.bugfix
deleted file mode 100644
index 8bea9049fa..0000000000
--- a/src/twisted/newsfragments/10273.bugfix
+++ /dev/null
@@ -1,2 +0,0 @@
-Deprecated ``twisted.python.threading.ThreadPool.currentThread()`` in favor of ``threading.current_thread()``.
-Switched ``twisted.python.threading.ThreadPool.currentThread()`` and ``twisted.python.threadable.getThreadID()`` to use `threading.current_thread()`` to avoid the deprecation warnings introduced for ``threading.currentThread()`` in Python 3.10.
diff --git a/src/twisted/newsfragments/10277.misc b/src/twisted/newsfragments/10277.misc
deleted file mode 100644
index 9743d02384..0000000000
--- a/src/twisted/newsfragments/10277.misc
+++ /dev/null
@@ -1,1 +0,0 @@
-Remove twisted.internet.test.test_core.ObjectModelIntegrationTests, which is no longer necessary.
diff --git a/src/twisted/newsfragments/10287.feature b/src/twisted/newsfragments/10287.feature
deleted file mode 100644
index 021a4fe760..0000000000
--- a/src/twisted/newsfragments/10287.feature
+++ /dev/null
@@ -1,1 +0,0 @@
-Type annotations have been added to the twisted.python.fakepwd module.
diff --git a/src/twisted/newsfragments/10288.misc b/src/twisted/newsfragments/10288.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10292.misc b/src/twisted/newsfragments/10292.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/10294.bugfix b/src/twisted/newsfragments/10294.bugfix
deleted file mode 100644
index 0b39076cf5..0000000000
--- a/src/twisted/newsfragments/10294.bugfix
+++ /dev/null
@@ -1,1 +0,0 @@
-twisted.web.client.RedirectAgent and twisted.web.client.BrowserLikeRedirectAgent now properly remove sensitive headers when redirecting to a different origin.
\ No newline at end of file
diff --git a/src/twisted/newsfragments/1681.misc b/src/twisted/newsfragments/1681.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/newsfragments/9944.misc b/src/twisted/newsfragments/9944.misc
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/twisted/python/threadpool.py b/src/twisted/python/threadpool.py
index ed8f6a53b3..bec0cf3633 100644
--- a/src/twisted/python/threadpool.py
+++ b/src/twisted/python/threadpool.py
@@ -47,7 +47,7 @@ class ThreadPool:
     threadFactory = Thread
     currentThread = staticmethod(
         deprecated(
-            version=Version("Twisted", "NEXT", 0, 0),
+            version=Version("Twisted", 22, 1, 0),
             replacement="threading.current_thread",
         )(current_thread)
     )
diff --git a/src/twisted/trial/newsfragments/10230.bugfix b/src/twisted/trial/newsfragments/10230.bugfix
deleted file mode 100644
index a7f34711b9..0000000000
--- a/src/twisted/trial/newsfragments/10230.bugfix
+++ /dev/null
@@ -1,1 +0,0 @@
-trial.runner.filenameToModule now sets the correct module.__name__ and sys.modules key
diff --git a/src/twisted/web/newsfragments/10295.removal b/src/twisted/web/newsfragments/10295.removal
deleted file mode 100644
index 6986e709e9..0000000000
--- a/src/twisted/web/newsfragments/10295.removal
+++ /dev/null
@@ -1,1 +0,0 @@
-twisted.web.client.getPage, twisted.web.client.downladPage, and the associated implementation classes (HTTPPageGetter, HTTPPageDownloader, HTTPClientFactory, HTTPDownloader) have been removed because they do not segregate cookies by domain. They were deprecated in Twisted 16.7.0 in favor of twisted.web.client.Agent. GHSA-92x2-jw7w-xvvx.


Test patch:
diff --git a/src/twisted/internet/test/test_threads.py b/src/twisted/internet/test/test_threads.py
index 1c55ec5422..68487ef072 100644
--- a/src/twisted/internet/test/test_threads.py
+++ b/src/twisted/internet/test/test_threads.py
@@ -224,7 +224,7 @@ class ThreadTestsBuilder(ReactorBuilder):
     def test_threadPoolCurrentThreadDeprecated(self):
         self.callDeprecated(
             version=(
-                Version("Twisted", "NEXT", 0, 0),
+                Version("Twisted", 22, 1, 0),
                 "threading.current_thread",
             ),
             f=ThreadPool.currentThread,