Fw: sendmail error

Alexander Kapps alex.kapps at web.de
Tue Aug 31 19:53:59 CEST 2010


Chris Withers wrote:
> Alexander Kapps wrote:
>> Instead you want something like:
>>
>> except smtplib.SMTPException, msg
>>     print "eroare: " + msg
> 
> Err, that's still concatenating a string and an exception object.

OUCH! What a stupid error. Thanks for correction. :-)

> What *would* work is:
> 
> except smtplib.SMTPException, msg
>      print "eroare: " + str(msg)
> 
> ...not that it's particularly good coding style, what with hiding the 
> traceback and all...

Full Ack.

> cheers,
> 
> Chris
> 




More information about the Python-list mailing list