summaryrefslogtreecommitdiff
path: root/Modules/arraymodule.c
AgeCommit message (Collapse)AuthorLines
2018-12-19[2.7] bpo-35441: Remove dead and buggy code related to PyList_SetItem(). ↵Serhiy Storchaka-2/+15
(GH-11033) (GH-11234) In _localemodule.c and selectmodule.c, remove dead code that would cause double decrefs if run. In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases where a new list is populated and there is no possibility of an error. In addition, check if the list changed size in the loop in array_array_fromlist(). (cherry picked from commit 99d56b53560b3867844472ae381fb3f858760621) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2017-09-13consistently use Py_TYPE, Py_REFCNT, and correct initializer macros (#3563)Benjamin Peterson-6/+6
This no-op change makes 2.7 more consistent with 3.x to ease comparison and backports.
2017-04-15bpo-30074: Fix compile warnings of _PySlice_Unpack and convert missed (#1154)Serhiy Storchaka-2/+2
PySlice_GetIndicesEx in _ctypes.c.
2017-04-08bpo-27867: Expand the PySlice_GetIndicesEx macro. (#1023) (#1046)Serhiy Storchaka-5/+6
(cherry picked from commit b879fe8)
2016-09-07Issue #27570: Avoid zero-length memcpy() calls with null source pointersMartin Panter-7/+17
2016-06-24array.buffer_info() should return a length as int, not long, for compatibility.Serhiy Storchaka-1/+1
2016-06-24Fixed integer overflow and handled MemoryError in array.buffer_info().Serhiy Storchaka-3/+15
2015-12-19Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka-1/+1
This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
2015-07-26Issue #24613: Calling array.fromstring() with self is no longer allowedSerhiy Storchaka-0/+5
to prevent the use-after-free error. Patch by John Leitch.
2015-05-31Fixed the array module in unicode disabled build (regression of issue20014).Serhiy Storchaka-0/+2
2015-05-16Issue #20014: array.array() now accepts unicode typecodes. Based on patch bySerhiy Storchaka-3/+15
Vajrasky Kok.
2012-08-10Issue #15424: Add a __sizeof__ implementation for array objects.Meador Inge-0/+15
Patch by Ludwig Hähne.
2011-12-09Fix docstring typo.Florent Xicluna-1/+1
2011-01-11Reverted r87944 - issue #5109 should not have been backportedAlexander Belopolsky-16/+5
2011-01-11Merged revisions 87942 via svnmerge fromAlexander Belopolsky-5/+16
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87942 | alexander.belopolsky | 2011-01-11 16:44:00 -0500 (Tue, 11 Jan 2011) | 3 lines Issue #5109: array.array constructor will now use fast code when initial data is provided in an array object with correct type. ........
2010-08-06Merged revisions 83751-83752 via svnmerge fromMark Dickinson-2/+2
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83751 | mark.dickinson | 2010-08-06 10:36:57 +0100 (Fri, 06 Aug 2010) | 1 line Issue #9526: Remove outdated casts to int that were preventing the array module from working correctly with arrays > 2GB. ........ r83752 | mark.dickinson | 2010-08-06 10:38:58 +0100 (Fri, 06 Aug 2010) | 1 line Misc/NEWS entry for r83751. ........
2010-07-21Merged revisions 83030 via svnmerge fromAntoine Pitrou-2/+8
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83030 | antoine.pitrou | 2010-07-21 18:41:31 +0200 (mer., 21 juil. 2010) | 5 lines Issue #5395: check that array.fromfile() re-raises an IOError instead of replacing it with EOFError. (this is only an added test, but 2.x will get a fix too) ........
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-1473/+1473
2010-02-14Silence more 'comparison between signed and unsigned' warnings.Mark Dickinson-2/+2
2010-01-29Issue #7788: Fix a crash produced by deleting a list slice with hugeMark Dickinson-2/+3
step value. Patch by Marcin Bachry.
2009-07-15Issue #2389: Pickle array objects using a list representation for portabilityAlexandre Vassalotti-35/+33
across different machine architectures and compatibility with Python 3.x.
2009-02-21Issue #5341: Fix a variety of spelling errors.Mark Dickinson-6/+6
2008-07-22Issue #2620: Overflow checking when allocating or reallocating memoryGregory P. Smith-1/+4
was not always being done properly in some python types and extension modules. PyMem_MALLOC, PyMem_REALLOC, PyMem_NEW and PyMem_RESIZE have all been updated to perform better checks and places in the code that would previously leak memory on the error path when such an allocation failed have been fixed.
2008-06-13Make more symbols static.Martin v. Löwis-1/+1
2008-06-13Fix some memory dealloc problems when exceptions occur.Neal Norwitz-8/+7
It caused: "Fatal Python error: UNREF invalid object" in the DoubleTest.
2008-06-11Merge in release25-maint r60793:Gregory P. Smith-1/+37
Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-9/+9
http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
2008-05-26Renamed PyString to PyBytesChristian Heimes-9/+9
2008-04-27A little reformating of Py3k warningsBenjamin Peterson-2/+2
2008-04-27Use PyErr_WarnPy3k throughoutBenjamin Peterson-8/+4
2008-03-25#2359: add Py3k warning for array.read/array.write.Georg Brandl-2/+26
2007-12-19#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes-120/+120
Py_REFCNT. Macros for b/w compatibility are available.
2007-08-28Improve extended slicing support in builtin types and classes. Specifically:Thomas Wouters-91/+135
- Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case. - Specialcase step-1 extended slices to optimize the common case for all involved types. - For lists, allow extended slice assignment of differing lengths as long as the step is 1. (Previously, 'l[:2:1] = []' failed even though 'l[:2] = []' and 'l[:2:None] = []' do not.) - Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString. - Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString. - Add tests for all new functionality.
2007-07-21PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis-120/+118
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
2007-04-02Array module's buffer interface can now handle empty arrays.Raymond Hettinger-0/+6
2007-04-02SF #1693079: Cannot save empty array in shelveRaymond Hettinger-6/+13
2007-01-21Bug #1486663: don't reject keyword arguments for subclasses of builtinGeorg Brandl-1/+1
types.
2006-08-24Fix SF bug #1545837: array.array borks on deepcopy.Thomas Wouters-1/+1
array.__deepcopy__() needs to take an argument, even if it doesn't actually use it. Will backport to 2.5 and 2.4 (if applicable.)
2006-08-12Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz-8/+4
I modified this patch some by fixing style, some error checking, and adding XXX comments. This patch requires review and some changes are to be expected. I'm checking in now to get the greatest possible review and establish a baseline for moving forward. I don't want this to hold up release if possible.
2006-08-12Klocwork made another run and found a bunch more problems.Neal Norwitz-0/+4
This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
2006-06-10Patch #1495999: Part two of Windows CE changes.Martin v. Löwis-2/+2
- update header checks, using autoconf - provide dummies for getenv, environ, and GetVersion - adjust MSC_VER check in socketmodule.c
2006-06-08Buffer objects would return the read or write buffer for a wrapped object whenBrett Cannon-0/+1
the char buffer was requested. Now it actually returns the char buffer if available or raises a TypeError if it isn't (as is raised for the other buffer types if they are not present but requested). Not a backport candidate since it does change semantics of the buffer object (although it could be argued this is enough of a bug to bother backporting).
2006-05-26Support for buffer protocol for socket and struct.Martin Blais-3/+3
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer protocol (send and sendto already did). * Added struct.pack_to(), that is the corresponding buffer compatible method to unpack_from(). * Fixed minor typos in arraymodule.
2006-04-18C++ compiler cleanup: a cast here, a cast there... still does not compile ↵Skip Montanaro-3/+4
under C++ though...
2006-04-15Use Py_VISIT in all tp_traverse methods, instead of traversing manually orThomas Wouters-2/+1
using a custom, nearly-identical macro. This probably changes how some of these functions are compiled, which may result in fractionally slower (or faster) execution. Considering the nature of traversal, visiting much of the address space in unpredictable patterns, I'd argue the code readability and maintainability is well worth it ;P
2006-04-03Whitespace: break long lineNeal Norwitz-1/+2
2006-03-07Checking in the code for PEP 357.Guido van Rossum-18/+11
This was mostly written by Travis Oliphant. I've inspected it all; Neal Norwitz and MvL have also looked at it (in an earlier incarnation).
2006-03-07SF #1444030: Fix several potential defects found by Coverity.Hye-Shik Chang-4/+7
(reviewed by Neal Norwitz)
2006-02-27Convert array.array.insert to use Py_ssize_t (like the rest already does.)Thomas Wouters-2/+2
2006-02-17Bug #1432350: arrayobject should use PyObject_VAR_HEADGeorg Brandl-2/+1