summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34170: Add _PyCoreConfig.bytes_warning (GH-8447)Victor Stinner2018-07-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more fields to _PyCoreConfig: * _check_hash_pycs_mode * bytes_warning * debug * inspect * interactive * legacy_windows_fs_encoding * legacy_windows_stdio * optimization_level * quiet * unbuffered_stdio * user_site_directory * verbose * write_bytecode Changes: * Remove pymain_get_global_config() and pymain_set_global_config() which became useless. These functions have been replaced by _PyCoreConfig_GetGlobalConfig() and _PyCoreConfig_SetGlobalConfig(). * sys.flags.dont_write_bytecode value is now restricted to 1 even if -B option is specified multiple times on the command line. * PyThreadState_Clear() now uses the config from the current interpreter rather than using global Py_VerboseFlag
* bpo-20180: complete AC conversion of Objects/stringlib/transmogrify.h (GH-8039)Tal Einat2018-07-061-7/+5
| | | | * converted bytes methods: expandtabs, ljust, rjust, center, zfill * updated char_convertor to properly set the C default value
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-17/+17
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342)INADA Naoki2018-01-271-0/+2
|
* bpo-23699: Use a macro to reduce boilerplate code in rich comparison ↵stratakis2017-11-021-20/+7
| | | | functions (GH-793)
* bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)Serhiy Storchaka2017-10-281-2/+2
| | | separators that are not bytes-like objects.
* bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (#4058)Serhiy Storchaka2017-10-201-1/+1
| | | | and in codecs.escape_decode() when decode an escaped non-ascii byte.
* bpo-31338 (#3374)Barry Warsaw2017-09-151-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.
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-081-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).
* Expand the PySlice_GetIndicesEx macro. (#1023)Serhiy Storchaka2017-04-081-3/+3
|
* bpo-29116: Fix error messages for concatenating bytes and bytearray with ↵Serhiy Storchaka2017-03-191-1/+1
| | | | unsupported type. (#709)
* bpo-28856: Let %b format for bytes support objects that follow the buffer ↵Xiang Zhang2017-03-141-1/+14
| | | | | | protocol (GH-546)
* bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485)Serhiy Storchaka2017-03-121-2/+2
|
* bpo-29568: Disable any characters between two percents for escaped percent ↵Serhiy Storchaka2017-03-081-10/+10
| | | | "%%" in the format string for classic string formatting. (GH-513)
* bpo-29714: Fix a regression that bytes format may fail when containing zero ↵Xiang Zhang2017-03-061-2/+2
| | | | bytes inside. (GH-499)
* Merge 3.6INADA Naoki2017-01-061-8/+12
|\
| * Issue #29159: Fix regression in bytes(x) when x.__index__() raises Exception.INADA Naoki2017-01-061-8/+12
| |
* | Issue #28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCIISerhiy Storchaka2016-12-191-2/+2
| | | | | | | | whitespace, not only spaces. Patch by Robert Xiao.
* | Issue #29000: Fixed bytes formatting of octals with zero padding in alternateSerhiy Storchaka2016-12-171-3/+2
|\ \ | |/ | | | | form.
| * Issue #29000: Fixed bytes formatting of octals with zero padding in alternateSerhiy Storchaka2016-12-171-3/+2
| |\ | | | | | | | | | form.
| | * Issue #29000: Fixed bytes formatting of octals with zero padding in alternateSerhiy Storchaka2016-12-171-3/+2
| | | | | | | | | | | | form.
| * | Issue 28128: Print out better error/warning messages for invalid string ↵Eric V. Smith2016-10-311-4/+33
| | | | | | | | | | | | escapes. Backport to 3.6.
* | | Use _PyObject_CallNoArg()Victor Stinner2016-12-061-2/+2
| | | | | | | | | | | | | | | | | | | | | Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
* | | Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-3/+4
| | | | | | | | | | | | | | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* | | Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-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.
* | | Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-201-4/+1
| | | | | | | | | | | | functions.
* | | Issue 28128: Print out better error/warning messages for invalid string escapes.Eric V. Smith2016-10-311-4/+33
|/ /
* | Issue #25270: Merge from 3.5Berker Peksag2016-09-161-5/+14
|\ \ | |/
| * Issue #25270: Prevent codecs.escape_encode() from raising SystemError when ↵Berker Peksag2016-09-161-5/+14
| | | | | | | | an empty bytestring is passed
* | Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly ↵Christian Heimes2016-09-131-10/+10
| | | | | | | | optimize memcpy().
* | remove all usage of Py_LOCALBenjamin Peterson2016-09-091-1/+1
| |
* | #27364: Deprecate invalid escape strings in str/byutes.R David Murray2016-09-081-1/+2
| | | | | | | | Patch by Emanuel Barry, reviewed by Serhiy Storchaka and Martin Panter.
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-2/+2
| |
* | Issue #27506: Support bytes/bytearray.translate() delete as keyword argumentMartin Panter2016-08-271-6/+4
| | | | | | | | Patch by Xiang Zhang.
* | Issue #27704: Optimized creating bytes and bytearray from byte-like objectsSerhiy Storchaka2016-08-151-10/+8
| | | | | | | | | | and iterables. Speed up to 3 times for short objects. Original patch by Naoki Inada.
* | Issue #27473: Fixed possible integer overflow in bytes and bytearraySerhiy Storchaka2016-07-101-4/+2
|\ \ | |/ | | | | concatenations. Patch by Xiang Zhang.
| * Issue #27473: Fixed possible integer overflow in bytes and bytearraySerhiy Storchaka2016-07-101-4/+2
| | | | | | | | concatenations. Patch by Xiang Zhang.
* | Issue #27460: Unified error messages in bytes constructor for integersSerhiy Storchaka2016-07-061-2/+2
| | | | | | | | in and out of the Py_ssize_t range. Patch by Xiang Zhang.
* | Backed out changeset b0087e17cd5e (issue #26765)Serhiy Storchaka2016-07-031-11/+71
| | | | | | | | For unknown reasons it perhaps caused a crash on 32-bit Windows (issue #).
* | Issue #26765: Moved wrappers for bytes and bytearray methods to common headerSerhiy Storchaka2016-07-011-71/+11
| | | | | | | | file.
* | Issue #27007: The fromhex() class methods of bytes and bytearray subclassesSerhiy Storchaka2016-07-011-1/+6
| | | | | | | | now return an instance of corresponding subclass.
* | Issue #27125: Merge typo fixes from 3.5Martin Panter2016-05-301-1/+1
|\ \ | |/
| * Issue #27125: Remove duplicated words from documentation and commentsMartin Panter2016-05-301-1/+1
| |
* | Issue #26765: Moved common code for the replace() method of bytes and bytearraySerhiy Storchaka2016-05-051-505/+3
| | | | | | | | to a template file.
* | Issue #26765: Moved common code and docstrings for bytes and bytearray methodsSerhiy Storchaka2016-05-041-336/+26
| | | | | | | | to bytes_methods.c.
* | Got rid of redundand "self" parameter declarations.Serhiy Storchaka2016-05-021-26/+20
| | | | | | | | Argument Clinic is now able to infer all needed information.
* | Issue #25349, #26249: Fix memleak in formatfloat()Victor Stinner2016-04-261-0/+1
| |
* | Issue #26766: Fix _PyBytesWriter_Finish()Victor Stinner2016-04-151-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.
* | Issue #26764: Fixed SystemError in bytes.__rmod__.Serhiy Storchaka2016-04-151-6/+4
| |
* | Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-101-1/+1
|\ \ | |/ | | | | in places where Py_DECREF was used.