From 249c8bcb71db00be8efdf433b1358d16f9a72cac 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 0e11d0643..bdd85f7f8 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+ (#2312, @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 310bbb84b..044b90987 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, )