From b6d1d8c6e35555b6d078b287e9504c87002e2bf7 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 22 Jul 2024 17:18:22 -0400 Subject: [PATCH] Fix `isapi.ThreadPoolExtension`'s printing of exception traceback broken on Python 3.8+ --- CHANGES.txt | 1 + isapi/threaded_extension.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 0e11d06435..2618b5b429 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -15,6 +15,7 @@ Coming in build 307, as yet unreleased -------------------------------------- ### pywin32 +* Fix `isapi.ThreadPoolExtension`'s printing of exception traceback broken on Python 3.8+ (#, @Avasam) * Add RealGetWindowClass (#2299, @CristiFati) * Make it compile on Python 3.13 (#2260, @clin1234) * Fixed accidentally trying to raise a `str` instead of an `Exception` in (#2270, @Avasam) diff --git a/isapi/threaded_extension.py b/isapi/threaded_extension.py index 310bbb84be..044b909877 100644 --- a/isapi/threaded_extension.py +++ b/isapi/threaded_extension.py @@ -156,7 +156,7 @@ def HandleDispatchError(self, ecb): limit = None try: try: - import cgi + import html ecb.SendResponseHeaders( "200 OK", "Content-type: text/html\r\n\r\n", False @@ -169,8 +169,8 @@ def HandleDispatchError(self, ecb): bold = list.pop() print( "
{}{}
".format( - cgi.escape("".join(list)), - cgi.escape(bold), + html.escape("".join(list)), + html.escape(bold), ), file=ecb, )