Skip to content

[PR #13502/01dce85a backport][8.4.x] Fix compatibility with Twisted 25 #13531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Jun 17, 2025

This is a backport of PR #13502 as merged into main (01dce85).

The issue arises because Failure.__init__ in Twisted 25 can receive a non-None exc_value while exc_tb is None. In such cases, ExceptionInfo[BaseException].from_exc_info fails, as it expects a traceback to be present when sys.exc_info() returns a tuple. This leads to the error message 'NoneType' object is not iterable.

Implemented separate workarounds for Twisted 24 and Twisted 25, the later one being simpler and less intrusive in the long run, as it does not require monkeypatching Failure.__init__.

We can drop suppor for Twisted 24 and keep the simpler patch in a later release.

Fixes #13497

As discussed in #13502, the fix for compatibility with Twisted 25+ is simpler. Therefore, it makes sense to implement both fixes (for Twisted 24 and Twisted 25) in parallel. This way, we can eventually drop support for Twisted <25 and keep only the simpler workaround.

In addition, the `unittestextras` tox environment has been replaced with dedicated test environments for `asynctest`, `Twisted 24`, and `Twisted 25`.

Fixes #13497

(cherry picked from commit 01dce85)
@nicoddemus nicoddemus enabled auto-merge (squash) June 17, 2025 20:46
@nicoddemus nicoddemus disabled auto-merge June 17, 2025 21:11
@nicoddemus nicoddemus merged commit a1b3a78 into 8.4.x Jun 17, 2025
35 of 36 checks passed
@nicoddemus nicoddemus deleted the patchback/backports/8.4.x/01dce85a89eb0b3e881303784267f14b94d9691f/pr-13502 branch June 17, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant