Martin v. Löwis <mar...@v.loewis.de> added the comment:

Éric, I think the patch needs some rework. First, it is incorrect/incomplete: 
please see the Char definition for a complete list of characters that must be 
excluded. This then raises a Unicode vs. bytes issue, where invalid Unicode 
characters must be prohibited before the string actually being encoded (since 
apply the regex to the encoded string is not practical).

The other side of the bytes vs. string issue is that the bytes really ought to 
be in self.encoding, which doesn't get checked, either.

And then, it lacks tests.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10066>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to