Invalid syntax in index.py in _error_messages #2086

* This patch includes a fix in index.py, as _error_messages takes a
  dictionary