diff options
author | Victor Stinner <vstinner@python.org> | 2023-10-20 17:29:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-20 17:29:27 (GMT) |
commit | d8f32be5b6a736dc2fc9dca3f1bf176c82fc9b44 (patch) | |
tree | 371af41d6ec06a2d00f17212d1047d2b026ec9d3 /Include/cpython | |
parent | 264f4af506bf5b587105eab37fcfb7dfa62d6587 (diff) | |
download | cpython-d8f32be5b6a736dc2fc9dca3f1bf176c82fc9b44.zip cpython-d8f32be5b6a736dc2fc9dca3f1bf176c82fc9b44.tar.gz cpython-d8f32be5b6a736dc2fc9dca3f1bf176c82fc9b44.tar.bz2 |
gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)
Add PyUnicode_AsUTF8() function to the limited C API.
multiprocessing posixshmem now uses PyUnicode_AsUTF8() instead of
PyUnicode_AsUTF8AndSize(): the extension is built with the limited C
API. The function now raises an exception if the filename contains an
embedded null character instead of truncating silently the filename.
Diffstat (limited to 'Include/cpython')
-rw-r--r-- | Include/cpython/unicodeobject.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h index d67553c..d200fa0 100644 --- a/Include/cpython/unicodeobject.h +++ b/Include/cpython/unicodeobject.h @@ -440,19 +440,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData( const void *buffer, Py_ssize_t size); -/* --- Manage the default encoding ---------------------------------------- */ - -// Returns a pointer to the default encoding (UTF-8) of the -// Unicode object unicode. -// -// Raise an exception if the string contains embedded null characters. -// Use PyUnicode_AsUTF8AndSize() to accept embedded null characters. -// -// This function caches the UTF-8 encoded string in the Unicode object -// and subsequent calls will return the same string. The memory is released -// when the Unicode object is deallocated. -PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode); - /* === Characters Type APIs =============================================== */ |