Exception is raise when authenticate fails and user includes percent sign '%'.
Example of code to reproduce the issue:
In my case msg is "command SON ( [ ( 'authenticate', 1), ('user', u'abc%'), ('nonce', u'd8eec066dd2c61c0'), ('key', u'7e11b80df608cbc9a38d0403da9333f2')]) failed: %s"
I.e. this string includes symbols %' which can be formatted by python. So escaping is needed.