Fix a bug where code was trying to index an int. Left over from the situation
from using str.rpartition to str.rindex.

Closes Issue5213.
2 files changed