summaryrefslogtreecommitdiff
path: root/Objects
AgeCommit message (Collapse)AuthorLines
2008-03-02Backport of r61180:Martin v. Löwis-2/+15
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.
2006-10-23patch for PSF-2006-001.Anthony Baxter-12/+25
2004-10-31SF 1055820: weakref callback vs gc vs threadsTim Peters-1/+3
In cyclic gc, clear all weakrefs to unreachable objects before allowing any Python code (weakref callbacks or __del__ methods) to run. This is a critical bugfix, affecting all versions of Python since weakrefs were introduced.
2004-08-18Patch #980082: Missing INCREF in PyType_Ready.Martin v. Löwis-1/+3
2004-08-03Be more careful about maintaining the invariants; it was actuallyFred Drake-3/+25
possible that the callback-less flavors of the ref or proxy could have been added during GC, so we don't want to replace them.
2004-06-25Fix leak found by Eric Huss.Raymond Hettinger-1/+6
2004-06-11Backport:Anthony Baxter-0/+4
Fix for bug #966623 - classes created with type() in an exec(, {}) don't have a __module__. Test for this case.
2004-06-05Reword messageAndrew M. Kuchling-1/+1
2004-06-05Fix exception wordingAndrew M. Kuchling-1/+1
2004-05-11super_getattro(): Repaired compiler warning about mixed-type comparison.Tim Peters-1/+2
2004-04-04Backport to 2.3:Andrew MacIntyre-0/+2
If a file is opened with an explicit buffer size >= 1, repeated close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak.
2004-03-25Ensure super() lookup of descriptor from classmethod works (SF ID# 743627)Phillip J. Eby-1/+8
(Backport to 2.3 maintenance branch)
2004-03-22Backported fix of revision 2.217.Armin Rigo-2/+2
2004-03-20Raise RuntimeError if the second argument to isinstance() or issubclass()Brett Cannon-9/+48
is a tuple nested to a depth beyond the interpreter's recursion limit to prevent a segfault from blowing the C stack. Fixes bug #858016 .
2004-03-19PyFile_WriteObject(): some of the local variables are only used whenFred Drake-0/+2
Py_USING_UNICODE is defined
2004-02-09Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocolJim Fulton-0/+1
2. Failure to clear the error when attempts to get the __getstate__ attribute fail caused intermittent errors and odd behavior.
2004-02-08SF patch #875689: >100k alloc wasted on startupRaymond Hettinger-1/+1
(Contributed by Mike Pall.) Make sure fill_free_list() is called only once rather than 106 times when pre-allocating small ints.
2004-02-05Backport checkin:Walter Dörwald-1/+1
Fix reallocation bug in unicode.translate(): The code was comparing characters instead of character pointers to determine space requirements.
2004-02-04Allocating a new weakref object can cause existing weakref objects forFred Drake-3/+16
the same object to be collected by the cyclic GC support if they are only referenced by a cycle. If the weakref being collected was one of the weakrefs without callbacks, some local variables for the constructor became invalid and have to be re-computed. The test caused a segfault under a debug build without the fix applied.
2004-02-03Fix bug in interpretation of the "callback" argument in the constructors forFred Drake-1/+5
weakref ref and proxy objects; None was not being treated as identical to NULL, though it was documented as equivalent.
2003-11-20SF bug 839548: Bug in type's GC handling causes segfaults.Tim Peters-4/+30
Also SF patch 843455. This is a critical bugfix, backported from 2.4 development. I don't intend to backport beyond 2.3 maint. The bugs this fixes have been there since weakrefs were introduced.
2003-11-13subtype_dealloc(): A more complete fix for critical bug 840829 +Tim Peters-11/+23
expanded the test case with a piece that needs the more-complete fix. I don't intend to backport this beyond 2.3 maint. It's a critical bugfix, and should be backported to 2.2, 2.1, ..., if more releases in those lines get made.
2003-11-13Backport of fix for SF bug 840829, memory corruption in some cases ofTim Peters-1/+6
weakref callbacks. This is a critical bugfix. It's already been fixed on the trunk (2.4 development). I don't intend to backport it to the 22 line, but if a 2.2.4 ever gets released, this should be in it.
2003-10-24Backport checkin:Walter Dörwald-19/+20
Fix a bug in the memory reallocation code of PyUnicode_TranslateCharmap(). charmaptranslate_makespace() allocates more memory than required for the next replacement but didn't remember that fact, so memory size was growing exponentially every time a replacement string is longer that one character. This fixes SF bug #828737.
2003-10-22Avoid confusing name for the 3rd argument to str.replace().Fred Drake-3/+3
This closes SF bug #827260.
2003-10-21Backport removal of bogus Py_DECREF() and indentation fix.Jeremy Hylton-2/+1
2003-10-20Backport checkin:Walter Dörwald-1/+1
Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751)
2003-10-18Patch #825679: Clarify semantics of .isfoo on empty strings.Martin v. Löwis-22/+24
2003-10-18Patch #809535: Mention behaviour of seek on text files.Martin v. Löwis-1/+3
2003-10-12Backport fix to SF bug #820397: __nonzero__() returns 1/0Raymond Hettinger-1/+15
2003-10-09SF patch #820195: make object.__contains__() returns True or False insteadRaymond Hettinger-2/+6
of 1 or 0. Backport Guido's fix to the default __contains__() and to proxy_has_key() so they will properly return booleans instead of integers.
2003-09-17Backport Tim's portability improvement and comments.Jeremy Hylton-1/+13
2003-09-16Backport: Double-fix of crash in Unicode freelist handling.Jeremy Hylton-1/+2
2003-09-16Fix leak in classobject.c. The leak surfaced on the error exit whenRaymond Hettinger-0/+1
hashing a class that does not define __hash__ but does define a comparison.
2003-09-16Backport Neal's fix for bug #789402 -- a memory leak in fileobject.cRaymond Hettinger-0/+1
2003-09-07Only release buffer after file has been closed. Fixes #800824.Martin v. Löwis-1/+1
2003-09-05SF bug #800796: Difference between hash() and __hash__()Raymond Hettinger-1/+8
slice(5).__hash__() now raises a TypeError.
2003-09-04Patch #788249: Pass an explicit buffer to setvbuf in PyFile_SetBufSize().Martin v. Löwis-5/+19
Fixes #603724.
2003-09-01SF patch #798467: Update docstring of has_key for bool changesRaymond Hettinger-2/+2
(Contributed by George Yoshida.)
2003-08-30Remove 'e.g.' from error messageRaymond Hettinger-3/+3
2003-08-27SF bug #795506: Wrong handling of string format code for float values.Raymond Hettinger-0/+6
Added missing support for '%F' as had been documented.
2003-08-15Backport checkin:Walter Dörwald-0/+1
Fix refcounting leak in charmaptranslate_lookup()
2003-08-15Backport checkin:Walter Dörwald-1/+3
Fix another refcounting leak in PyUnicode_EncodeCharmap().
2003-08-15Backport checkin:Walter Dörwald-0/+2
Fix another refcounting leak (in PyUnicode_DecodeUnicodeEscape()).
2003-08-15Backport my fix to my fix:Michael W. Hudson-1/+1
My last fix left n used unitialized in tha a==b case. Fix, by not using n at all in that case.
2003-08-14Backport checkins:Walter Dörwald-3/+3
Fix refcount leak in PyUnicode_EncodeCharmap(). The bug surfaces when an encoding error occurs and the callback name is unknown, i.e. when the callback has to be called. The problem was that the fact that the callback has already been looked up was only recorded in a local variable in charmap_encoding_error(), because charmap_encoding_error() got it's own copy of the errorHandler pointer instead of a pointer to the pointer in PyUnicode_EncodeCharmap().
2003-08-14And backport-2-3-4:Michael W. Hudson-9/+9
Fix reference leak noted in test_types: Check for a[:] = a _before_ calling PySequence_Fast on a.
2003-08-07As penance for forgetting to flag my last checkins as bugfix candidates,Michael W. Hudson-3/+6
just do the backport. These changes do not apply to release22-maint.
2003-07-16Remove code that tried to warn about shadowing builtin names after aNeil Schemenauer-66/+1
module had been compiled. It gives too many spurious warnings.
2003-07-16Remove stray comments.Jeremy Hylton-1/+0