I am using the following piece of code:
import zipfile
import urllib
link = "http://www.dummypage.com/dummyfile.zip"
file_handle = urllib.urlopen(link)
zip_file_object = zipfile.ZipFile(file_handle, 'r')
I get the following error on execution. Please help.
Traceback (most recent call last):
File "fcc.py", line 34, in <module>
zip_file_object = zipfile.ZipFile(file_handle)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 770, in __init__
self._RealGetContents()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 807, in _RealGetContents
endrec = _EndRecData(fp)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 208, in _EndRecData
fpin.seek(0, 2)
AttributeError: addinfourl instance has no attribute 'seek'