From d6cb5a8508cd17bf0492dc1c132613bea12b4e1b Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Tue, 16 Aug 2022 00:15:11 -0500 Subject: [PATCH 1/2] 3.11 Whatsnew: Add Py_UNICODE encode functions removed in PEP 624 --- Doc/whatsnew/3.11.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index f1f023038abe1c..f93b1648d55a83 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -2116,5 +2116,30 @@ Removed API). (Contributed by Victor Stinner in :issue:`45412`.) +* Remove the :c:type:`Py_UNICODE` encoder APIs, + as they have been deprecated since Python 3.3, + are little used + and are inefficient relative to the recommended alternatives. + + The removed functions are: + + * :c:func:`!PyUnicode_Encode` + * :c:func:`!PyUnicode_EncodeASCII` + * :c:func:`!PyUnicode_EncodeLatin1` + * :c:func:`!PyUnicode_EncodeUTF7` + * :c:func:`!PyUnicode_EncodeUTF8` + * :c:func:`!PyUnicode_EncodeUTF16` + * :c:func:`!PyUnicode_EncodeUTF32` + * :c:func:`!PyUnicode_EncodeUnicodeEscape` + * :c:func:`!PyUnicode_EncodeRawUnicodeEscape` + * :c:func:`!PyUnicode_EncodeCharmap` + * :c:func:`!PyUnicode_TranslateCharmap` + * :c:func:`!PyUnicode_EncodeDecimal` + * :c:func:`!PyUnicode_TransformDecimalToASCII` + + See :pep:`624` for details and + :pep:`migration guidance <624#alternative-apis>`. + (Contributed by Inada Naoki in :issue:`44029`.) + .. _libb2: https://www.blake2.net/ From f046f3b82fe7f40914db397f72fa2ef60a407f45 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Thu, 18 Aug 2022 16:00:11 -0500 Subject: [PATCH 2/2] Just use :func: instead of :c:func: for non-resolved funcs so ! works --- Doc/whatsnew/3.11.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index f93b1648d55a83..2cbfb3f3413235 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -2123,19 +2123,19 @@ Removed The removed functions are: - * :c:func:`!PyUnicode_Encode` - * :c:func:`!PyUnicode_EncodeASCII` - * :c:func:`!PyUnicode_EncodeLatin1` - * :c:func:`!PyUnicode_EncodeUTF7` - * :c:func:`!PyUnicode_EncodeUTF8` - * :c:func:`!PyUnicode_EncodeUTF16` - * :c:func:`!PyUnicode_EncodeUTF32` - * :c:func:`!PyUnicode_EncodeUnicodeEscape` - * :c:func:`!PyUnicode_EncodeRawUnicodeEscape` - * :c:func:`!PyUnicode_EncodeCharmap` - * :c:func:`!PyUnicode_TranslateCharmap` - * :c:func:`!PyUnicode_EncodeDecimal` - * :c:func:`!PyUnicode_TransformDecimalToASCII` + * :func:`!PyUnicode_Encode` + * :func:`!PyUnicode_EncodeASCII` + * :func:`!PyUnicode_EncodeLatin1` + * :func:`!PyUnicode_EncodeUTF7` + * :func:`!PyUnicode_EncodeUTF8` + * :func:`!PyUnicode_EncodeUTF16` + * :func:`!PyUnicode_EncodeUTF32` + * :func:`!PyUnicode_EncodeUnicodeEscape` + * :func:`!PyUnicode_EncodeRawUnicodeEscape` + * :func:`!PyUnicode_EncodeCharmap` + * :func:`!PyUnicode_TranslateCharmap` + * :func:`!PyUnicode_EncodeDecimal` + * :func:`!PyUnicode_TransformDecimalToASCII` See :pep:`624` for details and :pep:`migration guidance <624#alternative-apis>`.