[CherryPy] #1087: PEP-3333 compliance: Unicode response headers

11 views
Skip to first unread message

CherryPy

unread,
Aug 29, 2011, 4:26:36 PM8/29/11
to cherrypy...@googlegroups.com
#1087: PEP-3333 compliance: Unicode response headers
------------------------+---------------------------------------------------
Reporter: guest | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone:
Component: wsgiserver | Keywords:
------------------------+---------------------------------------------------
According to PEP-3333, a WSGI application returns header names and values
as "native strings" [1]. These are defined as "always implemented using
the type named str", which means unicode for Python 3.

CherryPy (trunk and the 3.2 branch) breaks if a WSGI header name or value
is not of type "bytes". This makes it impossible to run a WSGI conform
application on top of cherrypy in a Python 3 environment.

[1] http://www.python.org/dev/peps/pep-3333/#a-note-on-string-types

--
Ticket URL: <http://www.cherrypy.org/ticket/1087>
CherryPy <http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework

CherryPy

unread,
Sep 20, 2011, 4:57:47 PM9/20/11
to cherrypy...@googlegroups.com
#1087: PEP-3333 compliance: Unicode response headers
------------------------+---------------------------------------------------
Reporter: guest | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone:
Component: wsgiserver | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Changes (by jtate):

* cc: => jt...@dragonstrider.com

--
Ticket URL: <http://cherrypy.org/ticket/1087>

CherryPy

unread,
Sep 25, 2011, 10:33:03 PM9/25/11
to cherrypy...@googlegroups.com
#1087: PEP-3333 compliance: Unicode response headers
------------------------+---------------------------------------------------
Reporter: guest | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone: 3.2
Component: wsgiserver | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Changes (by fumanchu):

* milestone: => 3.2

Comment:

Thanks for the patch, but it's not sufficient. We should still assert the
correct type, just make it 'str' for both py2 and py3 (instead of
recasting). Also, the patch addresses the WSGI server but not the WSGI
application(s); they also need to be updated to emit str instead of bytes.
Reply all
Reply to author
Forward
0 new messages