summaryrefslogtreecommitdiff
path: root/Objects/bytesobject.c
AgeCommit message (Collapse)AuthorLines
2018-10-21bpo-34973: Fix crash in bytes constructor. (GH-9841)Miss Islington (bot)-35/+69
Constructing bytes from mutating list could cause a crash. (cherry picked from commit 914f9a078f997e58cfcfabcbb30fafdd1f277bef) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-14bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). ↵Miss Islington (bot)-1/+4
(GH-9852) bytes and bytearray constructors converted unexpected exceptions (e.g. MemoryError and KeyboardInterrupt) to TypeError. (cherry picked from commit e890421e334ccf0c000c6b29c4a521d86cd12f47) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-02bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683)Miss Islington (bot)-1/+1
formatfloat() was not checking if PyBytes_FromStringAndSize() failed, which could lead to a null pointer dereference in _PyBytes_FormatEx(). (cherry picked from commit 96c593279400693226d5a560c420ae0fcf1731b9) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-08-23bpo-34436: Fix check that disables overallocation for the last fmt specifier ↵Miss Islington (bot)-3/+3
(GH-8826) Reported by Svace static analyzer. (cherry picked from commit ccd99752675042bd5f67d332c5b0ed85ba1f2da3) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-01-27bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342)INADA Naoki-0/+2
2017-11-02bpo-23699: Use a macro to reduce boilerplate code in rich comparison ↵stratakis-20/+7
functions (GH-793)
2017-10-29bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)Serhiy Storchaka-2/+2
separators that are not bytes-like objects.
2017-10-20bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (#4058)Serhiy Storchaka-1/+1
and in codecs.escape_decode() when decode an escaped non-ascii byte.
2017-09-14bpo-31338 (#3374)Barry Warsaw-1/+1
* Add Py_UNREACHABLE() as an alias to abort(). * Use Py_UNREACHABLE() instead of assert(0) * Convert more unreachable code to use Py_UNREACHABLE() * Document Py_UNREACHABLE() and a few other macros.
2017-09-07bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow-0/+2
* group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
2017-04-08Expand the PySlice_GetIndicesEx macro. (#1023)Serhiy Storchaka-3/+3
2017-03-19bpo-29116: Fix error messages for concatenating bytes and bytearray with ↵Serhiy Storchaka-1/+1
unsupported type. (#709)
2017-03-14bpo-28856: Let %b format for bytes support objects that follow the buffer ↵Xiang Zhang-1/+14
protocol (GH-546)
2017-03-12bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485)Serhiy Storchaka-2/+2
2017-03-08bpo-29568: Disable any characters between two percents for escaped percent ↵Serhiy Storchaka-10/+10
"%%" in the format string for classic string formatting. (GH-513)
2017-03-06bpo-29714: Fix a regression that bytes format may fail when containing zero ↵Xiang Zhang-2/+2
bytes inside. (GH-499)
2017-01-06Merge 3.6INADA Naoki-8/+12
2017-01-06Issue #29159: Fix regression in bytes(x) when x.__index__() raises Exception.INADA Naoki-8/+12
2016-12-19Issue #28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCIISerhiy Storchaka-2/+2
whitespace, not only spaces. Patch by Robert Xiao.
2016-12-17Issue #29000: Fixed bytes formatting of octals with zero padding in alternateSerhiy Storchaka-3/+2
form.
2016-12-17Issue #29000: Fixed bytes formatting of octals with zero padding in alternateSerhiy Storchaka-3/+2
form.
2016-12-17Issue #29000: Fixed bytes formatting of octals with zero padding in alternateSerhiy Storchaka-3/+2
form.
2016-12-06Use _PyObject_CallNoArg()Victor Stinner-2/+2
Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
2016-12-04Backed out changeset b9c9691c72c5Victor Stinner-3/+4
Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
2016-12-01Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner-4/+3
* PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
2016-11-20Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka-4/+1
functions.
2016-10-31Issue 28128: Print out better error/warning messages for invalid string ↵Eric V. Smith-4/+33
escapes. Backport to 3.6.
2016-10-31Issue 28128: Print out better error/warning messages for invalid string escapes.Eric V. Smith-4/+33
2016-09-16Issue #25270: Merge from 3.5Berker Peksag-5/+14
2016-09-16Issue #25270: Prevent codecs.escape_encode() from raising SystemError when ↵Berker Peksag-5/+14
an empty bytestring is passed
2016-09-13Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly ↵Christian Heimes-10/+10
optimize memcpy().
2016-09-09remove all usage of Py_LOCALBenjamin Peterson-1/+1
2016-09-08#27364: Deprecate invalid escape strings in str/byutes.R David Murray-1/+2
Patch by Emanuel Barry, reviewed by Serhiy Storchaka and Martin Panter.
2016-08-30Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger-2/+2
2016-08-27Issue #27506: Support bytes/bytearray.translate() delete as keyword argumentMartin Panter-6/+4
Patch by Xiang Zhang.
2016-08-15Issue #27704: Optimized creating bytes and bytearray from byte-like objectsSerhiy Storchaka-10/+8
and iterables. Speed up to 3 times for short objects. Original patch by Naoki Inada.
2016-07-10Issue #27473: Fixed possible integer overflow in bytes and bytearraySerhiy Storchaka-4/+2
concatenations. Patch by Xiang Zhang.
2016-07-10Issue #27473: Fixed possible integer overflow in bytes and bytearraySerhiy Storchaka-4/+2
concatenations. Patch by Xiang Zhang.
2016-07-06Issue #27460: Unified error messages in bytes constructor for integersSerhiy Storchaka-2/+2
in and out of the Py_ssize_t range. Patch by Xiang Zhang.
2016-07-03Backed out changeset b0087e17cd5e (issue #26765)Serhiy Storchaka-11/+71
For unknown reasons it perhaps caused a crash on 32-bit Windows (issue #).
2016-07-01Issue #26765: Moved wrappers for bytes and bytearray methods to common headerSerhiy Storchaka-71/+11
file.
2016-07-01Issue #27007: The fromhex() class methods of bytes and bytearray subclassesSerhiy Storchaka-1/+6
now return an instance of corresponding subclass.
2016-05-30Issue #27125: Merge typo fixes from 3.5Martin Panter-1/+1
2016-05-30Issue #27125: Remove duplicated words from documentation and commentsMartin Panter-1/+1
2016-05-05Issue #26765: Moved common code for the replace() method of bytes and bytearraySerhiy Storchaka-505/+3
to a template file.
2016-05-04Issue #26765: Moved common code and docstrings for bytes and bytearray methodsSerhiy Storchaka-336/+26
to bytes_methods.c.
2016-05-02Got rid of redundand "self" parameter declarations.Serhiy Storchaka-26/+20
Argument Clinic is now able to infer all needed information.
2016-04-26Issue #25349, #26249: Fix memleak in formatfloat()Victor Stinner-0/+1
2016-04-15Issue #26766: Fix _PyBytesWriter_Finish()Victor Stinner-1/+6
Return a bytearray object when bytearray is requested and when the small buffer is used. Fix also test_bytes: bytearray%args must return a bytearray type.
2016-04-15Issue #26764: Fixed SystemError in bytes.__rmod__.Serhiy Storchaka-6/+4