Skip to content

gh-106320: Remove private _PyUnicode_AsString() alias #107021

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

Merged
merged 1 commit into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 0 additions & 5 deletions Include/cpython/unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,17 +446,12 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData(
Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation
in the unicodeobject.

_PyUnicode_AsString is a #define for PyUnicode_AsUTF8 to
support the previous internal function with the same behaviour.

Use of this API is DEPRECATED since no size information can be
extracted from the returned data.
*/

PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode);

#define _PyUnicode_AsString PyUnicode_AsUTF8

/* === Characters Type APIs =============================================== */

/* These should not be used directly. Use the Py_UNICODE_IS* and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Remove private ``_PyUnicode_AsString()`` alias to
:c:func:`PyUnicode_AsUTF8`. It was kept for backward compatibility with
Python 3.0 - 3.2. The :c:func:`PyUnicode_AsUTF8` is available since Python
3.3. The :c:func:`PyUnicode_AsUTF8String` function can be used to keep
compatibility with Python 3.2 and older. Patch by Victor Stinner.