[Python-checkins] python/dist/src/Lib/email Charset.py,1.7.2.1,1.7.2.2 Message.py,1.9.6.1,1.9.6.2 __init__.py,1.4.10.2,1.4.10.3

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Thu, 10 Oct 2002 12:09:27 -0700


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

Modified Files:
      Tag: release22-maint
	Charset.py Message.py __init__.py 
Log Message:
Backport email 2.4.2 changes from Python 2.3.


Index: Charset.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -C2 -d -r1.7.2.1 -r1.7.2.2
*** Charset.py	4 Oct 2002 17:24:23 -0000	1.7.2.1
--- Charset.py	10 Oct 2002 19:09:23 -0000	1.7.2.2
***************
*** 178,181 ****
--- 178,183 ----
      """
      def __init__(self, input_charset=DEFAULT_CHARSET):
+         # RFC 2046, $4.1.2 says charsets are not case sensitive
+         input_charset = input_charset.lower()
          # Set the input charset after filtering through the aliases
          self.input_charset = ALIASES.get(input_charset, input_charset)
***************
*** 184,188 ****
          # it.
          henc, benc, conv = CHARSETS.get(self.input_charset,
!                                         (SHORTEST, SHORTEST, None))
          # Set the attributes, allowing the arguments to override the default.
          self.header_encoding = henc
--- 186,190 ----
          # it.
          henc, benc, conv = CHARSETS.get(self.input_charset,
!                                         (SHORTEST, BASE64, None))
          # Set the attributes, allowing the arguments to override the default.
          self.header_encoding = henc

Index: Message.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v
retrieving revision 1.9.6.1
retrieving revision 1.9.6.2
diff -C2 -d -r1.9.6.1 -r1.9.6.2
*** Message.py	4 Oct 2002 17:24:24 -0000	1.9.6.1
--- Message.py	10 Oct 2002 19:09:24 -0000	1.9.6.2
***************
*** 761,766 ****
          """Return the charset parameter of the Content-Type header.
  
!         If there is no Content-Type header, or if that header has no charset
!         parameter, failobj is returned.
          """
          missing = []
--- 761,767 ----
          """Return the charset parameter of the Content-Type header.
  
!         The returned string is always coerced to lower case.  If there is no
!         Content-Type header, or if that header has no charset parameter,
!         failobj is returned.
          """
          missing = []
***************
*** 770,775 ****
          if isinstance(charset, TupleType):
              # RFC 2231 encoded, so decode it, and it better end up as ascii.
!             return unicode(charset[2], charset[0]).encode('us-ascii')
!         return charset
  
      def get_charsets(self, failobj=None):
--- 771,777 ----
          if isinstance(charset, TupleType):
              # RFC 2231 encoded, so decode it, and it better end up as ascii.
!             charset = unicode(charset[2], charset[0]).encode('us-ascii')
!         # RFC 2046, $4.1.2 says charsets are not case sensitive
!         return charset.lower()
  
      def get_charsets(self, failobj=None):

Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v
retrieving revision 1.4.10.2
retrieving revision 1.4.10.3
diff -C2 -d -r1.4.10.2 -r1.4.10.3
*** __init__.py	7 Oct 2002 17:18:52 -0000	1.4.10.2
--- __init__.py	10 Oct 2002 19:09:24 -0000	1.4.10.3
***************
*** 5,9 ****
  """
  
! __version__ = '2.4.1'
  
  __all__ = [
--- 5,9 ----
  """
  
! __version__ = '2.4.2'
  
  __all__ = [