comparison 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
comparison
equal deleted inserted replaced
5836:75586a0c26c0 5837:883c9e90b403
8 __docformat__ = 'restructuredtext' 8 __docformat__ = 'restructuredtext'
9 9
10 import sys, os, keyword, linecache, tokenize, inspect, cgi 10 import sys, os, keyword, linecache, tokenize, inspect, cgi
11 import pydoc, traceback 11 import pydoc, traceback
12 12
13 try: 13 from roundup.anypy.html import html_escape
14 from html import escape as html_escape # python 3
15 except ImportError:
16 from cgi import escape as html_escape # python 2 fallback
17 14
18 from roundup.cgi import templating, TranslationService 15 from roundup.cgi import templating, TranslationService
19 from roundup.anypy.strings import s2b 16 from roundup.anypy.strings import s2b
20 17
21 def get_translator(i18n=None): 18 def get_translator(i18n=None):

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