(self)
Write the tape buffer to tape and finalise.
Write the tape buffer to tape and finalise.
Write the tape buffer to tape and finalise .
def _close_record_buffer(self):
        """Write the tape buffer to tape and finalise."""
        if self.rwmode == 'w':
            self._flush_record_buffer()
            self.buffer_complete = True
            data = self.record_stream.getvalue()
            if self.filetype in (b'M', b'B', b'P'):
                # bsave, tokenised and protected come in one multi-block record
                self._write_record(data)
            else:
                if data:
                    self._write_record(int2byte(len(data)) + data)
        self.record_stream = io.BytesIO()
def _close_record_buffer ( self ) : if self . rwmode == 'w' : self . _flush_record_buffer ( ) self . buffer_complete = True data = self . record_stream . getvalue ( ) if self . filetype in ( b'M' , b'B' , b'P' ) : # bsave, tokenised and protected come in one multi-block record self . _write_record ( data ) else : if data : self . _write_record ( int2byte ( len ( data ) ) + data ) self . record_stream = io . BytesIO ( )