In the screenshot provided, it looks like the contact field is using the Python repr() of a binary value (i.e. it looks like b'person@domain.com', instead of just person@domain.com). This can be fixed by doing contact.decode('utf-8') in the appropriate place. The benefit will be nicer output and slightly more accurate comparisons (i.e. removal of the constant offset caused by b'' in the string comparison step).