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 amaury.forgeotdarc
Recipients amaury.forgeotdarc, ggenellina, gregory.p.smith, romkyns, zanella
Date 2008-09-25.11:51:39
SpamBayes Score 1.4515751e-06
Marked as misclassified No
Message-id <1222343502.14.0.299847177005.issue3826@psf.upfronthosting.co.za>
In-reply-to
Content
The garbage collector does collect unreachable objects.

What happens is that with python 2, the socket is explicitly closed by
the HTTPServer, whereas with python 3, the explicit close() does not
work, and the socket is ultimately closed when the request has finished
and all objects are disposed.

The cause is in the socket.makefile() function: since python3, the
underlying socket uses a reference count, so that:
    s = <a connected socket>
    f = s.makefile()
    s.close()
does not close the socket! adding f.close() is not enough. A "del f" is
necessary to really close the underlying socket.
History
Date User Action Args
2008-09-25 11:51:42amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, gregory.p.smith, ggenellina, zanella, romkyns
2008-09-25 11:51:42amaury.forgeotdarcsetmessageid: <1222343502.14.0.299847177005.issue3826@psf.upfronthosting.co.za>
2008-09-25 11:51:40amaury.forgeotdarclinkissue3826 messages
2008-09-25 11:51:39amaury.forgeotdarccreate