[issue12638] urllib.URLopener prematurely deletes files on cleanup

Carl report at bugs.python.org
Mon Jul 25 17:34:58 CEST 2011


New submission from Carl <carl at carlbook.com>:

urllib.URLopener (or urllib.request.URLopener for Python 3) and user defined classes that inherit from these prematurely delete files upon cleanup.  Any temporary files downloaded using the .retrieve() method are deleted when an instance of a URLopener is garbage collected.

I feel this is a violation since the filename is returned to the caller and then silently deleted.  It is possible to simply override the .cleanup() method, but I feel this is not a good solution.

----------
components: None
files: bug2.py
messages: 141094
nosy: carlbook
priority: normal
severity: normal
status: open
title: urllib.URLopener prematurely deletes files on cleanup
type: behavior
versions: Python 2.6, Python 2.7, Python 3.2
Added file: http://bugs.python.org/file22750/bug2.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12638>
_______________________________________


More information about the Python-bugs-list mailing list