summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Another problem reported by Coverity. Backport candidate.Neal Norwitz2006-06-301-0/+2
|
* Fix refleakNeal Norwitz2006-06-231-1/+3
|
* Fix for an obscure bug introduced by revs 46806 and 46808, with a test.Armin Rigo2006-06-212-11/+10
| | | | | | | | | | | | | | The problem of checking too eagerly for recursive calls is the following: if a RuntimeError is caused by recursion, and if code needs to normalize it immediately (as in the 2nd test), then PyErr_NormalizeException() needs a call to the RuntimeError class to instantiate it, and this hits the recursion limit again... causing PyErr_NormalizeException() to never finish. Moved this particular recursion check to slot_tp_call(), which is not involved in instantiating built-in exceptions. Backport candidate.
* Use Py_ssize_tNeal Norwitz2006-06-191-22/+22
|
* Patch #1507676: improve exception messages in abstract.c, object.c and ↵Georg Brandl2006-06-183-64/+81
| | | | typeobject.c.
* Patch #1455898: Incremental mode for "mbcs" codec.Martin v. Löwis2006-06-141-39/+175
|
* If a classic class defined a __coerce__() method that just returned its twoBrett Cannon2006-06-131-0/+3
| | | | | | | | arguments in reverse, the interpreter would infinitely recourse trying to get a coercion that worked. So put in a recursion check after a coercion is made and the next call to attempt to use the coerced values. Fixes bug #992017 and closes crashers/coerce.py .
* Initialize the type object so pychecker can't crash the interpreter.Neal Norwitz2006-06-131-0/+2
|
* Fix the CRT argument error handling for VisualStudio .NET 2005. Install a ↵Kristján Valur Jónsson2006-06-122-1/+38
| | | | | | CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL. This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
* Get rid of f_restricted too. Doc the other 4 ints that were already removedNeal Norwitz2006-06-121-2/+7
| | | | at the NeedForSpeed sprint.
* Don't leak the list object if there's an error allocating the item storage. ↵Neal Norwitz2006-06-121-1/+3
| | | | Backport candidate
* f_code can't be NULL based on Frame_New and other code that derefs it.Neal Norwitz2006-06-111-2/+2
| | | | So there doesn't seem to be much point to checking here.
* Update doc to make it agree with code.Neal Norwitz2006-06-111-10/+4
| | | | Bottom factor out some common code.
* Suppress warning on MacOSX about possible use before set of proc.Skip Montanaro2006-06-101-1/+1
|
* Patch #1495999: Part two of Windows CE changes.Martin v. Löwis2006-06-101-2/+2
| | | | | | - update header checks, using autoconf - provide dummies for getenv, environ, and GetVersion - adjust MSC_VER check in socketmodule.c
* SF bug #1503294.Armin Rigo2006-06-101-1/+1
| | | | PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
* Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.Georg Brandl2006-06-102-4/+4
| | | | Also improve error message on overflow.
* Fix bug introduced in rev. 46806 by not having variable declaration at the ↵Brett Cannon2006-06-091-2/+4
| | | | top of a block.
* An object with __call__ as an attribute, when called, will have that ↵Brett Cannon2006-06-091-0/+8
| | | | | | attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion. Closes bug #532646, again. Will be backported.
* RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as ↵Georg Brandl2006-06-092-80/+140
| | | | first argument.
* Fix inconsistency in naming within an enum.Brett Cannon2006-06-091-12/+12
|
* Buffer objects would return the read or write buffer for a wrapped object whenBrett Cannon2006-06-081-22/+71
| | | | | | | | | 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).
* Bug #1502805: don't alias file.__exit__ to file.close since theGeorg Brandl2006-06-081-1/+18
| | | | latter can return something that's true.
* (arre, arigo) SF bug #1350060Armin Rigo2006-06-082-10/+33
| | | | | | Give a consistent behavior for comparison and hashing of method objects (both user- and built-in methods). Now compares the 'self' recursively. The hash was already asking for the hash of 'self'.
* Fix coding style guide bug.Brett Cannon2006-06-061-1/+2
|
* Repair refleaks in unicodeobject.Georg Brandl2006-06-041-0/+3
|
* Patch #1359618: Speed-up charmap encoder.Martin v. Löwis2006-06-041-49/+285
|
* SF #1499797, Fix for memory leak in WindowsError_strNeal Norwitz2006-06-041-1/+0
|
* _PyObject_DebugMalloc(): The return value should addTim Peters2006-06-041-1/+1
| | | | | 2*sizeof(size_t) now, not 8. This probably accounts for current disasters on the 64-bit buildbot slaves.
* In a PYMALLOC_DEBUG build obmalloc adds extra debugging infoTim Peters2006-06-041-116/+124
| | | | | | | | | | | | | | | | | to each allocated block. This was using 4 bytes for each such piece of info regardless of platform. This didn't really matter before (proof: no bug reports, and the debug-build obmalloc would have assert-failed if it was ever asked for a chunk of memory >= 2**32 bytes), since container indices were plain ints. But after the Py_ssize_t changes, it's at least theoretically possible to allocate a list or string whose guts exceed 2**32 bytes, and the PYMALLOC_DEBUG routines would fail then (having only 4 bytes to record the originally requested size). Now we use sizeof(size_t) bytes for each of a PYMALLOC_DEBUG build's extra debugging fields. This won't make any difference on 32-bit boxes, but will add 16 bytes to each allocation in a debug build on a 64-bit box.
* Fix memory leak found by valgrind.Neal Norwitz2006-06-021-1/+0
|
* Armin committed his patch while I was reviewing it (I'm sureTim Peters2006-06-011-28/+40
| | | | | | | | he didn't know this), so merged in some changes I made during review. Nothing material apart from changing a new `mask` local from int to Py_ssize_t. Mostly this is repairing comments that were made incorrect, and adding new comments. Also a few minor code rewrites for clarity or helpful succinctness.
* [ 1497053 ] Let dicts propagate the exceptions in user __eq__().Armin Rigo2006-06-011-50/+107
| | | | [ 1456209 ] dictresize() vulnerability ( <- backport candidate ).
* Correctly allocate complex types with tp_alloc. (bug #1498638)Georg Brandl2006-06-011-2/+2
|
* Correctly unpickle 2.4 exceptions via __setstate__ (patch #1498571)Georg Brandl2006-06-011-0/+24
|
* Remove ; at end of macro. There was a compiler recently that warnedNeal Norwitz2006-06-011-1/+1
| | | | | about extra semi-colons. It may have been the HP C compiler. This file will trigger a bunch of those warnings now.
* changed count to return 0 for slices outside the source stringFredrik Lundh2006-05-301-1/+1
|
* changed find/rfind to return -1 for matches outside the source stringFredrik Lundh2006-05-301-10/+11
|
* PyLong_FromString(): Continued fraction analysis (explained inTim Peters2006-05-301-3/+74
| | | | | | | | | | | | a new comment) suggests there are almost certainly large input integers in all non-binary input bases for which one Python digit too few is initally allocated to hold the final result. Instead of assert-failing when that happens, allocate more space. Alas, I estimate it would take a few days to find a specific such case, so this isn't backed up by a new test (not to mention that such a case may take hours to run, since conversion time is quadratic in the number of digits, and preliminary attempts suggested that the smallest such inputs contain at least a million digits).
* Do the check for no keyword arguments in __init__ so thatGeorg Brandl2006-05-301-3/+3
| | | | subclasses of Exception can be supplied keyword args
* Disallow keyword args for exceptions.Georg Brandl2006-05-301-0/+3
|
* Add a test case for exception pickling. args is never NULL.Georg Brandl2006-05-301-11/+8
|
* Restore exception pickle support. #1497319.Georg Brandl2006-05-301-1/+11
|
* dict_print(): So that Neal & I don't spend the rest ofTim Peters2006-05-301-4/+5
| | | | | | our lives taking turns rewriting code that works ;-), get rid of casting illusions by declaring a new variable with the obvious type.
* dict_print(): Explicitly narrow the return valueTim Peters2006-05-301-1/+1
| | | | from a (possibly) wider variable.
* No DOWNCAST is required since sizeof(Py_ssize_t) >= sizeof(int) and ↵Neal Norwitz2006-05-301-1/+1
| | | | Py_ReprEntr returns an int
* Use Py_SAFE_DOWNCAST for safety. Fix format strings. Remove 2 more stray | ↵Neal Norwitz2006-05-301-6/+6
| | | | in comment
* Remove stray | in commentNeal Norwitz2006-05-301-1/+1
|
* Convert relevant dict internals to Py_ssize_t.Tim Peters2006-05-301-43/+55
| | | | | | I don't have a box with nearly enough RAM, or an OS, that could get close to tickling this, though (requires a dict w/ at least 2**31 entries).
* fixed "abc".count("", 100) == -96 error (hopefully, nobody's relying onFredrik Lundh2006-05-291-1/+4
| | | | the current behaviour ;-)