Re: fixing the current email module

Oleg Broytman <[email protected]>
Newsgroups gmane.comp.python.mime.devel
Message-ID <[email protected]>
On Wed, Oct 07, 2009 at 11:23:24AM -0500, Matthew Dixon Cowles wrote:
> In my opinion, the email module should never raise an exception as a
> result of working with a malformed message. Though it should
> certainly make the information that a message was malformed available
> for the calling program to check.

   I disagree. email package is not a user agent, and exceptions are *the*
way to indicate there are problems.

> That is, I think that it's extremely unlikely that the calling
> program wants to blow up as a result of a malformed message.

   Then the calling program must catch all exceptions and process they in a
reasonable (for this particular application) way. But certainly email
package must not dictate what ways are reasonable - they are too
application-specific.

> Very
> probably, it wants to make what sense of the message that it can.

   Yes, if email parse a message in some way - ok. You can help by creating
more intelligent parser(s). But if a parser stumbles upon an unparseable
block - it must raises an exception.

Oleg.
-- 
     Oleg Broytman            http://phd.pp.ru/            [email protected]
           Programmers don't die, they just GOSUB without RETURN.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.