Skip to content

Commit

Permalink
Rename to _PyUnicode_AsUTF8NoNUL().
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Nov 10, 2023
1 parent 6991c7c commit 695a178
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Include/internal/pycore_unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ extern void _PyUnicode_ClearInterned(PyInterpreterState *interp);

// Like PyUnicode_AsUTF8(), but check for embedded null characters.
// Export for '_sqlite3' shared extension.
PyAPI_FUNC(const char *) _PyUnicode_AsUTF8(PyObject *);
PyAPI_FUNC(const char *) _PyUnicode_AsUTF8NoNUL(PyObject *);


#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion Modules/_io/textio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ io_check_errors(PyObject *errors)
return 0;
}

const char *name = _PyUnicode_AsUTF8(errors);
const char *name = _PyUnicode_AsUTF8NoNUL(errors);
if (name == NULL) {
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ isolation_level_converter(PyObject *str_or_none, const char **result)
*result = NULL;
}
else if (PyUnicode_Check(str_or_none)) {
const char *str = _PyUnicode_AsUTF8(str_or_none);
const char *str = _PyUnicode_AsUTF8NoNUL(str_or_none);
if (str == NULL) {
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3848,7 +3848,7 @@ PyUnicode_AsUTF8(PyObject *unicode)
}

const char *
_PyUnicode_AsUTF8(PyObject *unicode)
_PyUnicode_AsUTF8NoNUL(PyObject *unicode)
{
Py_ssize_t size;
const char *s = PyUnicode_AsUTF8AndSize(unicode, &size);
Expand Down

0 comments on commit 695a178

Please sign in to comment.