<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def trySelectRtiByPath(self, path):
 """ Selects a repository tree item given a path, expanding nodes if along the way if needed. Returns (item, index) if the path was selected successfully, else a warning is logged and (None, None) is returned. """

        try:
            lastItem, lastIndex = self.repoWidget.repoTreeView.expandPath(path)
            self.repoWidget.repoTreeView.setCurrentIndex(lastIndex)
            return lastItem, lastIndex
        except Exception as ex:
            logger.warn("Unable to select {!r} because: {}".format(path, ex))
            if DEBUGGING:
                raise
            return None, None