Message122353
If you want to quickly solve this, do like this:
import urllib
import tarfile
tarfile.open(urllib.urlretrieve('http://plugins.supybot-fr.tk/GoodFrench.tar')[0], mode='r:') # Works
The problem is tarfile is expecting a "file-object" with a tell method for seeking, whereas urllib2 returns a file-like object, which does have a tell method. It seems to not have because, the underlying socket._fileobject is not exposing one (for whatever reason). Let me try to figure out reason for fixing/closing this bug.
(BTW, http module is relying on .tell() of the socket._fileobject too and I wonder it did not get noticed earlier because the has not taken that path yet? Strange!) |
|
Date |
User |
Action |
Args |
2010-11-25 11:39:02 | orsenthil | set | recipients:
+ orsenthil, amaury.forgeotdarc, eric.araujo, progval, Valentin.Lorentz |
2010-11-25 11:39:01 | orsenthil | set | messageid: <1290685141.95.0.669915134969.issue10362@psf.upfronthosting.co.za> |
2010-11-25 11:38:59 | orsenthil | link | issue10362 messages |
2010-11-25 11:38:59 | orsenthil | create | |
|