Commit Graph

350 Commits

Author SHA1 Message Date
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.
2016-03-30 20:40:02 +03:00
Serhiy Storchaka 5c4064e8bd Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:05:25 +02:00
Benjamin Peterson a30e2256f7 merge 3.4 (#24044) 2015-04-23 17:06:45 -04:00
Benjamin Peterson bd91ee9cd7 merge 3.3 (#24044) 2015-04-23 17:06:33 -04:00
Benjamin Peterson 51454a62e2 merge 3.2 (#24044) 2015-04-23 17:05:07 -04:00
Benjamin Peterson 0823ffb2fb properly handle malloc failure (closes #24044)
Patch by Christian Heimes.
2015-04-23 17:04:36 -04:00
Benjamin Peterson c8fd9ce73d merge 3.4 (#23515) 2015-02-25 10:16:56 -05:00
Benjamin Peterson b808d590a2 fix merge_collapse to actually maintain the invariant it purports to (closes #23515)
See
de Gouw, Stijn and Rot, Jurriaan and de Boer, Frank S and Bubel, Richard and Hähnle, Reiner
"OpenJDK’s java.utils.Collection.sort() is broken: The good, the bad and the worst case"
2015-02-25 10:12:26 -05:00
Terry Jan Reedy ffff1440d1 Issue #22077: Improve index error messages for bytearrays, bytes, lists, and
tuples by adding 'or slices'. Added ', not <typename' for bytearrays.
Original patch by Claudiu Popa.
2014-08-02 01:30:37 -04:00
Benjamin Peterson af9049ebbc merge 3.3 2014-03-15 12:21:47 -05:00
Benjamin Peterson 4a42cd48d5 avoid referencing past the bounds of an array 2014-03-15 12:21:28 -05:00
Benjamin Peterson 1aca78da62 merge 3.3 2014-03-14 21:54:41 -05:00
Benjamin Peterson ef87f8cb57 avoid referencing out-of-bounds memory 2014-03-14 21:54:31 -05:00
Kristján Valur Jónsson 25dded041f Make the various iterators' "setstate" sliently and consistently clip the
index.  This avoids the possibility of setting an iterator to an invalid
state.
2014-03-05 13:47:57 +00:00
Kristján Valur Jónsson c5cc5011ac Make the various iterators' "setstate" sliently and consistently clip the
index.  This avoids the possibility of setting an iterator to an invalid
state.
2014-03-05 15:23:07 +00:00
Victor Stinner 35f2803a24 Close #19578: Fix list_ass_subscript(), handle list_resize() failure
Notify the caller of the failure (MemoryError exception).
2013-11-21 12:16:35 +01:00
Victor Stinner 4a58707a34 Add _PyUnicodeWriter_WriteASCIIString() function 2013-11-19 12:54:53 +01:00
Victor Stinner 4d3f109ad3 Issue #19513: Disable overallocation of the PyUnicodeWriter before the last write 2013-11-19 12:09:00 +01:00
Victor Stinner b8fb197aa0 Issue #19513: Simplify list_repr() 2013-11-18 22:15:44 +01:00
Victor Stinner 5c733473f2 Issue #19513: repr(list) now uses the PyUnicodeWriter API, it is faster than
the PyAccu API
2013-11-18 21:11:57 +01:00
Antoine Pitrou 9ed5f27266 Issue #18722: Remove uses of the "register" keyword in C code. 2013-08-13 20:18:52 +02:00
Victor Stinner 2c40f640d9 Issue #18408: Fix list_ass_slice(), handle list_resize() failure
I tested the patch manually by injecting a fault using gdb: list items are
correctly restored on failure.
2013-07-19 23:06:21 +02:00
Victor Stinner 095d99ffff Issue #18408: Fix listpop(), handle list_ass_slice() failure 2013-07-17 21:58:01 +02:00
Victor Stinner 32fd6eab1e Issue #18408: Fix list.extend(), handle list_resize() failure 2013-07-16 21:45:58 +02:00
Victor Stinner b27cd3e5ad Issue #18408: Fix list.pop() to handle list_resize() failure (MemoryError). 2013-07-08 22:20:44 +02:00
Victor Stinner 7660b880a5 Issue #9566: More long/Py_ssize_t fixes in tuple and list iterators (it_index) 2013-06-24 23:59:24 +02:00
Armin Ronacher aa9a79d279 Issue #16148: implemented PEP 424 2012-10-06 14:03:24 +02:00
David Malcolm 49526f48fc Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues 2012-06-22 14:55:41 -04:00
Antoine Pitrou a701388de1 Rename _PyIter_GetBuiltin to _PyObject_GetBuiltin, and do not include it in the stable ABI. 2012-04-05 00:04:20 +02:00
Kristján Valur Jónsson 31668b8f7a Issue #14288: Serialization support for builtin iterators. 2012-04-03 10:49:41 +00:00
Antoine Pitrou d0acb411ef Issue #14387: Do not include accu.h from Python.h. 2012-03-22 14:42:18 +01:00
Antoine Pitrou 0197ff97d0 Issue #14387: Do not include accu.h from Python.h. 2012-03-22 14:38:16 +01:00
Antoine Pitrou 9a812cbc89 Issue #13389: Full garbage collection passes now clear the freelists for
list and dict objects.  They already cleared other freelists in the
interpreter.
2011-11-15 00:00:12 +01:00
Petri Lehtinen 9589ab1745 Revert "Accept None as start and stop parameters for list.index() and tuple.index()"
Issue #13340.
2011-11-06 21:06:10 +02:00
Petri Lehtinen ebfaabd663 Revert "Accept None as start and stop parameters for list.index() and tuple.index()"
Issue #13340.
2011-11-06 21:02:39 +02:00
Amaury Forgeot d'Arc 864741b2c7 Issue #13350: Replace most usages of PyUnicode_Format by PyUnicode_FromFormat. 2011-11-06 15:10:48 +01:00
Petri Lehtinen 8e9f6c4251 Accept None as start and stop parameters for list.index() and tuple.index().
Closes #13340.
2011-11-05 23:25:34 +02:00
Petri Lehtinen c2f0a46111 Accept None as start and stop parameters for list.index() and tuple.index()
Closes #13340.
2011-11-05 23:24:31 +02:00
Georg Brandl 388349add2 Closes #12192: Document that mutating list methods do not return the instance (original patch by Mike Hoy). 2011-10-08 18:32:40 +02:00
Antoine Pitrou c61c8d7a5e Issue #12911: Fix memory consumption when calculating the repr() of huge tuples or lists.
This introduces a small private API for this common pattern.
The issue has been discovered thanks to Martin's huge-mem buildbot.
2011-10-06 19:04:12 +02:00
Antoine Pitrou eeb7eea1f9 Issue #12911: Fix memory consumption when calculating the repr() of huge tuples or lists.
This introduces a small private API for this common pattern.
The issue has been discovered thanks to Martin's huge-mem buildbot.
2011-10-06 18:57:27 +02:00
Mark Dickinson c7d93b7614 Issue #1621: Fix undefined behaviour from signed overflow in datetime module hashes, array and list iterations, and get_integer (stringlib/string_format.h) 2011-09-25 15:34:32 +01:00
Mark Dickinson 8f53d092f2 Merge issue #12973 list_repeat fix. 2011-09-19 19:19:50 +01:00
Mark Dickinson c0420fd42a Issue #12973: Fix undefined-behaviour-inducing overflow check in list_repeat. 2011-09-19 19:18:37 +01:00
Brian Curtin dfc80e3d97 Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.
The macro was introduced in #12724.
2011-08-10 20:28:54 -05:00
Daniel Stutzbach eda70b81d3 #11335: Fix memory leak after key function failure in sort 2011-05-04 12:46:28 -07:00
Ezio Melotti 3b3499ba69 #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
Ezio Melotti 13925008dc #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 11:05:33 +02:00
Ezio Melotti b88ed1549e #11565: Merge with 3.2. 2011-03-16 11:38:59 +02:00
Daniel Stutzbach 8eda5f7cd9 #11335: Fix memory leak when a sort key function throws an exception 2011-03-02 23:37:50 +00:00