'Return the current file position on the underlying byte
stream.  If this reader is maintaining any buffers, then the
returned file position will be the position of the beginning
of those buffers.'

def tell(self):

    if (self.linebuffer is None):
        return (self.stream.tell() - len(self.bytebuffer))
    orig_filepos = self.stream.tell()
    bytes_read = ((orig_filepos - len(self.bytebuffer)) - self._rewind_checkpoint)
    buf_size = sum((len(line) for line in self.linebuffer))
    est_bytes = int(((bytes_read * self._rewind_numchars) / (self._rewind_numchars + buf_size)))
    self.stream.seek(self._rewind_checkpoint)
    self._char_seek_forward(self._rewind_numchars, est_bytes)
    filepos = self.stream.tell()
    if self.DEBUG:
        self.stream.seek(filepos)
        check1 = self._incr_decode(self.stream.read(50))[0]
        check2 = u''.join(self.linebuffer)
        assert (check1.startswith(check2) or check2.startswith(check1))
    self.stream.seek(orig_filepos)
    return filepos
