Надо заменить sprintf формат (%s)  на вызов .format
msg=_('Unable to deliver your submission to grader. (Reason: {reason}.)'
                         ' Please try again later.').format(reason = msg))