code: def open(self, relpath):
      
  
      path = self._realpath(relpath)
      if path.endswith('/'):
        raise self.IsDirException(self.rev, relpath)
  
      if path.startswith('../') or path[0] == '/':
        yield open(path, 'rb')
        return
  
      object_type, data = self._read_object_from_repo(rev=self.rev, relpath=path)
      if object_type == b'tree':
        raise self.IsDirException(self.rev, relpath)
      assert object_type == b'blob'
      yield io.BytesIO(data)
docs: Read a file out of the repository at a certain revision.
  
      This is complicated because, unlike vanilla git cat-file, this follows symlinks in
      the repo.  If a symlink points outside repo, the file is read from the filesystem;
      that's because presumably whoever put that symlink there knew what they were doing.