summaryrefslogtreecommitdiffstats
path: root/Include/cpython/bytesobject.h
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-133767: Fix use-after-free in the unicode-escape decoder with an ↵Serhiy Storchaka2025-05-261-0/+4
| | | | | | | | | | | | | | | error handler (GH-129648) (GH-133944) (#134337) If the error handler is used, a new bytes object is created to set as the object attribute of UnicodeDecodeError, and that bytes object then replaces the original data. A pointer to the decoded data will became invalid after destroying that temporary bytes object. So we need other way to return the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal(). _PyBytes_DecodeEscape() does not have such issue, because it does not use the error handlers registry, but it should be changed for compatibility with _PyUnicode_DecodeUnicodeEscapeInternal(). (cherry picked from commit 9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e) (cherry picked from commit 6279eb8c076d89d3739a6edb393e43c7929b429d)
* gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)Victor Stinner2022-06-131-6/+2
| | | | Header files in the Include/cpython/ are only included if the Py_LIMITED_API macro is not defined.
* gh-89653: PEP 670: Convert PyBytes macros to functions (#91990)Victor Stinner2022-05-031-4/+19
| | | | | | | | | | | | Convert the following macros to static inline functions: * PyByteArray_AS_STRING() * PyByteArray_GET_SIZE() * PyBytes_AS_STRING() * PyBytes_GET_SIZE() Limited C API version 3.11 no longer casts arguments. Add _PyBytes_CAST() and _PyByteArray_CAST() macros.
* bpo-46864: Deprecate PyBytesObject.ob_shash. (GH-31598)Inada Naoki2022-03-061-1/+1
|
* bpo-46848: Move _PyBytes_Find() to internal C API (GH-31642)Victor Stinner2022-03-021-19/+0
| | | | | | Move _PyBytes_Find() and _PyBytes_ReverseFind() functions to the internal C API. bytesobject.c now includes pycore_bytesobject.h.
* bpo-46848: Use stringlib/fastsearch in mmap (GH-31625)Dennis Sweeney2022-03-021-0/+19
| | | Speed up mmap.find(). Add _PyBytes_Find() and _PyBytes_ReverseFind().
* bpo-42431: Fix outdated bytes comments (GH-23458)Serhiy Storchaka2020-12-031-1/+1
| | | | Also move definitions of internal macros F_LJUST etc to private header.
* bpo-35134: Add Include/cpython/bytesobject.h file (GH-18494)Victor Stinner2020-02-121-0/+118
Add Include/cpython/bytearrayobject.h and Include/cpython/bytesobject.h header files. Move CPython C API from Include/bytesobject.h into a new Include/cpython/bytesobject.h header file which is included by Include/bytesobject.h. Do a similar change for Include/bytearrayobject.h.