Brent Kearney wrote:
>
>There was a comma in one of the email addresses, like this:  
>[EMAIL PROTECTED],.edu.
>
>So I solved my data problem, but the question remains as to why  
>add_members didn't fail in the same place.


The processing between add_members and sync_members is different.
sync_members first processes the entire list and if it finds any
invalid addresses, it complains and does nothing. add_members
processes one line at a time, and if there are problems, it reports
them and continues.

In this case, add_members will call email.Utils.parseaddr() to parse
'[EMAIL PROTECTED],.edu'. parseaddr will return the null string as the real
name and '[EMAIL PROTECTED]' as the address and ignore the ',.edu' part.

sync_members works differently. It calls email.Utils.getaddresses()
with argument equal to a list of all the lines in the file. This
returns a list of parsed real names and addresses, but because of the
way it processes the list, '[EMAIL PROTECTED],.edu' gets treated as two
addresses '[EMAIL PROTECTED]' and '.edu'.

So both sync_members and add_members see the address '[EMAIL PROTECTED]'
which at least syntactically looks valid, but additionally,
sync_members sees '.edu' as a separate address which is invalid and
add_members never sees it.

-- 
Mark Sapiro <[EMAIL PROTECTED]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Reply via email to