Commit Graph

1473 Commits

Author SHA1 Message Date
Jeremy Hylton
d8136b500a Backport fixes to make more types collectable.
classmethod, staticmethod, cPickle.Pickler, cPickle.UNpickler
2003-05-09 18:29:21 +00:00
Martin v. Löwis
7aed4a33ac Patch #708604: Check more function results. 2003-05-03 10:53:51 +00:00
Tim Peters
fa90c3e468 file_truncate(): Backported 2.3 code so that file.truncate(n) works on
Windows when n is too big to fit in a 32-bit int.  This was a hole in
2.2's large file support on Windows, and turns out it's a bad hole at
least for ZODB.
2003-04-30 19:24:59 +00:00
Guido van Rossum
4f017eb311 Backport the Carlo Verre fix. 2003-04-25 05:40:32 +00:00
Neal Norwitz
9976fdf83c Backport:
Fix SF bug #697220, string.strip implementation/doc mismatch

Attempt to make all the various string/unicode *strip methods the same.
 * Doc - add doc for when functions were added
 * UserString
 * string/unicode object methods
 * string module functions
'chars' is used for the last parameter everywhere.
2003-04-11 18:21:22 +00:00
Guido van Rossum
c927c8a3ea Backport from trunk:
property_traverse() should also traverse into prop_doc -- there's no
typecheck that guarantees it's a string, and BTW string subclasses
could hide references.
2003-04-09 17:06:31 +00:00
Tim Peters
82550d5b86 Added private API function _PyInstance_Lookup(). This is part of
backporting fixes so that garbage collection doesn't have to trigger
execution of arbitrary Python code just to figure out whether
an object has a __del__ method.
2003-04-08 19:02:34 +00:00
Fred Drake
62ed948c2b Remove trailing newline. 2003-04-01 15:40:07 +00:00
Neal Norwitz
0dc63d404a Backport Tim's checkin 2.218:
slot_sq_contains():  This leaked a reference to the result of calling
    __contains__().
2003-03-23 14:36:50 +00:00
Gustavo Niemeyer
fac559c533 Backported fix to [521782] unreliable file.read() error handling. 2003-03-04 00:50:24 +00:00
Guido van Rossum
2f3fe91ddc Backport of rev 2.199 from trunk.
PyObject_Generic{Get,Set}Attr:

Don't access tp_descr_{get,set} of a descriptor without checking the
flag bits of the descriptor's type.  While we know that the main type
(the type of the object whose attribute is being accessed) has all the
right flag bits (or else PyObject_Generic{Get,Set}Attr wouldn't be
called), we don't know that for its class attributes!
2003-02-19 03:21:21 +00:00
Neal Norwitz
9aa5027699 Backport: Add more missing PyErr_NoMemory() after failled memory allocs 2003-02-11 23:19:35 +00:00
Neal Norwitz
e8c4f9457e backport:
revision 2.196
date: 2002/12/07 21:39:16;  author: tim_one;  state: Exp;  lines: +27 -28
slot_nb_nonzero():  Another leak uncovered by the sandbox datetime
tests.  I found the logic too confusing to follow here, so rewrote more
than was likely absolutely necessary.
2003-02-02 19:59:59 +00:00
Neal Norwitz
949954706b backport:
revision 2.164
date: 2002/10/29 18:36:40;  author: gvanrossum;  state: Exp;  lines: +12 -13
Since properties are supported here, is possible that
instance_getattr2() raises an exception.  Fix all code that made this
assumption.
2003-02-02 19:37:32 +00:00
Neal Norwitz
6b5140f992 backport:
revision 1.11
date: 2002/12/18 23:20:39;  author: nnorwitz;  state: Exp;  lines: +6 -2
SF # 654974, fix unchecked return values in structseq

Check return values after memory allocation.
2003-02-02 19:25:22 +00:00
Neal Norwitz
89d08cbd39 backport:
Fix SF bug# 676155, RuntimeWarning with tp_compare

Check return value of PyLong_AsDouble(), it can return an error.
2003-01-28 19:40:35 +00:00
Neal Norwitz
583b86bd2c Backport SF # 669553, fix memory (ref) leaks 2003-01-19 15:48:38 +00:00
Neal Norwitz
fbaaab9d25 Backport:
Fix SF bug #667147, Segmentation fault printing str subclass

Fix infinite recursion which occurred when printing an object
whose __str__() returned self.
2003-01-13 20:17:22 +00:00
Guido van Rossum
bec7972a2c Backport typeobject.c revision 2.201 plus associated tests from 2.3:
Add a refinement to SLOT1BINFULL() that fixes the problem reported in
SF bug #623669: only try (e.g.) __rdiv__ before __div__ if the right
class actually overrides it.
2003-01-07 21:47:44 +00:00
Raymond Hettinger
65b5e1fdbe Backport MAL's patch for bug #659709: bogus computation of float length 2003-01-02 22:08:39 +00:00
Raymond Hettinger
398c4ed102 SF Bug 645777: list.extend() works with any iterable and is no longer
experimental.
2002-12-29 05:59:09 +00:00
Neal Norwitz
89b8e84072 Fix SF #658106, Setting __class__ to NoneType
Backport Guido's checkin 2.171:

Disallow class assignment completely unless both old and new are heap
types.  This prevents nonsense like 2.__class__ = bool or
True.__class__ = int.
2002-12-24 14:48:41 +00:00
Guido van Rossum
0a478a5bb3 try_3way_compare() was returning -1 in one case where it should return
-2 (i.e. an exception was set).  (This was already fixed in 2.3
through a different refactoring.)

Worth the release of Pyton 2.2.3?  Eventually, I guess...
2002-12-16 22:32:46 +00:00
Raymond Hettinger
ac4ff87825 Fix typo in abstract.c which caused __rpow__ to not be invoked.
Added related testcase.
Closes SF bug #643260.
2002-12-07 10:15:38 +00:00
Tim Peters
5e016f4491 Backport from head.
slot_tp_hash():  In the normal path, this leaked a reference to the
integer hash object returned by __hash__().
2002-12-07 02:28:17 +00:00