[issue19676] Add the namereplace error handler
Roundup Robot added the comment: New changeset 21d1571c0533 by Serhiy Storchaka in branch 'default': Issue #19676: Fixed integer overflow issue in namereplace error handler. https://hg.python.org/cpython/rev/21d1571c0533 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Serhiy Storchaka added the comment: Thank you Berker. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Ned Deily added the comment: ../../source/Python/codecs.c:1022:16: error: use of undeclared identifier 'out'; did you mean 'outp'? assert(out == start + ressize); ^~~ outp -- nosy: +ned.deily status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Ned Deily added the comment: Fixed in ce8a8531d29a -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Serhiy Storchaka added the comment: Ping. -- assignee: - serhiy.storchaka keywords: +needs review versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Amaury Forgeot d'Arc added the comment: The patch looks good to me. But it seems that the reverse operation is not possible in the general case: .decode('unicode_escape') assumes a latin-1 or ascii encoding. Should we document this? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Marc-Andre Lemburg added the comment: The patch looks good. One nit: the name buffer length should be NAME_MAXLEN instead of 100. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Nick Coghlan added the comment: Patch looks good to me, too. As far as Amaury's question goes, isn't the general reverse operation the same as for the existing backslashreplace handler? That is, decode with the appropriate ASCII compatible encoding (since ASCII compatibility is needed for the escape sequences to be valid), then run the result through ast.literal_eval? (I'll grant we don't currently provide guidance on reversing backslashreplace either, but addressing that sounds like a separate question from this change) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Roundup Robot added the comment: New changeset 32d08aacffe0 by Serhiy Storchaka in branch 'default': Issue #19676: Added the namereplace error handler. https://hg.python.org/cpython/rev/32d08aacffe0 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Serhiy Storchaka added the comment: Thank you all for reviews. One nit: the name buffer length should be NAME_MAXLEN instead of 100. NAME_MAXLEN is private name available only in Modules/unicodedata.c. Making it public name would be other issue. I have increased buffer size to 256. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Roundup Robot added the comment: New changeset b6fab008d63a by Berker Peksag in branch 'default': Issue #19676: Tweak documentation a bit. https://hg.python.org/cpython/rev/b6fab008d63a -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +ethan.furman, lemburg, ncoghlan, stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
New submission from Serhiy Storchaka: The proposed patch adds the namereplace error handler. This error handler is almost same as the backslashreplace error handler, but use \N{...} escape sequences if there is a character name in Unicode database. Result is a little more human-readable (but less portable) than with backslashreplace. '∀ x∈ℜ'.encode('ascii', 'namereplace') b'\\N{FOR ALL} x\\N{ELEMENT OF}\\N{BLACK-LETTER CAPITAL R}' The proposition was discussed and bikeshedded on Python-Ideas: http://comments.gmane.org/gmane.comp.python.ideas/21296 . -- components: Unicode files: namereplace_errors.patch keywords: patch messages: 203579 nosy: ezio.melotti, haypo, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add the namereplace error handler type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file32748/namereplace_errors.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19676] Add the namereplace error handler
STINNER Victor added the comment: See also issue #18234. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com