[Python-checkins] python/dist/src/Lib/email Message.py, 1.9.6.4,
1.9.6.5 Utils.py, 1.9.6.2, 1.9.6.3 __init__.py, 1.4.10.8, 1.4.10.9
bwarsaw at users.sourceforge.net
bwarsaw at users.sourceforge.net
Mon Aug 18 22:56:49 EDT 2003
Update of /cvsroot/python/python/dist/src/Lib/email
In directory sc8-pr-cvs1:/tmp/cvs-serv20788/Lib/email
Modified Files:
Tag: release22-maint
Message.py Utils.py __init__.py
Log Message:
Backporting email 2.5.4 fixes from the trunk.
Index: Message.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v
retrieving revision 1.9.6.4
retrieving revision 1.9.6.5
diff -C2 -d -r1.9.6.4 -r1.9.6.5
*** Message.py 8 May 2003 04:00:04 -0000 1.9.6.4
--- Message.py 19 Aug 2003 04:56:46 -0000 1.9.6.5
***************
*** 572,582 ****
value can either be a string, or a 3-tuple if the parameter was RFC
2231 encoded. When it's a 3-tuple, the elements of the value are of
! the form (CHARSET, LANGUAGE, VALUE), where LANGUAGE may be the empty
! string. Your application should be prepared to deal with these, and
! can convert the parameter to a Unicode string like so:
param = msg.get_param('foo')
if isinstance(param, tuple):
! param = unicode(param[2], param[0])
In any case, the parameter value (either the returned string, or the
--- 572,585 ----
value can either be a string, or a 3-tuple if the parameter was RFC
2231 encoded. When it's a 3-tuple, the elements of the value are of
! the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and
! LANGUAGE can be None, in which case you should consider VALUE to be
! encoded in the us-ascii charset. You can usually ignore LANGUAGE.
!
! Your application should be prepared to deal with 3-tuple return
! values, and can convert the parameter to a Unicode string like so:
param = msg.get_param('foo')
if isinstance(param, tuple):
! param = unicode(param[2], param[0] or 'us-ascii')
In any case, the parameter value (either the returned string, or the
***************
*** 709,713 ****
# It's an RFC 2231 encoded parameter
newvalue = _unquotevalue(filename)
! return unicode(newvalue[2], newvalue[0])
else:
newvalue = _unquotevalue(filename.strip())
--- 712,716 ----
# It's an RFC 2231 encoded parameter
newvalue = _unquotevalue(filename)
! return unicode(newvalue[2], newvalue[0] or 'us-ascii')
else:
newvalue = _unquotevalue(filename.strip())
***************
*** 726,730 ****
if isinstance(boundary, TupleType):
# RFC 2231 encoded, so decode. It better end up as ascii
! return unicode(boundary[2], boundary[0]).encode('us-ascii')
return _unquotevalue(boundary.strip())
--- 729,734 ----
if isinstance(boundary, TupleType):
# RFC 2231 encoded, so decode. It better end up as ascii
! charset = boundary[0] or 'us-ascii'
! return unicode(boundary[2], charset).encode('us-ascii')
return _unquotevalue(boundary.strip())
***************
*** 793,797 ****
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()
--- 797,802 ----
if isinstance(charset, TupleType):
# RFC 2231 encoded, so decode it, and it better end up as ascii.
! pcharset = charset[0] or 'us-ascii'
! charset = unicode(charset[2], pcharset).encode('us-ascii')
# RFC 2046, $4.1.2 says charsets are not case sensitive
return charset.lower()
Index: Utils.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v
retrieving revision 1.9.6.2
retrieving revision 1.9.6.3
diff -C2 -d -r1.9.6.2 -r1.9.6.3
*** Utils.py 21 Mar 2003 21:09:31 -0000 1.9.6.2
--- Utils.py 19 Aug 2003 04:56:47 -0000 1.9.6.3
***************
*** 281,285 ****
parts = s.split("'", 2)
if len(parts) == 1:
! return None, None, s
charset, language, s = parts
return charset, language, urllib.unquote(s)
--- 281,285 ----
parts = s.split("'", 2)
if len(parts) == 1:
! return None, None, urllib.unquote(s)
charset, language, s = parts
return charset, language, urllib.unquote(s)
Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v
retrieving revision 1.4.10.8
retrieving revision 1.4.10.9
diff -C2 -d -r1.4.10.8 -r1.4.10.9
*** __init__.py 29 May 2003 20:09:31 -0000 1.4.10.8
--- __init__.py 19 Aug 2003 04:56:47 -0000 1.4.10.9
***************
*** 5,9 ****
"""
! __version__ = '2.5.3'
__all__ = [
--- 5,9 ----
"""
! __version__ = '2.5.4'
__all__ = [
More information about the Python-checkins
mailing list