console.py sets the user-id of outgoing messages with the username supplied in the connection options. It is more appropriate to use the authenticated-user-id from the connection object. This is the actual user-id used by SASL when authenticating the connection.
For example, the connection options might provide a user name of "guest", but if the broker is configured for ANONYMOUS auth, the actual user name will be "anonymous". This mismatch causes messages to be rejected by the broker.