Anthony Baxter [Sun, 13 Jul 2003 13:54:34 +0000 (13:54 +0000)]
Backport of rhettinger's funcobject.c 2.63, bugfix for SF bug 753451
Check the argument of classmethod is callable. (prevents
classmethod(classmethod(func)) from bombing out.
Fred Drake [Fri, 27 Jun 2003 18:27:21 +0000 (18:27 +0000)]
Don't assume the name of the table of contents will be contents.html;
that won't be right when mkhowto is called with --numeric (as it is
for the Python Tutorial). Save the actual name we use when we build
the table of contents, then use that in the page head metadata. The
node2label.pl script will munge this properly when --numeric isn't
given, so this works in both cases.
Closes SF bug #761830.
Barry Warsaw [Thu, 29 May 2003 20:09:31 +0000 (20:09 +0000)]
Backport from 2.3 trunk:
_make_boundary(): Fix for SF bug #745478, broken boundary calculation
in some locales. This code simplifies the boundary algorithm to use
randint() which is what we wanted anyway.
Tim Peters [Thu, 29 May 2003 18:50:45 +0000 (18:50 +0000)]
Give the Windows socket wrapper function default values for its 'family'
and 'type' arguments. This improves x-platform compatibility (e.g., on
Unix systems socket() already supported these default arguments).
No need to do anything here for 2.3 -- it already fixed this glitch in a
different way.
Barry Warsaw [Thu, 29 May 2003 15:13:18 +0000 (15:13 +0000)]
Backport patch 2.206:
----------------------------
revision 2.206
date: 2003/02/11 16:25:43; author: gvanrossum; state: Exp; lines: +9 -0
Add basic arg sanity checking to wrap_descr_get(). This is called
when Python code calls a descriptor's __get__ method. It should
translate None to NULL in both argument positions, and insist that at
least one of the argument positions is not NULL after this
transformation.
----------------------------
which fixes SF bug # 736892, forcing function to act like an unbound
method dumps core.
Barry Warsaw [Wed, 28 May 2003 23:03:30 +0000 (23:03 +0000)]
The backport gets Fred's seal of approval:
SF 742860: WeakKeyDictionary __delitem__ uses iterkeys
Someone review this, please! Final releases are getting close, Fred
(the weakref guy) won't be around until Tuesday, and the pre-patch
code can indeed raise spurious RuntimeErrors in the presence of
threads or mutating comparison functions.
See the bug report for my confusions: I can't see any reason for why
__delitem__ iterated over the keys. The new one-liner implementation
is much faster, can't raise RuntimeError, and should be better-behaved
in all respects wrt threads.
New tests test_weak_keyed_bad_delitem and
test_weak_keyed_cascading_deletes fail before this patch.
Jeremy Hylton [Thu, 22 May 2003 18:11:20 +0000 (18:11 +0000)]
Backport fix for SF bug 692776.
Add a tp_new slot to function objects that handles the case of a
function requiring a closure. Put the function type in the new
module, rather than having a function new.function(). Add tests.
Barry Warsaw [Thu, 22 May 2003 17:36:54 +0000 (17:36 +0000)]
Link the dbm module against gdbm if it exists and if no earlier
library match was found. This fixes dbm on RedHat 9 and doesn't
appear (so far <wink>) to have any regressions on other *nixes.
Tim Peters [Wed, 21 May 2003 20:43:10 +0000 (20:43 +0000)]
PyType_Ready(): Complain if the type is a base type, and gc'able, and
tp_free is NULL or PyObject_Del at the end. Because it's a base type
it must call tp_free in its dealloc function, and because it's gc'able
it must not call PyObject_Del.
inherit_slots(): Don't inherit tp_free unless the type and its base
agree about whether they're gc'able. If the type is gc'able and the
base is not, and the base uses the default PyObject_Del for its
tp_free, give the type PyObject_GC_Del for its tp_free (the appropriate
default for a gc'able type).
cPickle.c: The Pickler and Unpickler types claim to be base classes
and gc'able, but their dealloc functions didn't call tp_free.
Repaired that. Also call PyType_Ready() on these typeobjects, so
that the correct (PyObject_GC_Del) default memory-freeing function
gets plugged into these types' tp_free slots.
Martin v. Löwis [Tue, 20 May 2003 06:16:55 +0000 (06:16 +0000)]
SF patch #497420 (Eduardo Pérez): ftplib: ftp anonymous password
Instead of sending the real user and host, use "anonymous@" (i.e. no
host name at all!) as the default anonymous FTP password. This avoids
privacy violations.