Tim Peters [Fri, 9 Nov 2001 19:23:47 +0000 (19:23 +0000)]
open_the_file(): this routine has a borrowed reference to the file
object, so the "Metroworks only" section should not decref it in case
of error (the caller is responsible for decref'ing in case of error --
and does).
Barry Warsaw [Fri, 9 Nov 2001 16:59:56 +0000 (16:59 +0000)]
formatdate(): An implementation to replace the one borrowed from
rfc822.py. The old rfc822.formatdate() produced date strings using
obsolete syntax. The new version produces the preferred RFC 2822
dates.
Also, an optional argument `localtime' is added, which if true,
produces a date relative to the local timezone, with daylight savings
time properly taken into account.
Jeremy Hylton [Fri, 9 Nov 2001 16:46:51 +0000 (16:46 +0000)]
Fix SF bug 468948 & 451295: urllib2 authentication problems
Fix contributed by Jeffrey C. Ollie.
I haven't tested the fix because the situation is non-trivial to
reproduce.
The basic solution is to get rid of the __current_realm attribute of
authentication handlers. Instead, prevent infinite retries by
checking for the presence of an Authenticate: header in the request
object that exactly matches the Authenticate: header that would be
added.
The problem prevent authentication from working correctly in the
presence of retries.
Ollie mentioned that digest authentication has the same problem and I
applied the same solution there.
Fixes to compile cPickle.c & socketmodule.c on cygwin and possibly
other platforms that have funny ideas about whether addresses of
functions in dlls are compile-time constants.
Add fast-path for comparing interned (true) string objects.
This patch boosts performance for comparing identical string object
by some 20% on my machine while not causing any noticable slow-down
for other operations (according to tests done with pybench).
Fred Drake [Wed, 7 Nov 2001 06:22:25 +0000 (06:22 +0000)]
apply() documentation: Remove a detail about the implementation that does
not affect the API. Clean up the text about call syntax apply() is
equivalent to. Based on comments by Thomas Guettler.
Tim Peters [Wed, 7 Nov 2001 04:42:04 +0000 (04:42 +0000)]
SF bug #478949 Windows installer start menu registry.
I'm guessing at this, pending more info from the bug submitter. Wise
changed how the %GROUP% vrbl got defined between versions 5.0a (used
before Python 2.2) and 8.14, to hold the full path to Start Menu group
instead of just the group name. If I'm guessing correctly, the info
the bug report is complaining about is in one of the registry keys
we set up that neither Windows nor Python cares about. We did store
a full path there in 2.2b1 instead of just the group name; the patch cuts
it back to just the name again.
Fred Drake [Tue, 6 Nov 2001 16:38:34 +0000 (16:38 +0000)]
Add a regression test for SF bug #478536: If a value cannot be weakly
referenced, WeakKeyDictionary.has_key() should return 0 instead of raising
TypeError.
Fred Drake [Tue, 6 Nov 2001 16:36:53 +0000 (16:36 +0000)]
WeakKeyDictionary.has_key(): If the key being tested is not weakly
referencable (weakref.ref() raises TypeError), return 0 instead of
propogating the TypeError.
This closes SF bug #478536; bugfix candidate.
Tim Peters [Mon, 5 Nov 2001 21:25:02 +0000 (21:25 +0000)]
SF bug 478425: Change in os.path.join (ntpath.py)
ntpath.join('a', '') was producing 'a' instead of 'a\\' as in 2.1.
Impossible to guess what was ever *intended*, but since split('a\\')
produces ('a', ''), I think it's best if join('a', '') gives 'a\\' back.
Fred Drake [Mon, 5 Nov 2001 17:40:48 +0000 (17:40 +0000)]
copy(): Make sure the copy of a derived class cannot share the data of the
original by replacing self.data temporarily, then using the update() method
on the new mapping object to populate it.
This closes SF bug #476616.
Jack Jansen [Mon, 5 Nov 2001 14:44:23 +0000 (14:44 +0000)]
Carbon Event Manager module donated by Donovan Preston. Checked in as I received them (except for namechange), these will not work as-is, that'll be fixed in a later checkin.
Tim Peters [Sun, 4 Nov 2001 23:09:40 +0000 (23:09 +0000)]
long_true_divide(): decref its converted arguments. test_long_future.py
run in an infinite loop no longer grows. Thanks to Neal Norwitz for
determining that test leaked!
Tim Peters [Sun, 4 Nov 2001 19:26:58 +0000 (19:26 +0000)]
Part of SF bug #478003 possible memory leaks in err handling.
PyNode_CompileSymtable: if symtable_init() fails, free the memory
allocated for the PyFutureFeatures struct.
Tim Peters [Sun, 4 Nov 2001 07:29:31 +0000 (07:29 +0000)]
Rehabilitated the fast-path richcmp code, and sped it up. It wasn't
helping for types that defined tp_richcmp but not tp_compare, although
that's when it's most valuable, and strings moved into that category
since the fast path was first introduced. Now it helps for same-type
non-Instance objects that define rich or 3-way compares.
For all the edits here, the rest just amounts to moving the fast path from
do_richcmp into PyObject_RichCompare, saving a layer of function call
(measurable on my box!). This loses when NESTING_LIMIT is exceeded, but I
don't care about that (fast-paths are for normal cases, not pathologies).
Also added a tasteful <wink> label to get out of PyObject_RichCompare, as
the if/else nesting in this routine was getting incomprehensible.
Barry Warsaw [Sun, 4 Nov 2001 03:04:25 +0000 (03:04 +0000)]
Two bug fixes for problems reported by Sverre:
__getaddr(): Watch out for empty addresses that can happen when
something like "MAIL FROM:<CR>" is received. This avoids the
IndexError and rightly returns an SMTP syntax error.
parseargs(): We didn't handle the 2-arg case where both the localspec
and the remotespec were provided on the command line.
Tim Peters [Sat, 3 Nov 2001 19:35:43 +0000 (19:35 +0000)]
Improved error msg when a symbolic group name is redefined. Added docs
and NEWS. Bugfix candidate? That's a dilemma for Anthony <wink>: /F
did fix a longstanding bug here, but the fix can cause code to raise an
exception that previously worked by accident.