Skip to content

Commit

Permalink
Merge branch 'trunk' into 10303-deprecate-py36
Browse files Browse the repository at this point in the history
  • Loading branch information
twm authored Feb 8, 2022
2 parents 20d90d6 + 9045ef7 commit bce8e81
Show file tree
Hide file tree
Showing 45 changed files with 145 additions and 34 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2001-2021
Copyright (c) 2001-2022
Allen Short
Amber Hawkie Brown
Andrew Bennetts
Expand Down
103 changes: 103 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
===========================
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

from incremental import Version

__version__ = Version("Twisted", 21, 7, 0, post=0)
__version__ = Version("Twisted", 22, 1, 0, post=0)
__all__ = ["__version__"]
1 change: 0 additions & 1 deletion src/twisted/conch/newsfragments/10266.feature

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/conch/newsfragments/10293.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/conch/newsfragments/8199.bugfix

This file was deleted.

2 changes: 1 addition & 1 deletion src/twisted/copyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
longversion = str(_longversion)

copyright = """\
Copyright (c) 2001-2021 Twisted Matrix Laboratories.
Copyright (c) 2001-2022 Twisted Matrix Laboratories.
See LICENSE for details."""

disclaimer = """
Expand Down
4 changes: 2 additions & 2 deletions src/twisted/internet/_glibbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ def simulate(self):
if self._simtag is not None:
self._source_remove(self._simtag)
self.iterate()
timeout = min(self.timeout(), 0.01)
if timeout is None:
timeout = self.timeout()
if timeout is None or timeout > 0.01:
timeout = 0.01
self._simtag = self._timeout_add(
int(timeout * 1000),
Expand Down
33 changes: 33 additions & 0 deletions src/twisted/internet/test/test_glibbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,36 @@ def test_ensureFailsWhenImported(self):
)
self.assertEqual(modules, {"m2": module})
self.assertEqual(e.args, ("A message.",))


try:
from twisted.internet import gireactor as _gireactor
except ImportError:
gireactor = None
else:
gireactor = _gireactor

missingGlibReactor = None
if gireactor is None:
missingGlibReactor = "gi reactor not available"


class GlibReactorBaseTests(TestCase):
"""
Tests for the private C{twisted.internet._glibbase.GlibReactorBase}
done via the public C{twisted.internet.gireactor.PortableGIReactor}
"""

skip = missingGlibReactor

def test_simulate(self):
"""
C{simulate} can be called without raising any errors when there are
no delayed calls for the reactor and hence there is no defined sleep
period.
"""
sut = gireactor.PortableGIReactor(usegtk=False)
# Double check that reactor has no sleep period.
self.assertIs(None, sut.timeout())

sut.simulate()
2 changes: 1 addition & 1 deletion src/twisted/internet/test/test_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def check():
def test_threadPoolCurrentThreadDeprecated(self):
self.callDeprecated(
version=(
Version("Twisted", "NEXT", 0, 0),
Version("Twisted", 22, 1, 0),
"threading.current_thread",
),
f=ThreadPool.currentThread,
Expand Down
1 change: 0 additions & 1 deletion src/twisted/newsfragments/10198.misc

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10218.misc

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion src/twisted/newsfragments/10224.feature

This file was deleted.

Empty file.
Empty file.
1 change: 0 additions & 1 deletion src/twisted/newsfragments/10231.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10234.misc

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10235.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10236.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10238.doc

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10239.misc

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions src/twisted/newsfragments/10241.bugfix

This file was deleted.

Empty file.
Empty file.
1 change: 0 additions & 1 deletion src/twisted/newsfragments/10248.misc

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10250.misc

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10251.bugfix

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion src/twisted/newsfragments/10267.doc

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10269.doc

This file was deleted.

2 changes: 0 additions & 2 deletions src/twisted/newsfragments/10273.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10277.misc

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/newsfragments/10287.feature

This file was deleted.

Empty file.
Empty file.
1 change: 0 additions & 1 deletion src/twisted/newsfragments/10294.bugfix

This file was deleted.

Empty file.
1 change: 1 addition & 0 deletions src/twisted/newsfragments/9660.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
twisted.internet.gireactor.PortableGIReactor.simulate and twisted.internet.gtk2reactor.PortableGtkReactor.simulate no longer raises TypeError when there are no delayed called. This was a regression introduced with the migration to Python3 in which the builtin `min` function no longer accepts `None` as an argument.
Empty file.
2 changes: 1 addition & 1 deletion src/twisted/python/threadpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
1 change: 0 additions & 1 deletion src/twisted/trial/newsfragments/10230.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion src/twisted/web/newsfragments/10295.removal

This file was deleted.

0 comments on commit bce8e81

Please sign in to comment.