Senthil Kumaran <sent...@uthcode.com> added the comment: On Tue, May 10, 2011 at 09:12:58AM +0000, Vinay Sajip wrote: > Either omitting the end_headers() call was always an error but > previously undetected, or the requirement to always call > end_headers() is new and this should be documented. I'm not sure > which of these is the case, but leaving open since I think the > http.server documentation ought to be changed. Apart from this I
end_headers was added 3.2, so that all the headers can be cached and sent at once instead of writing one header at a time to the output stream. This is a new change in 3.3, where end_header calls flush_header which does the job of writing and clearing the cache. The need to call end_header always is new (at least from 3.2, because I see the http.server code itself using end_header at the end whenever it uses send_header) Following is the information in the updated docs. .. method:: send_header(keyword, value) Adds the HTTP header to an internal buffer which will be written to the output stream when either :meth:`end_headers` or :meth:`flush_headers` is invoked. I think, a little change in wording saying that end_headers or flush_headers MUST BE called would make it more prominent. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12039> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com