'Returns file-like object (:class:`RarExtFile`) from where the data can be read.
The object implements :class:`io.RawIOBase` interface, so it can
be further wrapped with :class:`io.BufferedReader`
and :class:`io.TextIOWrapper`.
On older Python where io module is not available, it implements
only .read(), .seek(), .tell() and .close() methods.
The object is seekable, although the seeking is fast only on
uncompressed files, on compressed files the seeking is implemented
by reading ahead and/or restarting the decompression.
Parameters:
fname
file name or RarInfo instance.
mode
must be \'r\'
psw
password to use for extracting.'

def open(self, fname, mode='r', psw=None):

    if (mode != 'r'):
        raise NotImplementedError('RarFile.open()    supports    only    mode=r')
    inf = self.getinfo(fname)
    if inf.isdir():
        raise TypeError(('Directory    does    not    have    any    data:    ' + inf.filename))
    if inf.needs_password():
        psw = (psw or self._password)
        if (psw is None):
            raise PasswordRequired(('File    %s    requires    password' % inf.filename))
    else:
        psw = None
    return self._file_parser.open(inf, psw)
