Fix error message formatting issue on Python 2.6