summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Bug #1648179: set.update() not recognizing __iter__ overrides in dict ↵Raymond Hettinger2007-02-011-4/+4
| | | | subclasses.
* If you created a weakref in an object's __del__ method to itself it wouldBrett Cannon2007-01-232-0/+14
| | | | | | | | segfault the interpreter during weakref clean up. Now any new weakrefs created after __del__ is run are removed silently. Fixes bug #1377858 and the weakref_in_del crasher for new-style classes. Classic classes are still affected.
* Backport trunk revision 53527:Thomas Wouters2007-01-231-0/+2
| | | | | | | | | | | | | SF patch #1630975: Fix crash when replacing sys.stdout in sitecustomize When running the interpreter in an environment that would cause it to set stdout/stderr/stdin's encoding, having a sitecustomize that would replace them with something other than PyFile objects would crash the interpreter. Fix it by simply ignoring the encoding-setting for non-files. This could do with a test, but I can think of no maintainable and portable way to test this bug, short of adding a sitecustomize.py to the buildsystem and have it always run with it (hmmm....)
* SF #1486663 -- Allow keyword args in subclasses of set() and frozenset().Raymond Hettinger2007-01-111-2/+2
|
* For sets with cyclical reprs, emit '...' instead of recursing.Raymond Hettinger2006-12-291-4/+24
|
* Backport fixes to set objects:Raymond Hettinger2006-12-081-11/+69
| | | | | | rev 52964 sf 1576657 KeyError unpacks tuple arguments rev 52963 sf 1456209 obscure resizing vulnerability rev 52962 redundant calls to PyObject_Hash()
* Correctly forward exception in instance_contains().Martin v. Löwis2006-11-081-4/+6
| | | | Fixes #1591996. Patch contributed by Neal Norwitz.
* Fix refleakNeal Norwitz2006-10-291-0/+1
|
* Bug #1576657: when setting a KeyError for a tuple key, make sure thatGeorg Brandl2006-10-291-3/+16
| | | | | the tuple isn't used as the "exception arguments tuple". (backport from rev. 52535)
* Backport 52506:Neal Norwitz2006-10-281-1/+2
| | | | Don't inline Py_ADDRESS_IN_RANGE with gcc 4+ either.
* Backport 52505:Neal Norwitz2006-10-281-0/+5
| | | | Prevent crash if alloc of garbage fails. Found by Typo.pl.
* Backport 52502:Neal Norwitz2006-10-282-0/+6
| | | | | Fix warnings with HP's C compiler. It doesn't recognize that infinite loops are, um, infinite. These conditions should not be able to happen.
* WindowsError.str should display the windows error code,Thomas Heller2006-10-271-7/+7
| | | | | | | not the posix error code; with test. Fixes #1576174. Backported from trunk, revision 52485.
* Bug #1545497: when given an explicit base, int() did ignore NULsGeorg Brandl2006-10-121-2/+19
| | | | | embedded in the string to convert. (backport from rev. 52305)
* Forward-port of r52136: a review of overflow-detecting code.Armin Rigo2006-10-048-72/+105
| | | | | | | | | | | | | | | | | | | | | | | * unified the way intobject, longobject and mystrtoul handle values around -sys.maxint-1. * in general, trying to entierely avoid overflows in any computation involving signed ints or longs is extremely involved. Fixed a few simple cases where a compiler might be too clever (but that's all guesswork). * more overflow checks against bad data in marshal.c. * 2.5 specific: fixed a number of places that were still confusing int and Py_ssize_t. Some of them could potentially have caused "real-world" breakage. * list.pop(x): fixing overflow issues on x was messy. I just reverted to PyArg_ParseTuple("n"), which does the right thing. (An obscure test was trying to give a Decimal to list.pop()... doesn't make sense any more IMHO) * trying to write a few tests...
* Fix integer negation and absolute value to not relyMartin v. Löwis2006-10-041-4/+3
| | | | on undefined behaviour of the C compiler anymore.
* Bug #1566800: make sure that EnvironmentError can be called with anyGeorg Brandl2006-09-301-1/+1
| | | | | number of arguments, as was the case in Python 2.4. (backport from rev. 52061)
* Patch #1567691: super() and new.instancemethod() now don't acceptGeorg Brandl2006-09-302-0/+4
| | | | | | keyword arguments any more (previously they accepted them, but didn't use them). (backport from rev. 52058)
* Backport of fix to allow exception instances to be sliced once again.Brett Cannon2006-09-211-1/+8
|
* Remove __unicode__ method so that ``unicode(BaseException)`` succeeds.Brett Cannon2006-09-091-17/+0
| | | | Fixes bug #1551432.
* Backport rev. 51798 from trunk:Georg Brandl2006-09-081-8/+35
| | | | fix setobject.c refcounts and error checks.
* Bug #1542051: Exceptions now correctly call PyObject_GC_UnTrack.Georg Brandl2006-09-061-2/+8
| | | | | | Also make sure that every exception class has __module__ set to 'exceptions'. (backport)
* Backport 51669: Make sure memory is properly cleaned up in file_init (even ↵Neal Norwitz2006-09-051-1/+1
| | | | though this should not be able to happen since we already parsed the args)
* Fix str.rpartition(sep) when sep is not found in str.Neal Norwitz2006-09-053-8/+8
| | | | Partially from SF patch #1551339, but also taken from head.
* Fix SF bug #1546288, crash in dict_equalNeal Norwitz2006-09-051-0/+3
|
* i_divmod(): As discussed on Python-Dev, changed the overflowTim Peters2006-09-051-2/+8
| | | | | checking to live happily with recent gcc optimizations that assume signed integer arithmetic never overflows.
* - Patch #1541585: fix buffer overrun when performing repr() onNeal Norwitz2006-08-211-12/+25
| | | | | | a unicode string in a build with wide unicode (UCS-4) support. I will forward port to 2.6. Can someone backport to 2.4?
* Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-devNeal Norwitz2006-08-211-1/+1
|
* Move initialization of interned strings to before allocating theNeal Norwitz2006-08-191-11/+15
| | | | | | object so we don't leak op. (Fixes an earlier patch to this code) Klockwork #350
* Subclasses of int/long are allowed to define an __index__.Neal Norwitz2006-08-151-4/+2
|
* Fix refleak introduced in rev. 51248.Georg Brandl2006-08-141-1/+3
|
* Correct an accidentally removed previous patch.Marc-André Lemburg2006-08-141-5/+2
|
* Slightly revised version of patch #1538956:Marc-André Lemburg2006-08-143-21/+93
| | | | | | | | | | Replace UnicodeDecodeErrors raised during == and != compares of Unicode and other objects with a new UnicodeWarning. All other comparisons continue to raise exceptions. Exceptions other than UnicodeDecodeErrors are also left untouched.
* Can't return NULL from a void function. If there is a memory error,Neal Norwitz2006-08-141-2/+2
| | | | | about the best we can do is call PyErr_WriteUnraisable and go on. We won't be able to do the call below either, so verify delstr is valid.
* Fix segfault when doing string formatting on subclasses of long ifNeal Norwitz2006-08-131-1/+4
| | | | | | __oct__, __hex__ don't return a string. Klocwork 308
* Handle a whole lot of failures from PyString_FromInternedString().Neal Norwitz2006-08-131-25/+101
| | | | Should fix most of Klocwork 234-272.
* Fix a couple of bugs exposed by the new __index__ code. The 64-bit buildbotsNeal Norwitz2006-08-122-11/+10
| | | | | | | | | | | were failing due to inappropriate clipping of numbers larger than 2**31 with new-style classes. (typeobject.c) In reviewing the code for classic classes, there were 2 problems. Any negative value return could be returned. Always return -1 if there was an error. Also make the checks similar with the new-style classes. I believe this is correct for 32 and 64 bit boxes, including Windows64. Add a test of classic classes too.
* Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz2006-08-1210-130/+125
| | | | | | | 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.
* Check return of PyMem_MALLOC (garbage) is non-NULL.Neal Norwitz2006-08-121-2/+6
| | | | | | Check seq in both portions of if/else. Klocwork #289-290.
* Whoops, how did that get in there. :-) Revert all the parts of 51227 that ↵Neal Norwitz2006-08-121-3/+2
| | | | were not supposed to go it. Only Modules/_ctypes/cfields.c was supposed to be changed
* Check returned pointer is valid.Neal Norwitz2006-08-121-2/+3
| | | | Klocwork #233
* Klocwork made another run and found a bunch more problems.Neal Norwitz2006-08-121-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).
* Fix and test for an infinite C recursion.Armin Rigo2006-08-091-1/+1
|
* __hash__ may now return long int; the final hashMartin v. Löwis2006-08-092-6/+7
| | | | | value is obtained by invoking hash on the long int. Fixes #1536021.
* memcmp() can return values other than -1, 0, and +1 but tp_compareThomas Heller2006-08-081-1/+1
| | | | must not.
* Remove "non-mapping" and "non-sequence" from TypeErrors raised byGeorg Brandl2006-08-081-2/+2
| | | | | | | PyMapping_Size and PySequence_Size. Because len() tries first sequence, then mapping size, it will always raise a "non-mapping object has no len" error which is confusing.
* Typo fixesAndrew M. Kuchling2006-08-042-2/+2
|
* Change fix for segfaulting property(), add a NEWS entry and a test.Georg Brandl2006-08-041-10/+12
|
* Fix bug caused by first decrefing, then increfing.Georg Brandl2006-08-041-5/+4
|
* SF patch #1534048 (bug #1531003): fix typo in error messageFred Drake2006-08-041-1/+1
|