mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Fix bytes.__bytes__ to not truncate at a zero byte (GH-27902)
This commit is contained in:
parent
24b63c695a
commit
ae5259171b
2 changed files with 3 additions and 3 deletions
|
|
@ -1701,7 +1701,7 @@ bytes___bytes___impl(PyBytesObject *self)
|
|||
return (PyObject *)self;
|
||||
}
|
||||
else {
|
||||
return PyBytes_FromString(self->ob_sval);
|
||||
return PyBytes_FromStringAndSize(self->ob_sval, Py_SIZE(self));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue