I modified CJK codecs to reuse the new PyUnicodeWriter API (to use the PEP 393 instead of Py_UNICODE*). The problem is that PyUnicodeWriter error is not handled correctly: the decoder should return MBERR_EXCEPTION, whereas the error is not handled at all currently. I found this issue while working on issue #18408, using the pyfailmalloc tool to inject faults (memory allocation error).
> Victor, are you going to write a patch for this before beta 1? Not before at least one week, I'm busy on tracemalloc. If anyone is interesting, please write a patch and I will review it :-) (The CJK macros are ugly!)