Okey this is really strange. I have this script which basically downloads bunch of achieve files and extracts them. Usually those files are .zip files. Today I sat down and decided to make it work with rar files and I got stuck. At first I thought that the problem is in my unrar code, but it wasn't there. So I did:
f = urllib2.urlopen(file_location)
data = StringIO(f.read())
print data.getvalue()
heck I even did:
f = urllib2.urlopen(file_location)
print f.read()
because I just wanted to see the first chunk and the result is the same - I'm missing first line of the .rar file.
If I use web browser to download the very same file everything is fine, it's not corrupt.
Can anyone please explain me what the hell is going on here? And what does it have to do with file type.