Message6757
What in bz2_v2 in the class BZ2File is missing, is the seek method. This is essential for the support of the tarfile module. My simple implementation idea is, for reading mode and the whence SEEK_SET: Do nothing when position given is the actual, when argument is greater than actual position do so many dummy reads as the difference, when the argument is smaller, reopen the underlying java stream and do dummy reads as often as the argument says.
This is similar for SEEK_CUR.
SEEK_END is in my opinion not supportable.
Another essential point for the tarfile support is, do not throw exceptions in the constructor, when the arguments are correct. You must defer that to the I/O operations like read() and seek(). When they are called raise an IOError("invalid data stream"). This is needed for the auto detection of the used compression algorithm when you give only "r" as mode to the tarfile.open(). |
|
Date |
User |
Action |
Args |
2012-01-12 21:58:24 | r_walter | set | messageid: <1326405504.25.0.274794957769.issue1445@psf.upfronthosting.co.za> |
2012-01-12 21:58:24 | r_walter | set | recipients:
+ r_walter, pjenvey, crankycoder, ita, pjdm, spiritmech, cowwoc, ArneBab |
2012-01-12 21:58:24 | r_walter | link | issue1445 messages |
2012-01-12 21:58:23 | r_walter | create | |
|