This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author romkyns
Recipients romkyns
Date 2008-09-09.21:21:08
SpamBayes Score 3.7890125e-06
Marked as misclassified No
Message-id <1220995272.13.0.856073925349.issue3826@psf.upfronthosting.co.za>
In-reply-to
Content
See example code attached. A very basic http server responds with an XML
document to any GET request. I think what happens is that the connection
remains open at the end of the request, leading the browser to believe
there's more data to come (and hence not displaying anything).

What's curious is that commenting out the single line "self.dummy =
self" fixes the problem. Also, the problem occurs in 3.0b2 but not in 2.5.2.

To reproduce:

1. Run the example code on 3.0b2
2. Navigate to http://localhost:8123/
   The browser shows "Transferring data" or something similar, until it
times out.
3. Comment out the line "self.dummy = self"
4. Navigate to http://localhost:8123/
   This time it loads instantly.

Repeat with 2.5.2 - both variants work.

I don't know much at all about python internals, but it seems that 1) a
circular reference prevents the request handler from being GC'd and 2)
http.server relies on the request being GC'd to finalise the connection.
History
Date User Action Args
2008-09-09 21:21:12romkynssetrecipients: + romkyns
2008-09-09 21:21:12romkynssetmessageid: <1220995272.13.0.856073925349.issue3826@psf.upfronthosting.co.za>
2008-09-09 21:21:11romkynslinkissue3826 messages
2008-09-09 21:21:10romkynscreate