Serhiy Storchaka
6b5a9ec478
bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. ( #709 )
9 years ago
Xiang Zhang
7e2a54cdd9
bpo-28856: Let %b format for bytes support objects that follow the buffer protocol (GH-546)
9 years ago
Serhiy Storchaka
202fda55c2
bpo-24037: Add Argument Clinic converter `bool(accept={int})`. ( #485 )
9 years ago
Serhiy Storchaka
9f8ad3f39e
bpo-29568: Disable any characters between two percents for escaped percent "%%" in the format string for classic string formatting. (GH-513)
9 years ago
Xiang Zhang
b76ad5121e
bpo-29714: Fix a regression that bytes format may fail when containing zero bytes inside. (GH-499)
9 years ago
INADA Naoki
a634e23209
Issue #29159 : Fix regression in bytes(x) when x.__index__() raises Exception.
9 years ago
Serhiy Storchaka
dd1da7f74a
Issue #28927 : bytes.fromhex() and bytearray.fromhex() now ignore all ASCII
whitespace, not only spaces. Patch by Robert Xiao.
9 years ago
Serhiy Storchaka
b1a1619bf0
Issue #29000 : Fixed bytes formatting of octals with zero padding in alternate
form.
9 years ago
Victor Stinner
f17c3de263
Use _PyObject_CallNoArg()
Replace:
PyObject_CallFunctionObjArgs(callable, NULL)
with:
_PyObject_CallNoArg(callable)
9 years ago
Victor Stinner
de4ae3d486
Backed out changeset b9c9691c72c5
Issue #28858 : The change b9c9691c72c5 introduced a regression. It seems like
_PyObject_CallArg1() uses more stack memory than
PyObject_CallFunctionObjArgs().
9 years ago
Victor Stinner
27580c1fb5
Replace PyObject_CallFunctionObjArgs() with fastcall
* 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 .
9 years ago
Serhiy Storchaka
460bd0d284
Issue #19569 : Compiler warnings are now emitted if use most of deprecated
functions.
9 years ago
Eric V. Smith
5646648678
Issue 28128: Print out better error/warning messages for invalid string escapes. Backport to 3.6.
9 years ago
Eric V. Smith
42454af094
Issue 28128: Print out better error/warning messages for invalid string escapes.
9 years ago
Berker Peksag
4a72a7b6c4
Issue #25270 : Prevent codecs.escape_encode() from raising SystemError when an empty bytestring is passed
9 years ago
Christian Heimes
f051e43b22
Issue #28126 : Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
9 years ago
Benjamin Peterson
621b430a14
remove all usage of Py_LOCAL
9 years ago
R David Murray
110b6fecbb
#27364 : Deprecate invalid escape strings in str/byutes.
Patch by Emanuel Barry, reviewed by Serhiy Storchaka and Martin Panter.
9 years ago
Raymond Hettinger
15f44ab043
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
9 years ago
Martin Panter
1b6c6da85d
Issue #27506 : Support bytes/bytearray.translate() delete as keyword argument
Patch by Xiang Zhang.
9 years ago
Serhiy Storchaka
eb24988962
Issue #27704 : Optimized creating bytes and bytearray from byte-like objects
and iterables. Speed up to 3 times for short objects. Original patch by
Naoki Inada.
10 years ago
Serhiy Storchaka
06cfb0cd70
Issue #27473 : Fixed possible integer overflow in bytes and bytearray
concatenations. Patch by Xiang Zhang.
10 years ago
Serhiy Storchaka
f54d7811c3
Issue #27460 : Unified error messages in bytes constructor for integers
in and out of the Py_ssize_t range. Patch by Xiang Zhang.
10 years ago
Serhiy Storchaka
e09132f2c7
Backed out changeset b0087e17cd5e (issue #26765 )
For unknown reasons it perhaps caused a crash on 32-bit Windows (issue #).
10 years ago
Serhiy Storchaka
355048970b
Issue #26765 : Moved wrappers for bytes and bytearray methods to common header
file.
10 years ago
Serhiy Storchaka
0855e706aa
Issue #27007 : The fromhex() class methods of bytes and bytearray subclasses
now return an instance of corresponding subclass.
10 years ago
Martin Panter
a90a4a9651
Issue #27125 : Remove duplicated words from documentation and comments
10 years ago
Serhiy Storchaka
fb81d3cbe7
Issue #26765 : Moved common code for the replace() method of bytes and bytearray
to a template file.
10 years ago
Serhiy Storchaka
dd40fc3e57
Issue #26765 : Moved common code and docstrings for bytes and bytearray methods
to bytes_methods.c.
10 years ago
Serhiy Storchaka
7a9579c0ce
Got rid of redundand "self" parameter declarations.
Argument Clinic is now able to infer all needed information.
10 years ago
Victor Stinner
71dc3d878a
Issue #25349 , #26249 : Fix memleak in formatfloat()
10 years ago
Victor Stinner
e914d41312
Issue #26766 : Fix _PyBytesWriter_Finish()
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.
10 years ago
Serhiy Storchaka
c9a59e6e4f
Issue #26764 : Fixed SystemError in bytes.__rmod__.
10 years ago
Serhiy Storchaka
57a01d3a0e
Issue #26200 : Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
10 years ago
Serhiy Storchaka
03f17f8671
Issue #17339 : Improved TypeError message in bytes constructor.
10 years ago
Serhiy Storchaka
48842714b9
Issue #22570 : Renamed Py_SETREF to Py_XSETREF.
10 years ago
Serhiy Storchaka
fbb1c5ee06
Issue #26494 : Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
10 years ago
Victor Stinner
fac395681f
Optimize bytes.replace(b'', b'.')
Issue #26574 : Optimize bytes.replace(b'', b'.') and
bytearray.replace(b'', b'.'): up to 80% faster. Patch written by Josh Snider.
10 years ago
Serhiy Storchaka
ef1585eb9a
Issue #25923 : Added more const qualifiers to signatures of static and private functions.
10 years ago
Serhiy Storchaka
5a57ade58e
Issue #20440 : Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
10 years ago
Serhiy Storchaka
5aac3ed799
Issue #25766 : Special method __bytes__() now works in str subclasses.
10 years ago
Serhiy Storchaka
15095800a3
Issue #24731 : Fixed crash on converting objects with special methods
__bytes__, __trunc__, and __float__ returning instances of subclasses of
bytes, int, and float to subclasses of bytes, int, and float correspondingly.
10 years ago
Serhiy Storchaka
413fdcea21
Issue #24821 : Refactor STRINGLIB(fastsearch_memchr_1char) and split it on
STRINGLIB(find_char) and STRINGLIB(rfind_char) that can be used independedly
without special preconditions.
10 years ago
Victor Stinner
c3d2bc19e4
Use _PyBytesWriter in _PyBytes_FromIterator()
10 years ago
Victor Stinner
c5c3ba4bec
Add _PyBytesWriter_Resize() function
This function gives a control to the buffer size without using min_size.
10 years ago
Victor Stinner
3c50ce39bf
Factorize _PyBytes_FromList() and _PyBytes_FromTuple() code using a C macro
10 years ago
Victor Stinner
f2eafa323b
Split PyBytes_FromObject() into subfunctions
10 years ago
Victor Stinner
2ec8063cc9
Modify _PyBytes_DecodeEscapeRecode() to use _PyBytesAPI
* Don't overallocate by 400% when recode is needed: only overallocate on demand
using _PyBytesWriter.
* Use _PyLong_DigitValue to convert hexadecimal digit to int
* Create _PyBytes_DecodeEscapeRecode() subfunction
10 years ago
Victor Stinner
f6358a7e4c
_PyBytesWriter_Alloc(): only use 10 bytes of the small buffer in debug mode to
enhance code to detect buffer under- and overflow.
10 years ago
Victor Stinner
2bf8993db9
Optimize bytes.fromhex() and bytearray.fromhex()
Issue #25401 : Optimize bytes.fromhex() and bytearray.fromhex(): they are now
between 2x and 3.5x faster. Changes:
* Use a fast-path working on a char* string for ASCII string
* Use a slow-path for non-ASCII string
* Replace slow hex_digit_to_int() function with a O(1) lookup in
_PyLong_DigitValue precomputed table
* Use _PyBytesWriter API to handle the buffer
* Add unit tests to check the error position in error messages
10 years ago