Roundup Tracker - Issues

Message8044

Author rouilj
Recipients kragacles, rouilj
Date 2024-05-15.01:29:44
Message-id <1715736584.38.0.194366671718.issue2551350@roundup.psfhosted.org>
In-reply-to
Hi Andrew:

Thank you for the patches.

Can you try the following patch for cgitb.py.

This should work for 3.10 and prior which use the version with foreground
and background colors. Version 3.11 and newer use the two argument version.

====
diff -r 791b61ed11c9 roundup/cgi/cgitb.py
--- a/roundup/cgi/cgitb.py      Tue May 14 20:50:25 2024 -0400
+++ b/roundup/cgi/cgitb.py      Tue May 14 21:08:12 2024 -0400
@@ -127,10 +127,18 @@
     if type(etype) is type:
         etype = etype.__name__
     pyver = 'Python ' + sys.version.split()[0] + '<br>' + sys.executable
-    head = pydoc.html.heading(
-        _('<font size=+1><strong>%(exc_type)s</strong>: %(exc_value)s</font>')
-        % {'exc_type': etype, 'exc_value': evalue},
-        '#ffffff', '#777777', pyver)
+
+    if sys.version_info[0:2] >= (3,11):
+        head = pydoc.html.heading(
+            _('<font size=+1><strong>%(exc_type)s</strong>: '
+              '%(exc_value)s</font>')
+            % {'exc_type': etype, 'exc_value': evalue}, pyver)
+    else:
+        head = pydoc.html.heading(
+            _('<font size=+1><strong>%(exc_type)s</strong>: '
+              '%(exc_value)s</font>')
+            % {'exc_type': etype, 'exc_value': evalue},
+            '#ffffff', '#777777', pyver)

     head = head + (_('<p>A problem occurred while running a Python script. '
                      'Here is the sequence of function calls leading up to '
====

I'll followup on your mailer patch in a bit.
History
Date User Action Args
2024-05-15 01:29:44rouiljsetmessageid: <1715736584.38.0.194366671718.issue2551350@roundup.psfhosted.org>
2024-05-15 01:29:44rouiljsetrecipients: + rouilj, kragacles
2024-05-15 01:29:44rouiljlinkissue2551350 messages
2024-05-15 01:29:44rouiljcreate