'a'.index('b'): substring not found in index u'a'.index('b'): substring not found (bah!) same thing follows for rindex. changed unicodeobject.c to return same error message as what string returns.
Logged In: YES user_id=595280 Hmm... I think the patch should be in the opposite direction - leaving unicode message as is and fix stringobject.c to make the message the same as unicode. I've scanned all the exception messages in string methods and (r)index() is the only method which contains method name in its exception message. For example, >>> 'a'.split('') ValueError: empty separator