Antoine Pitrou <pit...@free.fr> added the comment: > No, just as PEP said str used as a container for binary data.
This is clearly the wrong thing to do. The only (immutable) string-like object adequate for binary data in py3k is bytes, not str. I understand the desire to stick to the PEP, but the PEP was devised even before the first py3k alphas, and it clearly wasn't written with py3k in mind. For example the following sentence becomes nonsensical: Again, all strings referred to in this specification must be of type str or StringType, and must not be of type unicode or UnicodeType. since "str" objects *are* of type UnicodeType in py3k (and the C API is still named PyUnicode_*)... When a legal text becomes nonsensical wrt. reality, one has to adapt his interpretation of the text to reality, not adapt reality to match the nonsense. In other words, wsgiref should accept/expose HTTP bodies as bytes, not str. Confusing binary data with iso-8859-1 text is the kind of mess py3k was designed to avoid. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4718> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com