So currently I’m using WGET windows python to download a file, but most of the times it gives me this error:
Traceback (most recent call last):
File "PhaseUpdater.py", line 107, in <module>
File "PhaseUpdater.py", line 103, in updatewget
File "C:\Panda3D-1.8.1\python\lib\site-packages\wget.py", line 310, in downloa
d
(tmpfile, headers) = urllib.urlretrieve(url, tmpfile, callback)
File "C:\Panda3D-1.8.1\python\lib\urllib.py", line 93, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
File "C:\Panda3D-1.8.1\python\lib\urllib.py", line 283, in retrieve
"of %i bytes" % (read, size), result)
urllib.ContentTooShortError: retrieval incomplete: got only 26009689 out of 4536
3238 bytes
Press any key to continue . . .
So I made it try to do that, then except anything ( I wanted to do a ContentTooShortError but it wouldn’t do it ) and in the except statement I use ramfile and httpclient to download a file. But it won’t run the except statement because it’s already doing it, what should I do? (Please provide either a solution to the try-except or the ContentTooShortError, thanks! )