(self, reclen)
return record
Read a record from tape.
Read a record from tape.
Read a record from tape .
def _read_record(self, reclen):
        """Read a record from tape."""
        if not self.bitstream.read_leader():
            # reached end-of-tape without finding appropriate file
            raise EndOfTape()
        self.record_num += 1
        record = b''
        block_num = 0
        byte_count = 0
        while reclen is None or byte_count < reclen:
            data = self._read_block()
            record += data
            byte_count += len(data)
            if (reclen is None):
                break
            block_num += 1
        self.bitstream.read_trailer()
        if reclen is not None:
            return record[:reclen]
        return record
def _read_record ( self , reclen ) : if not self . bitstream . read_leader ( ) : # reached end-of-tape without finding appropriate file raise EndOfTape ( ) self . record_num += 1 record = b'' block_num = 0 byte_count = 0 while reclen is None or byte_count < reclen : data = self . _read_block ( ) record += data byte_count += len ( data ) if ( reclen is None ) : break block_num += 1 self . bitstream . read_trailer ( ) if reclen is not None : return record [ : reclen ] return record