/[adm]/puppet/deployment/mgagit/templates/git_multimail.py
ViewVC logotype

Diff of /puppet/deployment/mgagit/templates/git_multimail.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3461 by colin, Sun Apr 27 12:07:59 2014 UTC revision 3462 by colin, Sun Apr 27 13:56:03 2014 UTC
# Line 352  def addr_header_encode(text, header_name Line 352  def addr_header_encode(text, header_name
352      """Encode and line-wrap the value of an email header field containing      """Encode and line-wrap the value of an email header field containing
353      email addresses."""      email addresses."""
354    
355        # (cg) It seems that From: names (or perhaps Subject: headers) that contain
356        # a UTF8 character before the first space confuse the older python Header()
357        # class. This does not appear to be needed in newer python versions, but
358        # this little workaround seems to help on 2.7.1 on valstar mga1.
359        try:
360            unicode(text)
361        except UnicodeDecodeError:
362            text = text.decode('utf-8')
363    
364      return Header(      return Header(
365          ', '.join(          ', '.join(
366              formataddr((header_encode(name), emailaddr))              formataddr((header_encode(name), emailaddr))

Legend:
Removed from v.3461  
changed lines
  Added in v.3462

  ViewVC Help
Powered by ViewVC 1.1.30