[Python-Dev] Better module shutdown procedure (original) (raw)

Neil Schemenauer nas at arctrix.com
Thu Oct 15 01:49:04 CEST 2009


Antoine Pitrou <solipsis at pitrou.net> wrote:

Have you tried to remove the various hacks/workarounds in the stdlib that currently avoid module finalization problems?

Good idea. These hacks are the best argument for applying the change, IMHO. I made a quick review of Lib modules using del:

tarfile: looks not safe
tempfile: goes through elaborate motions to avoid globals
threading: yikes, I didn't attempt to decypher this one
shelve: probably not safe
dumbdb: avoids globals, easy to remove hacks
_pyio: try/except can be removed (hopefully)
urllib: avoids globals, easy to remove hacks

Will try to cook up a patch in my copious free time.

Neil



More information about the Python-Dev mailing list