>>I have created a program that automatically downloads some files I >>need. >>It can be .zip, .jpg, .mpg or .txt. However, a lot of the time >>urlretrieve >>downloads the file, gives no error, but the downloaded file is >>corrupted. >>I use a simple check for the size of the file. If it is way too >>small, I >>automatically remove it.
Is it possible you are downloading a binary file as a text file? If so the EOF character may be present and this is what truncates the file. A sign that this is the problem is if the same file always stops after the same number of bytes. I've never used urlretrieve but its a common problewm with ftp, and I assume url is the same. Is there a flag/parameter you can set to fetch in binary mode? Just guessing, Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor