markokr/rarfile — Issue #1: RarFile.read work incorrectly
Author: fidoman
Created: 2012-01-02 15:27:51+00:00
State: open

Hello.

RarFile.read function seems to work incorrectly.
It does return sporadically 10 or 15 first kilobytes of archived file instead of full content.
If do open the same archived file (RarFile.open) then read from file object, it does return all data.

Sample archive:
http://sergey.fidoman.ru/tmp/9cc17f01.we0
Code:
Python 3.2.2 (default, Nov 16 2011, 10:58:44) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import rarfile
>>> r=rarfile.RarFile("9cc17f01.we0")
>>> r.namelist()
['9cc17f01.pkt']
>>> len(r.read('9cc17f01.pkt'))
15360
>>> len(r.read('9cc17f01.pkt'))
15360
>>> len(r.read('9cc17f01.pkt'))
15360
>>> len(r.read('9cc17f01.pkt'))
15360
>>> len(r.read('9cc17f01.pkt'))
15360
>>> len(r.open('9cc17f01.pkt').read())
10240
>>> len(r.open('9cc17f01.pkt').read())
15360
>>> len(r.open('9cc17f01.pkt').read())
15360
>>> f=r.open('9cc17f01.pkt') # Only this way seem to work
>>> len(f.read())
33245
>>> len(f.read())
0
>>> len(f.read())
0
>>>