Changeset 694
- Timestamp:
- 09/30/05 00:37:06
- Files:
-
- trunk/cherrypy/_cputil.py (modified) (3 diffs)
- trunk/cherrypy/test/test_core.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cputil.py
r692 r694 34 34 import traceback 35 35 import time 36 import cgi 36 37 37 38 import cherrypy … … 152 153 153 154 154 _HTTPErrorTemplate = '''<?xml version="1.0" encoding="UTF-8"?> 155 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 155 _HTTPErrorTemplate = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 156 156 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 157 157 <html> 158 158 <head> 159 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 159 160 <title>%(status)s</title> 160 161 <style type="text/css"> … … 203 204 if v is None: 204 205 kwargs[k] = "" 206 else: 207 kwargs[k] = cgi.escape(kwargs[k]) 205 208 206 209 template = _HTTPErrorTemplate trunk/cherrypy/test/test_core.py
r693 r694 163 163 164 164 def custom(self): 165 raise cherrypy.HTTPError(404 )165 raise cherrypy.HTTPError(404, "No, <b>really</b>, not found!") 166 166 167 167 def page_method(self): … … 541 541 542 542 # Test error in custom error page (ticket #305). 543 # Note that the message is escaped for HTML (ticket #310). 543 544 self.getPage("/error/custom") 544 545 self.assertStatus("404 Not Found") 545 msg = ("No thing matches the given URI<br />"546 msg = ("No, <b>really</b>, not found!<br />" 546 547 "In addition, the custom error page failed:\n<br />" 547 548 "[Errno 2] No such file or directory: 'nonexistent.html'")

