import ext4
f = open("tests/nested-tar-10M.ext4", 'rb')
v = ext4.Volume(f)
i = v.inode_at('/foo/fighter/ufo')
file = i.open()
print(file.read(3)) # b'iri'
print(file.seek(1)) # None
print(file.read(3)) # b'riy'
print(file.seekable()) # False
The reason for this is BlockIO inheriting from io.RawIOBase without overriding the seekable method, which by default is inherited from io.IOBase and returns False.
Second bug: As per definition of io.IOBase, seek should:
Change the stream position to the given byte offset, interpreted relative to the position indicated by whence, and return the new absolute position.
However, it returns None as shown above.
The reason for this is BlockIO inheriting from
io.RawIOBasewithout overriding theseekablemethod, which by default is inherited fromio.IOBaseand returns False.Second bug: As per definition of
io.IOBase, seek should:However, it returns
Noneas shown above.