Barry Warsaw [Fri, 16 Nov 2001 22:16:04 +0000 (22:16 +0000)]
Add a clarification that the email package always deals in native line
endings, and that it is smtplib's job to convert those to RFC 2821
line endings when sending the message.
Fred Drake [Fri, 16 Nov 2001 06:02:55 +0000 (06:02 +0000)]
Clean up some markup a little bit more. Make this work with the PDF format,
which is a little more strict than the other formats on some things (fixable,
but not tonight).
Fred Drake [Fri, 16 Nov 2001 02:52:57 +0000 (02:52 +0000)]
Fix parsing of parameters from a URL; urlparse() did not check that it only
split parameters from the last path segment. Introduces two new functions,
urlsplit() and urlunsplit(), that do the simpler job of splitting the URL
without monkeying around with the parameters field, since that was not being
handled properly.
This closes bug #478038.
Barry Warsaw [Thu, 15 Nov 2001 23:45:26 +0000 (23:45 +0000)]
A change to sync with pickle.py:
find_class(): We no longer mask all exceptions[1] by transforming them
into SystemError. The latter is definitely not the right thing to do,
so we let any exceptions that occur in the PyObject_GetAttr() call to
simply propagate up if they occur.
[1] Note that pickle only masked ImportError, KeyError, and
AttributeError, but cPickle masked all exceptions.
Barry Warsaw [Thu, 15 Nov 2001 23:42:58 +0000 (23:42 +0000)]
Two changes:
load_inst(): Implement the security hook that cPickle already had.
When unpickling callables which are not classes, we look to see if the
object has an attribute __safe_for_unpickling__. If this exists and
has a true value, then we can call it to create the unpickled object.
Otherwise we raise an UnpicklingError.
find_class(): We no longer mask ImportError, KeyError, and
AttributeError by transforming them into SystemError. The latter is
definitely not the right thing to do, so we let the former three
exceptions simply propagate up if they occur, i.e. we remove the
try/except!
Barry Warsaw [Thu, 15 Nov 2001 23:39:07 +0000 (23:39 +0000)]
A massive rewrite affecting both the pickle and cPickle module
documentation. This addresses previously undocumented parts of the
public interfaces, the differences between pickle and cPickle,
security concerns, and on and on.
Guido van Rossum [Thu, 15 Nov 2001 20:27:54 +0000 (20:27 +0000)]
Correct the description of mixed multiple inheritance: the code
special-cases classic classes, it doesn't do anything about other
cases where different metaclasses are involved (except for the trivial
case where one metaclass is a subclass of the others). Also note that
it's metaclass, not metatype.
Tim Peters [Wed, 14 Nov 2001 23:32:33 +0000 (23:32 +0000)]
Changing diapers reminded Guido that he wanted to allow for some measure
of multiple inheritance from a mix of new- and classic-style classes.
This is his patch, plus a start at some test cases from me. Will check
in more, plus a NEWS blurb, later tonight.
Jack Jansen [Wed, 14 Nov 2001 10:59:57 +0000 (10:59 +0000)]
OSX tests used specific version numbers to test for new features and
used the default Darwin/* for the old code. Reversed those tests so
that compatibility code is in a switch leg with a specific version and
newer systems take the default leg.
This should allow Python to build on OSX 10.1.1 (which jumps from Darwin/1.4
to Darwin/5.1 due to a new numbering scheme).
Tim Peters [Tue, 13 Nov 2001 23:11:19 +0000 (23:11 +0000)]
CVS patch #477161: New "access" keyword for mmap, from Jay T Miller.
This gives mmap() on Windows the ability to create read-only, write-
through and copy-on-write mmaps. A new keyword argument is introduced
because the mmap() signatures diverged between Windows and Unix, so
while they (now) both support this functionality, there wasn't a way to
spell it in a common way without introducing a new spelling gimmick.
The old spellings are still accepted, so there isn't a backward-
compatibility issue here.
Barry Warsaw [Tue, 13 Nov 2001 20:16:52 +0000 (20:16 +0000)]
Committing the second part of patch #480902, an improved test suite
for dumbdbm.py, by Skip Montanaro. The first half of Skip's patch has
been postponed until Py2.3 since it adds new features.
Jack Jansen [Sat, 10 Nov 2001 23:21:55 +0000 (23:21 +0000)]
Add the MSL C library to the set of standard libraries
linked against. Most, but not all, of it is included in
PythonCore, but extensions may want to use some of
the routines not included. Fixes a bug reported by
Tom Loredo.
Jack Jansen [Sat, 10 Nov 2001 00:41:43 +0000 (00:41 +0000)]
Fixed various problems with command-dot handling (some very old):
- Don't scan for cmd-. unless in the foreground
- Scan before switching out to other processes, not after
- don't scan if SchedParams.check_interrupt is false (!)
- But: do scan if we're blocked on I/O
One problem remains: in the last case KeyboardInterrupt is raised
too late.
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.