[issue12638] urllib.URLopener prematurely deletes files on cleanup

2021-05-08 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> out of date

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12638] urllib.URLopener prematurely deletes files on cleanup

2021-05-08 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12638] urllib.URLopener prematurely deletes files on cleanup

2021-03-26 Thread Irit Katriel


Irit Katriel  added the comment:

I think this is out of date as this feature was deprecated in issue10050.

--
components: +Library (Lib) -None
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12638] urllib.URLopener prematurely deletes files on cleanup

2011-07-25 Thread Carl

New submission from Carl c...@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 rep...@bugs.python.org
http://bugs.python.org/issue12638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: [issue12638] urllib.URLopener prematurely deletes files on cleanup

2011-07-25 Thread Senthil Kumaran
urlretrieve is a helper function from urllib  module. The way to use
it is:

 import urllib.request
 urllib.request('http://bugs.python.org')
('/tmp/tmpe873xe', http.client.HTTPMessage object at 0xb72c2f6c)
 import os
 os.stat('/tmp/tmpe873xe')
posix.stat_result(st_mode=33152, st_ino=4462517, st_dev=2054,
st_nlink=1, st_uid=1000, st_gid=1000, st_size=33128,
st_atime=1311608669, st_mtime=1311608670, st_ctime=1311608670)

Works properly for me 3.3 and 2.7. Is there any service that is
running on your machine that deleting the tmp files as soon as they
are created?

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12638] urllib.URLopener prematurely deletes files on cleanup

2011-07-25 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

urlretrieve is a helper function from urllib  module. The way to use
it is:

('/tmp/tmpe873xe', http.client.HTTPMessage object at 0xb72c2f6c)
 import os
 os.stat('/tmp/tmpe873xe')

Works!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12638] urllib.URLopener prematurely deletes files on cleanup

2011-07-25 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

Tracker stripped off the code. Here is it.

import urllib.request
urllib.request.urlretrieve('http://bugs.python.org')
('/tmp/tmpe873xe', http.client.HTTPMessage object at 0xb72c2f6c)
import os
os.stat('/tmp/tmpe873xe')
posix.stat_result(st_mode=33152, st_ino=4462517, st_dev=2054, st_nlink=1, 
st_uid=1000, st_gid=1000, st_size=33128, st_atime=1311608669, 
st_mtime=1311608670, st_ctime=1311608670)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12638] urllib.URLopener prematurely deletes files on cleanup

2011-07-25 Thread Carl

Carl c...@carlbook.com added the comment:

@orsenthil, that is the correct behavior if you do not want to override any of 
URLopener's handlers for error codes.  In my case, I wanted to override 
FancyURLopener (a child class of URLopener) to override HTTP 401 behavior.  
Using urlretrieve is not correct in this case.

Also included python 3.2 code, I didn't test 3.1.

--
Added file: http://bugs.python.org/file22752/bug3.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com