diff roundup/cgi/cgitb.py @ 5837:883c9e90b403

Fix problem with cgi.escape being depricated a different way. This way uses anypy and is cleaner. Also fixes incorrect/incomplete change that resulted in escaped in TAL generated by TALInterpreter.py. The escaped quotes break javascript etc. defined using tal string: values. TODO: add test cases for TAL. This wouldn't have snuck through for a month if we had good coverage of that library.
author John Rouillard <rouilj@ieee.org>
date Sat, 06 Jul 2019 13:12:58 -0400
parents 1a835db41674
children 70e6b053193b
line wrap: on
line diff
--- a/roundup/cgi/cgitb.py	Sat Jul 06 09:05:09 2019 -0400
+++ b/roundup/cgi/cgitb.py	Sat Jul 06 13:12:58 2019 -0400
@@ -10,10 +10,7 @@
 import sys, os, keyword, linecache, tokenize, inspect, cgi
 import pydoc, traceback
 
-try:
-    from html import escape as html_escape  # python 3
-except ImportError:
-    from cgi import escape as html_escape   # python 2 fallback
+from roundup.anypy.html import html_escape
 
 from roundup.cgi import templating, TranslationService
 from roundup.anypy.strings import s2b

Roundup Issue Tracker: http://roundup-tracker.org/