This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: email/charset.py convert() patch
Type: enhancement Stage: patch review
Components: email, Library (Lib) Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, loewis, r.david.murray, tkikuchi, vstinner
Priority: low Keywords: patch

Created on 2006-03-06 04:41 by tkikuchi, last changed 2022-04-11 14:56 by admin.

Files
File name Uploaded Description Edit
charset.py.patch tkikuchi, 2006-03-06 04:41 charset.py.patch
ja-nonlegit.py tkikuchi, 2006-03-13 23:35 non-legitimate ja characters example
Messages (6)
msg49660 - (view) Author: Tokio Kikuchi (tkikuchi) Date: 2006-03-06 04:41
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.

msg49661 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2006-03-12 13:09
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.

msg49662 - (view) Author: Tokio Kikuchi (tkikuchi) Date: 2006-03-13 23:35
Logged In: YES 
user_id=67709

Thanks! Here is an example program which fails on 4.0a
without the patch.
msg49663 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-03-05 13:15
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).
msg49664 - (view) Author: Tokio Kikuchi (tkikuchi) Date: 2007-03-13 11:58
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. 
msg348645 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-29 12:00
This issue is not newcomer friendly, I remove the easy keyword.
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42985
2019-07-29 12:00:52vstinnersetkeywords: - easy
nosy: + vstinner
messages: + msg348645

2012-05-16 01:38:34r.david.murraysetassignee: r.david.murray ->
components: + email
2011-03-13 22:49:22r.david.murraysetnosy: loewis, barry, tkikuchi, r.david.murray
versions: + Python 3.3, - Python 3.2
2010-12-27 17:04:58r.david.murrayunlinkissue1685453 dependencies
2010-08-09 04:40:24terry.reedysetversions: + Python 3.2, - Python 3.1, Python 2.7
2010-05-05 13:53:29barrysetassignee: barry -> r.david.murray

nosy: + r.david.murray
2009-04-22 14:35:26ajaksu2setkeywords: + easy
2009-03-30 22:56:23ajaksu2linkissue1685453 dependencies
2009-03-21 00:45:44ajaksu2setstage: patch review
type: enhancement
versions: + Python 3.1, Python 2.7, - Python 2.4
2006-03-06 04:41:30tkikuchicreate