xmlrpc, httplib and SSL

Skip Montanaro skip at pobox.com
Sun Mar 28 21:49:46 EST 2004


    >> Can you submit a patch to SF which abstracts that into its own method
    >> ("end_request" or something similar?) which can be overridden.
    >> [snip]
    >> That sounds like the main problem.  Sounds like getting the
    >> shutdown() call into its own overridable method would help a lot.

    Roger> That doesn't help.  Basically what has happened is due to a
    Roger> defect in Python (IMHO).  Because objects that include a
    Roger> destructor (__del__) won't necessarily have the destructor
    Roger> called, and file/socket handles are real operating system
    Roger> resources, the code has to manually call close everywhere to
    Roger> ensure they aren't leaked (very reminiscent of C memory
    Roger> management).  

You're shooting the messenger.  Every language whose objects can form cycles
has to deal with the issue of reclaiming those cycles in the presence of
destructors.  There is no automatically correct place to break such cycles.
In those situations you have to either avoid cycles, decide how to reclaim
them or get rid of __del__ in potentially cycle-forming objects.

Skip




More information about the Python-list mailing list