On Thu, Sep 23, 2010 at 11:52 AM, P.J. Eby <p...@telecommunity.com> wrote: >> I do think input and output should be symmetric, though. If response >> headers are going to be bytes, then the request headers should be as >> well, or vice versa. The same arguments apply to both, after all. > > Actually, they don't. There are more apps than servers, so more code to get > right, by more people. Servers also don't generally *create* any of the > bytes or text involved, they're just ferrying it from one place to the next. > So the API conditions are not symmetrical.
How so? If I'm writing an application, I would need to deal with strings in environ but remember to send bytes to start_response. Conversions can happen on the application side either way. I just don't see how having strings in->bytes out is more error-prone than bytes-in->bytes-out or strings in->strings out, from an application or a server perspective. Also, IronPython/.NET falls outside of "generally". Every .NET server I've seen deals with headers exclusively as strings (like Python 3, .NET strings are Unicode), so NWSGI would be encoding the response headers to strings, but passing the request headers through unchanged. - Jeff _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com