gh-132798: Schedule removal of PyUnicode_AsDecoded/Encoded functions for 3.15 (#132799)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Stan Ulbrych 2025-04-25 14:07:41 +01:00 committed by GitHub
parent 8783cec9b6
commit f6fb498c97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 16 deletions

View file

@ -3733,7 +3733,8 @@ PyUnicode_AsDecodedObject(PyObject *unicode,
}
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"PyUnicode_AsDecodedObject() is deprecated; "
"PyUnicode_AsDecodedObject() is deprecated "
"and will be removed in 3.15; "
"use PyCodec_Decode() to decode from str", 1) < 0)
return NULL;
@ -3757,7 +3758,8 @@ PyUnicode_AsDecodedUnicode(PyObject *unicode,
}
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"PyUnicode_AsDecodedUnicode() is deprecated; "
"PyUnicode_AsDecodedUnicode() is deprecated "
"and will be removed in 3.15; "
"use PyCodec_Decode() to decode from str to str", 1) < 0)
return NULL;
@ -3796,7 +3798,8 @@ PyUnicode_AsEncodedObject(PyObject *unicode,
}
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"PyUnicode_AsEncodedObject() is deprecated; "
"PyUnicode_AsEncodedObject() is deprecated "
"and will be removed in 3.15; "
"use PyUnicode_AsEncodedString() to encode from str to bytes "
"or PyCodec_Encode() for generic encoding", 1) < 0)
return NULL;
@ -4019,7 +4022,8 @@ PyUnicode_AsEncodedUnicode(PyObject *unicode,
}
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"PyUnicode_AsEncodedUnicode() is deprecated; "
"PyUnicode_AsEncodedUnicode() is deprecated "
"and will be removed in 3.15; "
"use PyCodec_Encode() to encode from str to str", 1) < 0)
return NULL;