[issue3826] BaseHTTPRequestHandler depends on GC to close connections
romkyns [EMAIL PROTECTED] added the comment: So the GC behaviour in this case is such that Python 3.0 can't collect the object whereas Python 2.6 can. Is this known / expected or should this be recorded in a separate issue? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3826 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3826] Self-reference in BaseHTTPRequestHandler descendants causes stuck connections
romkyns [EMAIL PROTECTED] added the comment: Someone suggested I test this in 2.6rc1. The problem does not exist in 2.6rc1, only in 3.0b2. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3826 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3826] Self-reference in BaseHTTPRequestHandler descendants causes stuck connections
romkyns [EMAIL PROTECTED] added the comment: My initial description doesn't state the actual observable problem very clearly: the problem is that the browser gets stuck instead of displaying the page, writing something along the lines of Transferring data from localhost. After many seconds it times out. Aborting the request in Firefox causes the page to be displayed. Also forgot to mention that it's possible to work around this by explicitly removing all circular references after the base class' __init__ method - so for the attached example a work-around is self.dummy = None as the last line of the __init__ method. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3826 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3826] Self-reference in BaseHTTPRequestHandler descendants causes stuck connections
New submission from romkyns [EMAIL PROTECTED]: 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. -- components: Library (Lib) files: breakage.py messages: 72917 nosy: romkyns severity: normal status: open title: Self-reference in BaseHTTPRequestHandler descendants causes stuck connections type: behavior versions: Python 3.0 Added file: http://bugs.python.org/file11448/breakage.py ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3826 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com