mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-40834: Fix truncate when sending str object with channel (GH-20555)
This commit is contained in:
parent
1c209e3b53
commit
29c117202e
3 changed files with 5 additions and 1 deletions
|
@ -1726,7 +1726,7 @@ _str_shared(PyObject *obj, _PyCrossInterpreterData *data)
|
|||
struct _shared_str_data *shared = PyMem_NEW(struct _shared_str_data, 1);
|
||||
shared->kind = PyUnicode_KIND(obj);
|
||||
shared->buffer = PyUnicode_DATA(obj);
|
||||
shared->len = PyUnicode_GET_LENGTH(obj) - 1;
|
||||
shared->len = PyUnicode_GET_LENGTH(obj);
|
||||
data->data = (void *)shared;
|
||||
Py_INCREF(obj);
|
||||
data->obj = obj; // Will be "released" (decref'ed) when data released.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue