New submission from Andrey Lebedev:

Under certain circumstances, wsgiref.simple_server.demo_app may return unicode 
data, but that is prohibited by PEP-3333.

This happens if environ with unicode key is passed to demo_app. Unicode keys 
are then written to StringIO instance, automatically making its value unicode.

Type of environ keys is not strictly mandated by PEP-3333, however output of 
WSGI application is:

  "When called by the server, the application object must return an iterable 
yielding zero or more bytestrings.", see 
http://www.python.org/dev/peps/pep-3333/#specification-details

Test case is attached.

----------
components: Library (Lib)
files: wsgirefbug.py
messages: 183437
nosy: Andrey.Lebedev
priority: normal
severity: normal
status: open
title: wsgiref.simple_server.demo_app is not PEP-3333 compatible
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file29303/wsgirefbug.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17349>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to