#8501: It is not possible to save file opened by urllib2.urlopen
----------------------------------+-----------------------------------------
 Reporter:  [EMAIL PROTECTED]      |       Owner:  nobody    
   Status:  new                   |   Milestone:            
Component:  File uploads/storage  |     Version:  SVN       
 Keywords:  urllib, file          |       Stage:  Unreviewed
Has_patch:  0                     |  
----------------------------------+-----------------------------------------
 It is not possible to save file opened by urllib2.urlopen into field of a
 model.
 When trying to do that following way:

 f = File(urlopen("http://something.com/somefile.ext";).fp)
 MODEL.FIELD.save("name.ext", f, save=False)

 Django throws AttributeError: '_fileobject' object has no attribute 'seek'

 Probeably django\core\files\base.py on line checks if class has attribute
 seek, but it is being definied at line 125 even when constructor gets an
 object that does not have such attribute (like urllib2.addinfourl.fp which
 is socket._fileobject).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8501>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to