1999 Commits

Author SHA1 Message Date
Martin v. Löwis
d254ca8813 Backport of r61180:
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-03-02 20:32:57 +00:00
Anthony Baxter
1785d3fce8 patch for PSF-2006-001. 2006-10-23 15:23:22 +00:00
Tim Peters
7d37a2a564 SF 1055820: weakref callback vs gc vs threads
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-10-31 00:13:07 +00:00
Martin v. Löwis
4f841d0be7 Patch #980082: Missing INCREF in PyType_Ready. 2004-08-18 13:21:22 +00:00
Fred Drake
728b519b38 Be more careful about maintaining the invariants; it was actually
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-08-03 14:46:57 +00:00
Raymond Hettinger
5c2ab599c0 Fix leak found by Eric Huss. 2004-06-25 22:20:33 +00:00
Anthony Baxter
7dddbfebaa Backport:
Fix for bug #966623 - classes created with type() in an exec(, {}) don't
have a __module__. Test for this case.
2004-06-11 15:09:41 +00:00
Andrew M. Kuchling
de8ddb2bb2 Reword message 2004-06-05 19:49:52 +00:00
Andrew M. Kuchling
fff3f949d9 Fix exception wording 2004-06-05 19:30:29 +00:00
Tim Peters
d71fc05888 super_getattro(): Repaired compiler warning about mixed-type comparison. 2004-05-11 16:35:05 +00:00
Andrew MacIntyre
9ed9329248 Backport to 2.3:
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-04-04 07:08:20 +00:00
Phillip J. Eby
f12b642f1c Ensure super() lookup of descriptor from classmethod works (SF ID# 743627)
(Backport to 2.3 maintenance branch)
2004-03-25 02:36:29 +00:00
Armin Rigo
42b2cbcb62 Backported fix of revision 2.217. 2004-03-22 20:39:42 +00:00
Brett Cannon
9aee99be16 Raise RuntimeError if the second argument to isinstance() or issubclass()
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-20 21:54:35 +00:00
Fred Drake
acfe104847 PyFile_WriteObject(): some of the local variables are only used when
Py_USING_UNICODE is defined
2004-03-19 15:23:14 +00:00
Jim Fulton
95e4f23b09 Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol
2.  Failure to clear the error when attempts to get the __getstate__
  attribute fail caused intermittent errors and odd behavior.
2004-02-09 02:57:18 +00:00
Raymond Hettinger
d6ea07f9ac SF patch #875689: >100k alloc wasted on startup
(Contributed by Mike Pall.)

Make sure fill_free_list() is called only once rather than 106 times
when pre-allocating small ints.
2004-02-08 18:56:07 +00:00
Walter Dörwald
8c077f99d0 Backport checkin:
Fix reallocation bug in unicode.translate(): The code was comparing
characters instead of character pointers to determine space requirements.
2004-02-05 17:44:26 +00:00
Fred Drake
74788b6af4 Allocating a new weakref object can cause existing weakref objects for
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-04 23:13:43 +00:00
Fred Drake
a7555f8413 Fix bug in interpretation of the "callback" argument in the constructors for
weakref ref and proxy objects; None was not being treated as identical to
NULL, though it was documented as equivalent.
2004-02-03 20:15:31 +00:00
Tim Peters
ca6919c180 SF bug 839548: Bug in type's GC handling causes segfaults.
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-20 22:13:51 +00:00
Tim Peters
8e81b7efad subtype_dealloc(): A more complete fix for critical bug 840829 +
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-13 22:48:42 +00:00
Tim Peters
695461f200 Backport of fix for SF bug 840829, memory corruption in some cases of
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-11-13 01:17:55 +00:00
Walter Dörwald
218f9abe45 Backport checkin:
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-24 15:05:29 +00:00
Fred Drake
c7cd9cff3c Avoid confusing name for the 3rd argument to str.replace().
This closes SF bug #827260.
2003-10-22 02:57:23 +00:00