Read the Python Unicode HOWTO. This error is the very first example.
Do not use str()
to convert from unicode to encoded text / bytes.
Instead, use .encode()
to encode the string:
p.agent_info = u' '.join((agent_contact, agent_telno)).encode('utf-8').strip()
or work entirely in unicode.