Skip to content

Commit 844a399

Browse files
committed
Add to the limited C API
1 parent 36973d6 commit 844a399

File tree

6 files changed

+9
-4
lines changed

6 files changed

+9
-4
lines changed

Doc/data/stable_abi.dat

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/cpython/unicodeobject.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData(
440440
const void *buffer,
441441
Py_ssize_t size);
442442

443-
// Similar to PyUnicode_AsUTF8(), but raise ValueError if the string contains
444-
// embedded null characters.
445-
PyAPI_FUNC(const char *) PyUnicode_AsUTF8Safe(PyObject *unicode);
446-
447443

448444
/* === Characters Type APIs =============================================== */
449445

Include/unicodeobject.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,10 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String(
453453
// when the Unicode object is deallocated.
454454
PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode);
455455

456+
// Similar to PyUnicode_AsUTF8(), but raise ValueError if the string contains
457+
// embedded null characters.
458+
PyAPI_FUNC(const char *) PyUnicode_AsUTF8Safe(PyObject *unicode);
459+
456460
// Returns a pointer to the UTF-8 encoding of the
457461
// Unicode object unicode and the size of the encoded representation
458462
// in bytes stored in `*size` (if size is not NULL).

Lib/test/test_stable_abi_ctypes.py

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Misc/stable_abi.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,8 @@
24802480
added = '3.13'
24812481
[function.PyUnicode_AsUTF8]
24822482
added = '3.13'
2483+
[function.PyUnicode_AsUTF8Safe]
2484+
added = '3.13'
24832485
[function._Py_SetRefcnt]
24842486
added = '3.13'
24852487
abi_only = true

PC/python3dll.c

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)