comparison roundup/cgi/exceptions.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 08b241c9fea4
comparison
equal deleted inserted replaced
5836:75586a0c26c0 5837:883c9e90b403
3 3
4 __docformat__ = 'restructuredtext' 4 __docformat__ = 'restructuredtext'
5 5
6 from roundup.exceptions import LoginError, Unauthorised 6 from roundup.exceptions import LoginError, Unauthorised
7 7
8 try: 8 from roundup.anypy.html import html_escape
9 from html import escape as html_escape # python 3
10 except ImportError:
11 from cgi import escape as html_escape # python 2 fallback
12 9
13 class HTTPException(BaseException): 10 class HTTPException(BaseException):
14 pass 11 pass
15 12
16 class Redirect(HTTPException): 13 class Redirect(HTTPException):

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