[Python-checkins] python/dist/src/Lib/email Header.py,1.8,1.9

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
2002年7月22日 21:29:56 -0700


Update of /cvsroot/python/python/dist/src/Lib/email
In directory usw-pr-cvs1:/tmp/cvs-serv20667
Modified Files:
	Header.py 
Log Message:
make_header(): Watch out for charset is None, which decode_header()
will return as the charset if implicit us-ascii is used.
Index: Header.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Header.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Header.py	9 Jul 2002 16:33:47 -0000	1.8
--- Header.py	23 Jul 2002 04:29:54 -0000	1.9
***************
*** 56,60 ****
 if not ecre.search(header):
 return [(header, None)]
- 
 decoded = []
 dec = ''
--- 56,59 ----
***************
*** 64,68 ****
 decoded.append((line, None))
 continue
- 
 parts = ecre.split(line)
 while parts:
--- 63,66 ----
***************
*** 109,113 ****
 continuation_ws=continuation_ws)
 for s, charset in decoded_seq:
! if not isinstance(charset, Charset):
 charset = Charset(charset)
 h.append(s, charset)
--- 107,112 ----
 continuation_ws=continuation_ws)
 for s, charset in decoded_seq:
! # None means us-ascii but we can simply pass it on to h.append()
! if charset is not None and not isinstance(charset, Charset):
 charset = Charset(charset)
 h.append(s, charset)

AltStyle によって変換されたページ (->オリジナル) /