[New-bugs-announce] [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>

More information about the New-bugs-announce mailing list