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.
This commit is contained in:
Victor Stinner 2023-10-20 19:29:27 +02:00 committed by GitHub
parent 264f4af506
commit d8f32be5b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 16 deletions

1
PC/python3dll.c generated
View file

@ -661,6 +661,7 @@ EXPORT_FUNC(PyUnicode_AsUCS4Copy)
EXPORT_FUNC(PyUnicode_AsUnicodeEscapeString)
EXPORT_FUNC(PyUnicode_AsUTF16String)
EXPORT_FUNC(PyUnicode_AsUTF32String)
EXPORT_FUNC(PyUnicode_AsUTF8)
EXPORT_FUNC(PyUnicode_AsUTF8AndSize)
EXPORT_FUNC(PyUnicode_AsUTF8String)
EXPORT_FUNC(PyUnicode_AsWideChar)