Marc-Andre Lemburg <m...@egenix.com> added the comment: STINNER Victor wrote: > > New submission from STINNER Victor <victor.stin...@haypocalc.com>: > > _PyUnicode_AsDefaultEncodedString() has two arguments: unicode (input string) > and errors. If errors is not NULL, it calls Py_FatalError()! > > The argument is useful: all functions call it with errors=NULL. > > Attached patch removes the argument.
While it's an internal API, it's still public and we cannot just remove the extra argument - we're in stable branch mode. Since Python3 fixes the UTF-8 default encoding, it's better to enhance PyUnicode_AsUTF8String() to cache the UTF-8 string in the Unicode object or simply return it directly and then replace all uses of _PyUnicode_AsDefaultEncodedString() with PyUnicode_AsUTF8String(). We should phase out use of _PyUnicode_AsDefaultEncodedString() as well as the whole default encoding terminology altogether. Please also add a documentation patch and a NEWS entry. ---------- nosy: +lemburg title: Remove unused "errors" argument from _PyUnicode_AsDefaultEncodedString() -> Remove unused "errors" argument from _PyUnicode_AsDefaultEncodedString() _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8923> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com