I'm guessing it raises an index error because getLocale() itself is returning (None, None)? Doing some googling says that this might be a python bug with getLocale itself. We can just add an IndexError to the exception check instead of checking for None, None.