Repository navigation
#12645 Fix Python 3.15 compatibility issues in trial - #12602
frenzymadness wants to merge 1 commit into
Conversation
- Replace deprecated SourceFileLoader.load_module() with exec_module() - Add addSubTest() method to _AdaptedReporter for Python 3.15 doctest support - Update test expectations for Python 3.15 doctest changes: - Different success/failure counts - Changed error output format
|
Thanks for the PR. Unfortunatelly, there is still work left to add python 3.14 compatibility The high level task for 3.14 is here I have created an issue to track Python 3.15 compatibility at #12603 @glyph in GitHub Issues we can "pin" / highlight up to 3 issues. I have pinned the issue for 3.14 and 3.15 as I think that the most important task for Twisted right now is to keep it available on latest Python versions Freel free to un-pin them or add another one the list of pinned issues |
|
Just an update. I have created a separate ticket to track the errors of twisted.trial with Python 3.15 I am working on #12643 to get Python 3.15 executed as part of our PR tests... Once that is done, we should be able to test, review and merge this PR. Thanks again |
| loader = SourceFileLoader(name, fileName) | ||
| spec = importlib.util.spec_from_loader(name, loader) |
There was a problem hiding this comment.
I wonder if we can re-use _importFromFile here
| sys.modules[name] = module | ||
| spec.loader.exec_module(module) |
There was a problem hiding this comment.
Possible regression here, if execution of the module fails, then we probably don't want to leave it in sys.modules.
|
This seems to be missing the CI configuration change to make the tests actually run on 3.15, which explains the coverage gaps? |
|
@frenzymadness since this PR predates our new PR template and AI policy, can you just confirm that this PR is not LLM output? It doesn't look like it to me but it would be good to have affirmative confirmation. |
|
The code here is not an output of LLM. I kinda lost context since I created it, so I'd appreciate it if you could take it and finish it. If you don't have time or don't want to, say so, and I'll add it to my to-do with higher priority. |
|
Thanks for the PR. We now have tests running on 3.15 . I am happy to review fixes for trial :) |
Thanks for the reply. We are happy to run with it, thanks for letting us know the status clearly. And thanks for contributing it! |
Fixes #12645
Some of the changes are required for Python 3.15 compatibility because: python/cpython#134890