Serhiy Storchaka
783bed4c8d
[3.7] bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264). (GH-12322)
...
(cherry picked from commit d53fe5f407
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-03-14 10:47:27 +02:00
Miss Islington (bot)
cbc7c2c791
bpo-35552: Fix reading past the end in PyUnicode_FromFormat() and PyBytes_FromFormat(). (GH-11276)
...
Format characters "%s" and "%V" in PyUnicode_FromFormat() and "%s" in PyBytes_FromFormat()
no longer read memory past the limit if precision is specified.
(cherry picked from commit d586ccb04f
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-01-12 00:52:55 -08:00
Miss Islington (bot)
d39c192559
bpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)
...
Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat()
with empty result.
(cherry picked from commit 44cc4822bb
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-01-11 23:40:09 -08:00
Miss Islington (bot)
7f34d55023
bpo-34973: Fix crash in bytes constructor. (GH-9841)
...
Constructing bytes from mutating list could cause a crash.
(cherry picked from commit 914f9a078f
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-21 05:55:52 -07:00
Miss Islington (bot)
1370832af2
bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). (GH-9852)
...
bytes and bytearray constructors converted unexpected exceptions
(e.g. MemoryError and KeyboardInterrupt) to TypeError.
(cherry picked from commit e890421e33
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-14 14:26:28 -07:00
Miss Islington (bot)
063755c201
bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683)
...
formatfloat() was not checking if PyBytes_FromStringAndSize()
failed, which could lead to a null pointer dereference in
_PyBytes_FormatEx().
(cherry picked from commit 96c5932794
)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-02 23:33:42 -07:00
Miss Islington (bot)
042082692b
bpo-34436: Fix check that disables overallocation for the last fmt specifier (GH-8826)
...
Reported by Svace static analyzer.
(cherry picked from commit ccd9975267
)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-08-23 04:03:02 -04:00
INADA Naoki
a49ac99029
bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342)
2018-01-27 14:06:21 +09:00
stratakis
e8b1965639
bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793)
2017-11-02 20:32:54 +10:00
Serhiy Storchaka
a2314283ff
bpo-20047: Make bytearray methods partition() and rpartition() rejecting ( #4158 )
...
separators that are not bytes-like objects.
2017-10-29 02:11:54 +03:00
Serhiy Storchaka
56cb465cc9
bpo-31825: Fixed OverflowError in the 'unicode-escape' codec ( #4058 )
...
and in codecs.escape_decode() when decode an escaped non-ascii byte.
2017-10-20 17:08:15 +03:00
Barry Warsaw
b2e5794870
bpo-31338 ( #3374 )
...
* 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-14 18:13:16 -07:00
Eric Snow
2ebc5ce42a
bpo-30860: Consolidate stateful runtime globals. ( #3397 )
...
* 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-09-07 23:51:28 -06:00
Serhiy Storchaka
b879fe82e7
Expand the PySlice_GetIndicesEx macro. ( #1023 )
2017-04-08 09:53:51 +03:00
Serhiy Storchaka
6b5a9ec478
bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. ( #709 )
2017-03-19 19:47:02 +02:00
Xiang Zhang
7e2a54cdd9
bpo-28856: Let %b format for bytes support objects that follow the buffer protocol (GH-546)
2017-03-14 15:07:15 +08:00
Serhiy Storchaka
202fda55c2
bpo-24037: Add Argument Clinic converter `bool(accept={int})`. ( #485 )
2017-03-12 10:10:47 +02:00
Serhiy Storchaka
9f8ad3f39e
bpo-29568: Disable any characters between two percents for escaped percent "%%" in the format string for classic string formatting. (GH-513)
2017-03-08 11:51:19 +08:00
Xiang Zhang
b76ad5121e
bpo-29714: Fix a regression that bytes format may fail when containing zero bytes inside. (GH-499)
2017-03-06 17:17:05 +08:00
INADA Naoki
7ed28a8914
Merge 3.6
2017-01-06 17:44:43 +09:00
INADA Naoki
a634e23209
Issue #29159 : Fix regression in bytes(x) when x.__index__() raises Exception.
2017-01-06 17:32:01 +09:00
Serhiy Storchaka
dd1da7f74a
Issue #28927 : bytes.fromhex() and bytearray.fromhex() now ignore all ASCII
...
whitespace, not only spaces. Patch by Robert Xiao.
2016-12-19 18:51:37 +02:00
Serhiy Storchaka
9d16b616d5
Issue #29000 : Fixed bytes formatting of octals with zero padding in alternate
...
form.
2016-12-17 22:15:10 +02:00
Serhiy Storchaka
025f8953f1
Issue #29000 : Fixed bytes formatting of octals with zero padding in alternate
...
form.
2016-12-17 22:13:05 +02:00
Serhiy Storchaka
b1a1619bf0
Issue #29000 : Fixed bytes formatting of octals with zero padding in alternate
...
form.
2016-12-17 21:48:03 +02:00
Victor Stinner
f17c3de263
Use _PyObject_CallNoArg()
...
Replace:
PyObject_CallFunctionObjArgs(callable, NULL)
with:
_PyObject_CallNoArg(callable)
2016-12-06 18:46:19 +01:00
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().
2016-12-04 22:59:09 +01:00
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 .
2016-12-01 14:43:22 +01:00
Serhiy Storchaka
460bd0d284
Issue #19569 : Compiler warnings are now emitted if use most of deprecated
...
functions.
2016-11-20 12:16:46 +02:00
Eric V. Smith
5646648678
Issue 28128: Print out better error/warning messages for invalid string escapes. Backport to 3.6.
2016-10-31 14:46:26 -04:00
Eric V. Smith
42454af094
Issue 28128: Print out better error/warning messages for invalid string escapes.
2016-10-31 09:22:08 -04:00
Berker Peksag
7b4bcd2004
Issue #25270 : Merge from 3.5
2016-09-16 17:32:06 +03:00
Berker Peksag
4a72a7b6c4
Issue #25270 : Prevent codecs.escape_encode() from raising SystemError when an empty bytestring is passed
2016-09-16 17:31:06 +03:00
Christian Heimes
f051e43b22
Issue #28126 : Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
2016-09-13 20:22:02 +02:00
Benjamin Peterson
621b430a14
remove all usage of Py_LOCAL
2016-09-09 13:54:34 -07:00
R David Murray
110b6fecbb
#27364 : Deprecate invalid escape strings in str/byutes.
...
Patch by Emanuel Barry, reviewed by Serhiy Storchaka and Martin Panter.
2016-09-08 15:34:08 -04:00
Raymond Hettinger
15f44ab043
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
2016-08-30 10:47:49 -07:00
Martin Panter
1b6c6da85d
Issue #27506 : Support bytes/bytearray.translate() delete as keyword argument
...
Patch by Xiang Zhang.
2016-08-27 08:35:02 +00:00
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.
2016-08-15 09:46:07 +03:00
Serhiy Storchaka
ca0da9b0a3
Issue #27473 : Fixed possible integer overflow in bytes and bytearray
...
concatenations. Patch by Xiang Zhang.
2016-07-10 20:51:35 +03:00
Serhiy Storchaka
06cfb0cd70
Issue #27473 : Fixed possible integer overflow in bytes and bytearray
...
concatenations. Patch by Xiang Zhang.
2016-07-10 20:48:43 +03:00
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.
2016-07-06 21:39:44 +03:00
Serhiy Storchaka
e09132f2c7
Backed out changeset b0087e17cd5e (issue #26765 )
...
For unknown reasons it perhaps caused a crash on 32-bit Windows (issue #).
2016-07-03 13:57:48 +03:00
Serhiy Storchaka
355048970b
Issue #26765 : Moved wrappers for bytes and bytearray methods to common header
...
file.
2016-07-01 17:57:30 +03:00
Serhiy Storchaka
0855e706aa
Issue #27007 : The fromhex() class methods of bytes and bytearray subclasses
...
now return an instance of corresponding subclass.
2016-07-01 17:22:31 +03:00
Martin Panter
e514093a2f
Issue #27125 : Merge typo fixes from 3.5
2016-05-30 05:24:49 +00:00
Martin Panter
a90a4a9651
Issue #27125 : Remove duplicated words from documentation and comments
2016-05-30 04:04:50 +00:00
Serhiy Storchaka
fb81d3cbe7
Issue #26765 : Moved common code for the replace() method of bytes and bytearray
...
to a template file.
2016-05-05 09:26:07 +03:00
Serhiy Storchaka
dd40fc3e57
Issue #26765 : Moved common code and docstrings for bytes and bytearray methods
...
to bytes_methods.c.
2016-05-04 22:23:26 +03:00
Serhiy Storchaka
7a9579c0ce
Got rid of redundand "self" parameter declarations.
...
Argument Clinic is now able to infer all needed information.
2016-05-02 13:45:20 +03:00