Issue #1278 invalid

CherryPy tries to .encode bytes when setting a custom error response page

created an issue
Traceback (most recent call last):
  File "/home/kb1rd/dscanotron/testenv3/lib/python3.3/site-packages/CherryPy-3.2.4-py3.3.egg/cherrypy/", line 664, in respond
  File "/home/kb1rd/dscanotron/testenv3/lib/python3.3/site-packages/CherryPy-3.2.4-py3.3.egg/cherrypy/", line 376, in set_response
AttributeError: 'bytes' object has no attribute 'encode'

Easiest way to reproduce this is to do anything that makes CherryPy go off and format a custom error page, while running under Python 3, of course.

Comments (2)

  1. LThode reporter

    Sorry, false alarm! Turns out it was an issue in my code that was causing custom error page handlers to return bytes. Easy fix: make them return Unicode instead.

  2. Log in to comment