Author rschoon
Recipients pje, rschoon
Date 2014-07-01.03:15:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Consider this paragraph of PEP3333, referring to headers obtained
via start_response, emphasis mine:

    Instead, it must store them for the server or gateway to
    transmit only after the first iteration of the application
    return value that yields a *non-empty bytestring*, or upon
    the application's first invocation of the write() callable.

This means that an WSGI app such as this should be valid, because the
yielded bytes pre-start_response are empty:

    def application(environ, start_response):
        yield b''
        start_response("200 OK", [("Content-Type", "text/plain")])
        yield b'Hello, World.\n'

However, in wsgiref's simple server, this fails:

    Traceback (most recent call last):
      File "/usr/local/lib/python3.4/wsgiref/", line 180, in finish_response
      File "/usr/local/lib/python3.4/wsgiref/", line 269, in write
        raise AssertionError("write() before start_response()")
    AssertionError: write() before start_response()
Date User Action Args
2014-07-01 03:15:10rschoonsetrecipients: + rschoon, pje
2014-07-01 03:15:10rschoonsetmessageid: <>
2014-07-01 03:15:10rschoonlinkissue21890 messages
2014-07-01 03:15:09rschooncreate