[issue15016] Add special case for latin messages in email.mime.text
Glenn Linderman
report at bugs.python.org
Sun Jun 24 02:17:48 CEST 2012
Glenn Linderman <v+python at g.nevcal.com> added the comment:
Patch is interesting, using an encoder to detect validity. However, it suffers from some performance problems for long text that has large ASCII prefixes.
This seems to be an enhancement sort of request rather than a bug... so I wonder why Python 3.2 is listed?
And in Python 3.3 with PEP 393 strings the C API to strings provides a quick way to determine the maximum character in the string... although I see nothing in the PEP about how to access that information from Python. If it is available, it could provide a much quicker precheck rather than multiple attempts to encode strings with large ASCII prefixes only to discover that the next to last character is in (128,255) and the last character is > 255 (which would be about the worst case scenario for the algorithm in the patch).
----------
nosy: +v+python
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15016>
_______________________________________
More information about the Python-bugs-list
mailing list