STINNER Victor added the comment:
I prefer to not touch punycode right now, it works, there is no need to modify
it.
--
resolution: - wont fix
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12263
Martin v. Löwis mar...@v.loewis.de added the comment:
What's the point of disallowing the replace error handler? That's a slightly
incompatible change, isn't it?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12263
STINNER Victor victor.stin...@haypocalc.com added the comment:
Oh, I forgot to give a little bit more details.
b'abc\xff-'.decode('punycode', 'ignore') and b'abc\xff-'.decode('punycode',
'replace') raise a UnicodeDecodeError: the error handler is just useless
(ignored) here.
With my patch,
Martin v. Löwis mar...@v.loewis.de added the comment:
Oh, I forgot to give a little bit more details.
b'abc\xff-'.decode('punycode', 'ignore') and
b'abc\xff-'.decode('punycode', 'replace') raise a UnicodeDecodeError:
the error handler is just useless (ignored) here.
That's not my point:
STINNER Victor victor.stin...@haypocalc.com added the comment:
@Martin: Can you review my patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12263
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
punycode_errors.patch:
- raise an error if errors=replace: only accept strict and ignore
- use errors to encode/decode to/from ASCII
- add unit tests
I don't think that the change should be documented, because punycode has no
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12263
___
___
New submission from STINNER Victor victor.stin...@haypocalc.com:
b'abc\xff'.decode('punycode', 'ignore') raises the same error than
b'abc\xff'.decode('punycode', 'replace') or b'abc\xff'.decode('punycode'): it
uses the strict error handler, and simply ignores the error handler.
punycodec, as
STINNER Victor victor.stin...@haypocalc.com added the comment:
base64_codec.py uses an assertion to check the error handler: it should use an
if+raise (assertions are ignored in optimized mode, python -O).
--
___
Python tracker