Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Change PyBytesWriter_WriteBytes() argument type to void*
  • Loading branch information
vstinner committed Feb 16, 2025
commit c4f4c07c1259091c1904d0b86548b8e62eaa3509
2 changes: 1 addition & 1 deletion Include/cpython/bytesobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ PyAPI_FUNC(void*) PyBytesWriter_Extend(
PyAPI_FUNC(void*) PyBytesWriter_WriteBytes(
PyBytesWriter *writer,
void *buf,
const char *bytes,
const void *bytes,
Py_ssize_t size);
PyAPI_FUNC(void*) PyBytesWriter_Format(
PyBytesWriter *writer,
Expand Down
2 changes: 2 additions & 0 deletions Modules/_testcapi/bytes.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ static PyType_Spec Writer_spec = {
};


// Similar to bytes.center() with a different API: spaces are number of
// whitespaces added to the left and to the right.
static PyObject *
byteswriter_center_example(Py_ssize_t spaces, char *str, Py_ssize_t str_size)
{
Expand Down
2 changes: 1 addition & 1 deletion Objects/bytesobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3675,7 +3675,7 @@ PyBytesWriter_Extend(PyBytesWriter *writer, void *buf, Py_ssize_t extend)

void*
PyBytesWriter_WriteBytes(PyBytesWriter *writer, void *buf,
const char *bytes, Py_ssize_t size)
const void *bytes, Py_ssize_t size)
{
if (size < 0) {
size = strlen(bytes);
Expand Down