Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-41098: Doc: Add missing deprecated directives #21162

Merged
merged 4 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,12 @@ The following functions are used to create and modify Unicode exceptions from C.
*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are
UTF-8 encoded strings.

.. deprecated:: 3.3

``Py_UNICODE`` is deprecated since Python 3.3. This API will be removed
in Python 3.11. Please migrate to
``PyObject_CallFunction(PyExc_UnicodeEncodeError, "sOnns", ...)``.

.. c:function:: PyObject* PyUnicodeTranslateError_Create(const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)

Create a :class:`UnicodeTranslateError` object with the attributes *object*,
Expand Down
5 changes: 4 additions & 1 deletion Include/cpython/pyerrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(
PyObject *filename,
int lineno);

/* Create a UnicodeEncodeError object */
/* Create a UnicodeEncodeError object
*
* TODO: This API will be removed in Python 3.11.
*/
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
const char *encoding, /* UTF-8 encoded string */
const Py_UNICODE *object,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added missing ``deprecated`` directive for ``PyUnicodeEncodeError_Create``.
methane marked this conversation as resolved.
Show resolved Hide resolved