[Web-SIG] Unicode in Python 3

Armin Ronacher armin.ronacher at active-4.com
Sat Sep 19 13:11:44 CEST 2009


Hi,

Another observation from the HTTP server that comes with the Python 3
Standard Library: it does not support non-ASCII headers:

    def send_header(self, keyword, value):
        """Send a MIME header."""
        if self.request_version != 'HTTP/0.9':
            self.wfile.write(("%s: %s\r\n" %
              (keyword, value)).encode('ASCII', 'strict'))

Here an implementation that shows how ridiculous a byte based
implementation on top of BaseHTTPServer currently is:

http://paste.pocoo.org/show/140501/


Regards,
Armin


More information about the Web-SIG mailing list