
On Sat, Jun 13, 2020 at 1:36 AM MRAB <python@mrabarnett.plus.com> wrote:
* Most of them are `PyUnicode_FromUnicode(NULL, 0);` * We may be able to keep PyUnicode_FromUnicode, but raise error when length>0.
I think it would be strange to keep PyUnicode_FromUnicode but complain unless length == 0. If it's going to be removed, then remove it and suggest a replacement for that use-case, such as PyUnicode_FromString with a NULL argument. (I'm not sure if PyUnicode_FromString will accept NULL, but if it currently doesn't, then maybe it should in future be treated as being equivalent to PyUnicode_FromString("").)
Of course, there is an API to create an empty string: PyUnicode_New(0, 0); But since Cython is using `PyUnicode_FromString(NULL, 0)`, keep it working for some versions will mitigate the breaking change. Note that we can remove wchar_t cache while keeping it working. Anyway, this is an idea for mitigation. If all of maintained packages fixes it before Python 3.11, mitigation is not needed. Regards, -- Inada Naoki <songofacandy@gmail.com>