

def _Open(self, path_spec, mode='rb'):
    "Opens the file system object defined by path specification.\n\n    Args:\n      path_spec: a path specification (instance of PathSpec).\n      mode: optional file access mode. The default is 'rb' read-only binary.\n\n    Raises:\n      AccessError: if the access to open the file was denied.\n      IOError: if the file system object could not be opened.\n      PathSpecError: if the path specification is incorrect.\n      ValueError: if the path specification is invalid.\n    "
    if (not path_spec.HasParent()):
        raise errors.PathSpecError('Unsupported path specification without parent.')
    file_object = resolver.Resolver.OpenFileObject(path_spec.parent, resolver_context=self._resolver_context)
    try:
        tar_file = tarfile.open(mode='r:', fileobj=file_object)
    except:
        file_object.close()
        raise
    mode._file_object = file_object
    self._tar_file = tar_file

dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/vfs/tar_file_system.py TARFileSystem._Open/VarMisuse@91/304 `self`->`mode`