diff --git a/12313-fix-test_manhole.patch b/12313-fix-test_manhole.patch new file mode 100644 index 0000000..6bb4e1a --- /dev/null +++ b/12313-fix-test_manhole.patch @@ -0,0 +1,60 @@ +From 185ff4b3f2e402e6a3c450d826223c79b53af333 Mon Sep 17 00:00:00 2001 +From: Itamar Turner-Trauring +Date: Tue, 10 Sep 2024 14:04:21 -0400 +Subject: [PATCH 1/3] Fix (or workaround?) bug that happens in 3.13 where last + frame of traceback is omitted. + +--- + src/twisted/conch/manhole.py | 6 +++++- + src/twisted/conch/newsfragments/12313.misc | 0 + 2 files changed, 5 insertions(+), 1 deletion(-) + create mode 100644 src/twisted/conch/newsfragments/12313.misc + +diff --git a/src/twisted/conch/manhole.py b/src/twisted/conch/manhole.py +index f552af5bbdc..1fce66a8cd4 100644 +--- a/src/twisted/conch/manhole.py ++++ b/src/twisted/conch/manhole.py +@@ -124,7 +124,11 @@ def excepthook( + """ + Format exception tracebacks and write them to the output handler. + """ +- lines = format_exception(excType, excValue, excTraceback.tb_next) ++ if sys.version_info[:2] < (3, 13): ++ traceback = excTraceback.tb_next ++ else: ++ traceback = excTraceback ++ lines = format_exception(excType, excValue, traceback) + self.write("".join(lines)) + + def displayhook(self, obj): +diff --git a/src/twisted/conch/newsfragments/12313.misc b/src/twisted/conch/newsfragments/12313.misc +new file mode 100644 +index 00000000000..e69de29bb2d + +From 2a73df859a8f9f61bc9de535eb39878ab10200e6 Mon Sep 17 00:00:00 2001 +From: Itamar Turner-Trauring +Date: Mon, 16 Sep 2024 10:51:39 -0400 +Subject: [PATCH 3/3] Check based on symptoms, rather than version. + +--- + src/twisted/conch/manhole.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/twisted/conch/manhole.py b/src/twisted/conch/manhole.py +index 1fce66a8cd4..670ac0480ec 100644 +--- a/src/twisted/conch/manhole.py ++++ b/src/twisted/conch/manhole.py +@@ -124,9 +124,12 @@ def excepthook( + """ + Format exception tracebacks and write them to the output handler. + """ +- if sys.version_info[:2] < (3, 13): ++ code_obj = excTraceback.tb_frame.f_code ++ if code_obj.co_filename == code.__file__ and code_obj.co_name == "runcode": + traceback = excTraceback.tb_next + else: ++ # Workaround for https://github.com/python/cpython/issues/122478, ++ # present e.g. in Python 3.12.6: + traceback = excTraceback + lines = format_exception(excType, excValue, traceback) + self.write("".join(lines)) diff --git a/python-Twisted.changes b/python-Twisted.changes index 7097bde..86dad4e 100644 --- a/python-Twisted.changes +++ b/python-Twisted.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 25 06:38:11 UTC 2024 - Markéta Machová + +- Add upstream patch 12313-fix-test_manhole.patch to fix test failure + with latest python312 + ------------------------------------------------------------------- Mon Sep 9 14:23:03 UTC 2024 - John Paul Adrian Glaubitz diff --git a/python-Twisted.spec b/python-Twisted.spec index 19de78a..8aa8850 100644 --- a/python-Twisted.spec +++ b/python-Twisted.spec @@ -45,6 +45,8 @@ Patch3: 1521_delegate_parseqs_stdlib_bpo42967.patch Patch5: no-cython_test_exception_raiser.patch # PATCH-FIX-OPENSUSE remove-dependency-version-upper-bounds.patch boo#1190036 -- run with h2 >= 4.0.0 and priority >= 2.0 Patch6: remove-dependency-version-upper-bounds.patch +# PATCH-FIX-UPSTREAM https://github.com/twisted/twisted/pull/12314 12313 Fix test_manhole.py on Python 3.13rc2 +Patch7: 12313-fix-test_manhole.patch BuildRequires: %{python_module hatch-fancy-pypi-readme} BuildRequires: %{python_module hatchling} BuildRequires: %{python_module incremental >= 24.7.0}