[Python-checkins] python/dist/src/Lib/email Header.py,1.5,1.6

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Fri, 28 Jun 2002 20:27:01 -0700


Update of /cvsroot/python/python/dist/src/Lib/email
In directory usw-pr-cvs1:/tmp/cvs-serv20231

Modified Files:
	Header.py 
Log Message:
__unicode__(): Patch # 541263 by Mikhail Zabaluev, implementation
modified by Barry.


Index: Header.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Header.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Header.py	28 Jun 2002 23:46:53 -0000	1.5
--- Header.py	29 Jun 2002 03:26:58 -0000	1.6
***************
*** 143,146 ****
--- 143,152 ----
          return self.encode()
  
+     def __unicode__(self):
+         """Helper for the built-in unicode function."""
+         # charset item is a Charset instance so we need to stringify it.
+         uchunks = [unicode(s, str(charset)) for s, charset in self._chunks]
+         return u''.join(uchunks)
+ 
      def append(self, s, charset=None):
          """Append string s with Charset charset to the MIME header.