[Patches] [ python-Patches-1443875 ] email/charset.py convert() patch

SourceForge.net noreply at sourceforge.net
Tue Mar 13 12:58:38 CET 2007


Patches item #1443875, was opened at 2006-03-06 04:41
Message generated for change (Comment added) made by tkikuchi
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1443875&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.4
Status: Open
Resolution: None
>Priority: 1
Private: No
Submitted By: Tokio Kikuchi (tkikuchi)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: email/charset.py convert() patch

Initial Comment:
email/charset.py has convert() function to incorporate
using different charset for input and output for a
language like Japanese.  Because the email user agent
in Japan frequently use characters outside the range of
legitimate JIS charset, these messages are shunted in
mailman delivery.  Here is a patch to handle this case
by replacing the characters by '?' using the 'errors'
parameter in unicode/encode functions.

This patch includes the unicode string conversion patch
in #1368247.



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

>Comment By: Tokio Kikuchi (tkikuchi)
Date: 2007-03-13 11:58

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

Ok, I worked a little on the code to propagate the choice of 'strict' or
'replace' but there are many we should fix.  And we should fix the
application, mailman, also.  The problem is only related to Japanese and
we'd rather find workarounds elsewhere.  I put the priority of this patch
lowest.  Thanks for your comments. 

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

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

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

I'm -1 on this patch as-is. It changes the default error handling behavior
from 'strict' to 'replace', for this method. This is a choice that the
caller of these methods should make, so I think the default value for the
error handling should be 'strict'. If then it is meaningful in mailman to
set this to 'replace', this is mailman's choice. Python should never, on
its own, create moji-bake.

If you revise this patch, please provide the test case as a patch to
Lib/email/test somehow (probably patching both test_email and
test_email_renamed).

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

Comment By: Tokio Kikuchi (tkikuchi)
Date: 2006-03-13 23:35

Message:
Logged In: YES 
user_id=67709

Thanks! Here is an example program which fails on 4.0a
without the patch.


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

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2006-03-12 13:09

Message:
Logged In: YES 
user_id=12800

Do you have a test case for this? #1368247 includes one just
for the encoding of unicode strings, but not for the error
argument.  If you can include a simple test case, then I'll
add this patch.



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

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


More information about the Patches mailing list