On Sat, Jun 13, 2020 at 1:36 AM MRAB <[email protected]> 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 <[email protected]> _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/3OD7WH2QUPF5NBM2S6R3KXCGBWLQEQOS/ Code of Conduct: http://python.org/psf/codeofconduct/
