[Patches] [ python-Patches-1449244 ] email.message.py charset can be unicode instance

SourceForge.net noreply at sourceforge.net
Tue Mar 6 21:12:40 CET 2007


Patches item #1449244, was opened at 2006-03-13 23:55
Message generated for change (Comment added) made by tkikuchi
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1449244&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
>Group: Python 2.5
Status: Open
Resolution: None
>Priority: 7
Private: No
Submitted By: Tokio Kikuchi (tkikuchi)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: email.message.py charset can be unicode instance

Initial Comment:
*_charset in Charset become unicode instance in
email-4.0a. message.py should add this for type test.

--- email-4.0a2/email/message.py  Mon Mar  6 04:58:33 2006
+++ email/message.py    Mon Mar  6 14:59:04 2006
@@ -238,7 +238,7 @@
             self.del_param('charset')
             self._charset = None
             return
-        if isinstance(charset, str):
+        if isinstance(charset, str) or
isinstance(charset, unicode):
             charset = email.charset.Charset(charset)
         if not isinstance(charset, email.charset.Charset):
             raise TypeError(charset) 


----------------------------------------------------------------------

>Comment By: Tokio Kikuchi (tkikuchi)
Date: 2007-03-06 20:12

Message:
Logged In: YES 
user_id=67709
Originator: YES

Here is a revised patch with a test case.  I've found another unicode
charset bug in the code and it was fixed also.
File Added: email.1449244.patch

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2007-03-05 13:17

Message:
Logged In: YES 
user_id=21627
Originator: NO

Can you please include a test case for this, as a patch to the current
test suite, using the unittest framework?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1449244&group_id=5470


More information about the Patches mailing list