Ignore:
Timestamp:
7 May 2012, 08:45:42 (12 years ago)
Author:
Henrik Bettermann
Message:

Catch TypeError? exception if from address is empty.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/smtp.py

    r7819 r8379  
    9494def encode_header_item(item):
    9595    if not isinstance(item, unicode):
    96         item = unicode(item, 'utf-8')
     96        try:
     97            item = unicode(item, 'utf-8')
     98        except TypeError:
     99            return None
    97100    return str(Header(item, 'iso-8859-1')) # try ascii, then latin1, then utf-8
    98101
Note: See TracChangeset for help on using the changeset viewer.