Issue #1175 new

error handling

space one
created an issue

in _cperror

def get_error_page(status, **kwargs):

are the lines: 458 for k, v in iteritems(kwargs): 459 if v is None: 460 kwargs[k] = "" 461 else: 462 kwargs[k] = _escape(kwargs[k])

it would be nice to check if is is a string before _escap'ing it, so that i can user other datatypes as well.

also here:

468 try: 469 if hasattr(error_page, 'call'): 470 return error_page(**kwargs) 471 else: 472 data = open(error_page, 'rb').read() 473 return tonative(data) % kwargs 474 except: please use with open(error_page, 'rb') as fd: data = to properly close the file handler.

Comments (0)

  1. Log in to comment