]> granicus.if.org Git - python/commit
Optimize backslashreplace error handler
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 8 Oct 2015 23:39:28 +0000 (01:39 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 8 Oct 2015 23:39:28 +0000 (01:39 +0200)
commite7bf86cd7d7c9a3924501875a08c4ef4a0063103
treee0097b0f4fb0194d233d1d9f58bf8570815873c3
parentfdfbf781140f22619b0ef6bfeac792496774bb69
Optimize backslashreplace error handler

Issue #25318: Optimize backslashreplace and xmlcharrefreplace error handlers in
UTF-8 encoder. Optimize also backslashreplace error handler for ASCII and
Latin1 encoders.

Use the new _PyBytesWriter API to optimize these error handlers for the
encoders. It avoids to create an exception and call the slow implementation of
the error handler.
Objects/stringlib/codecs.h
Objects/unicodeobject.c