Fred Drake [Thu, 21 Jun 2001 18:52:50 +0000 (18:52 +0000)]
Adjust the documents so that the copyright is at the front of the documents
and the license statements are at the end. This is less annoying to readers.
Thomas Wouters [Fri, 15 Jun 2001 11:58:49 +0000 (11:58 +0000)]
Protect several more uses of constants with #ifdefs; these are necessary on
(at least) SCO OpenServer 5. Fixes a non-SF-submitted bugreport by Michael
Kent.
Guido van Rossum [Tue, 12 Jun 2001 16:29:12 +0000 (16:29 +0000)]
Incorporating MAL's bugfix into the 2.1.1 branch:
revision 1.53
date: 2001/06/12 16:13:51; author: lemburg; state: Exp; lines: +1 -1
Removed the Python version from the PYTHONHOMEHELP string. It was
still set to python2.0 ...
Fred Drake [Mon, 11 Jun 2001 15:22:23 +0000 (15:22 +0000)]
Fixed parameter order for os.popen2(), os.popen3(), and os.popen(4). Added
a reference to these functions and popen() from the "Process Management"
section.
Fred Drake [Mon, 11 Jun 2001 14:57:07 +0000 (14:57 +0000)]
Merge in recent changes from development branch: add warning about being
sure that code only runs once when using the module as both a module and a
script.
Fred Drake [Sun, 3 Jun 2001 03:16:04 +0000 (03:16 +0000)]
Explained more differences between PyList_SetItem() and PyList_SET_ITEM().
In particular, the affect on existing list content was not sufficiently
explained.
Fred Drake [Tue, 29 May 2001 18:53:11 +0000 (18:53 +0000)]
Users of PySequence_GET_FAST() should get the length of the sequence using
PySequence_Size(), not PyObject_Size(): the later considers the mapping
methods as well as the sequence methods, which is not needed here. Either
should be equally fast in this case, but PySequence_Size() offers a better
conceptual match.
Fred Drake [Tue, 29 May 2001 18:14:26 +0000 (18:14 +0000)]
readlink() description: Added note that the return value may be either
absolute or relative.
remove(), rename() descriptions: Give more information about the cross-
platform behavior of these functions, so single-platform developers
can be aware of the potential issues when writing portable code.
Fred Drake [Tue, 29 May 2001 16:06:21 +0000 (16:06 +0000)]
Bring the notes on the relationship between __cmp__(), __eq__(), and
__hash__() up to date (re: use of objects which define these methods
as dictionary keys).
This closes SF bug #427698.
Migrated comments about supporting __contains__() and the use of the "in"
operator from the development branch.
Thomas Wouters [Mon, 28 May 2001 13:04:33 +0000 (13:04 +0000)]
_PyTuple_Resize: take into account the empty tuple. There can be only one.
Instead of raising a SystemError, just create a new tuple of the desired
size.
Thomas Wouters [Wed, 23 May 2001 15:07:55 +0000 (15:07 +0000)]
Backport Tim's checkin 2.84:
SF bug #422121 Insecurities in dict comparison.
Fixed a half dozen ways in which general dict comparison could crash
Python (even cause Win98SE to reboot) in the presence of kay and/or
value comparison routines that mutate the dict during dict comparison.
Thomas Wouters [Wed, 23 May 2001 14:38:53 +0000 (14:38 +0000)]
Net result of Tim's checkins to stropmodule.c (2.78, 2.79, 2.80, 2.81),
stringobject.c (2.114, 2.115) and test_strop.py (1.11, 1.12). Fixes
'replace' behaviour on systems on which 'malloc(0)' returns NULL (together
with previous checkins) and re-synchs the string-operation code in
stringobject.c and stropmodule.c, with the exception of 'replace', which has
the old semantics in stropmodule but the new semantics in stringobjects.
Thomas Wouters [Wed, 23 May 2001 13:18:30 +0000 (13:18 +0000)]
Backport Tim's checkin 2.130:
SF bug #422108 - Error in rich comparisons.
Fix a bad (albeit unlikely) return value in try_rich_to_3way_compare().
Also document do_cmp()'s return values.
Thomas Wouters [Wed, 23 May 2001 13:03:13 +0000 (13:03 +0000)]
Net result of Guido's checkins of object.c (2.125 and 2.126), classobject.c
(2.128) and stringobject.c (2.105), which reworks PyObject_Str() and
PyObject_Repr() so strings and instances aren't special-cased, and
print >> file, instance
works like expected in all cases.
Thomas Wouters [Wed, 23 May 2001 12:51:22 +0000 (12:51 +0000)]
Backport of Tim's checkin 2.177:
SF bug #417093: Case sensitive import: dir and .py file w/ same name
Directory containing
Spam.py
spam/__init__.py
Then "import Spam" caused a SystemError, because code checking for
the existence of "Spam/__init__.py" finds it on a case-insensitive
filesystem, but then bails because the directory it finds it in
doesn't match case, and then old code assumed that was still an error
even though it isn't anymore. Changed the code to just continue
looking in this case (instead of calling it an error). So
import Spam
and
import spam
both work now.
Thomas Wouters [Wed, 23 May 2001 12:46:45 +0000 (12:46 +0000)]
Backport Tim's checkin 2.199:
Fix buglet reported on c.l.py: map(fnc, file.xreadlines()) blows up.
Took away map()'s insistence that sequences support __len__, and cleaned
up the convoluted code that made it *look* like it really cared about
__len__ (in fact the old ->len field was only *used* as a flag bit, as
the main loop only looked at its sign bit, setting the field to -1 when
IndexError got raised; renamed the field to ->saw_IndexError instead).
Thomas Wouters [Wed, 23 May 2001 12:31:25 +0000 (12:31 +0000)]
Backport of Tim's checkin 2.88:
A different approach to the problem reported in
Patch #419651: Metrowerks on Mac adds 0x itself
C std says %#x and %#X conversion of 0 do not add the 0x/0X base marker.
Metrowerks apparently does. Mark Favas reported the same bug under a
Compaq compiler on Tru64 Unix, but no other libc broken in this respect
is known (known to be OK under MSVC and gcc).
So just try the damn thing at runtime and see what the platform does.
Note that we've always had bugs here, but never knew it before because
a relevant test case didn't exist before 2.1.
Thomas Wouters [Wed, 23 May 2001 12:30:59 +0000 (12:30 +0000)]
Backport Tim's checkin 2.104:
A different approach to the problem reported in
Patch #419651: Metrowerks on Mac adds 0x itself
C std says %#x and %#X conversion of 0 do not add the 0x/0X base marker.
Metrowerks apparently does. Mark Favas reported the same bug under a
Compaq compiler on Tru64 Unix, but no other libc broken in this respect
is known (known to be OK under MSVC and gcc).
So just try the damn thing at runtime and see what the platform does.
Note that we've always had bugs here, but never knew it before because
a relevant test case didn't exist before 2.1.
Thomas Wouters [Wed, 23 May 2001 12:15:57 +0000 (12:15 +0000)]
Backport Jeremy's checkin 1.7:
Fix 2.1 nested scopes crash reported by Evan Simpson
The new test case demonstrates the bug. Be more careful in
symtable_resolve_free() to add a var to cells or frees only if it
won't be added under some other rule.
Thomas Wouters [Wed, 23 May 2001 12:15:17 +0000 (12:15 +0000)]
Backport Jeremy's checkin 1.15:
Fix 2.1 nested scopes crash reported by Evan Simpson
The new test case demonstrates the bug. Be more careful in
symtable_resolve_free() to add a var to cells or frees only if it
won't be added under some other rule.
Thomas Wouters [Wed, 23 May 2001 12:11:35 +0000 (12:11 +0000)]
Backport Jeremy's checkin 2.198:
Fix 2.1 nested scopes crash reported by Evan Simpson
The new test case demonstrates the bug. Be more careful in
symtable_resolve_free() to add a var to cells or frees only if it
won't be added under some other rule.
Fred Drake [Sun, 20 May 2001 13:35:45 +0000 (13:35 +0000)]
Fix bug in smtplib example: the prompt said to end the message with ^D,
but doing so raised EOFError. This makes it work as advertised and
converts to string methods where reasonable.
Fred Drake [Fri, 11 May 2001 16:34:23 +0000 (16:34 +0000)]
Migrate the last few revisions from the head to the bugfix branch -- these
have all been portability fixes and improving the consistency of how file
descriptors and file objects are handled.
Fred Drake [Thu, 10 May 2001 15:13:39 +0000 (15:13 +0000)]
Remove all mentions of the strop module -- it has been pronounced Evil.
(The string "strop" is found in the rexec documentation, but that should
not be changed until strop is actually removed or rexec no longer allows
it.)
Fred Drake [Wed, 9 May 2001 19:57:50 +0000 (19:57 +0000)]
Itamar Shtull-Trauring <python@itamarst.org>:
Updates zipfile.ZipFile docs to mention the fact that you can create a
ZipFile instance from an arbitrary file-like object.
Fred Drake [Wed, 9 May 2001 19:13:40 +0000 (19:13 +0000)]
Three uses of makesockaddr() used sockaddr buffers that had not be cleared;
this could cause invalid paths to be returned for AF_UNIX sockets on some
platforms (including FreeBSD 4.2-RELEASE), appearantly because there is
no assurance that the address will be nul-terminated when filled in by the
kernel.
Fred Drake [Wed, 9 May 2001 04:04:11 +0000 (04:04 +0000)]
Job.build_html(): Be more robust in ensuring about.html exists; copying
the right HTML file to the name about.html is needed even if the
--numeric option was not given -- some other name may have been
assigned due to some non-determinism in the algorithm use to perform
name allocation. ;-(
This closes the "About..." portion of SF bug #420216.
Fred Drake [Wed, 9 May 2001 03:57:01 +0000 (03:57 +0000)]
There is no IMAP class in the imaplib module; the class is IMAP4.
There is no imap module; refer to imaplib instead, since it exists.
Move the "See Also:" section in front of the sub-sections, for
consistency with other portions of the library reference.
This closes the library reference portion of SF bug #420216.
Fred Drake [Thu, 3 May 2001 19:45:34 +0000 (19:45 +0000)]
Remove unnecessary intialization for the case of weakly-referencable objects;
the code necessary to accomplish this is simpler and faster if confined to
the object implementations, so we only do this there.
This causes no behaviorial changes beyond a (very slight) speedup.
Fred Drake [Sun, 22 Apr 2001 06:19:29 +0000 (06:19 +0000)]
Update publish-to-SourceForge scripts to automatically determine if the
branch is the head (development) branch or a maintenance brach, and use
the appropriate target directory for each.
Fred Drake [Thu, 19 Apr 2001 04:55:57 +0000 (04:55 +0000)]
Add versioning notes: many of the signatures changed to allow the time
used to be omitted (meaning use the current time) as of Python 2.1.
Users who need cross-version portability need to know things like this.
Fred Drake [Wed, 18 Apr 2001 17:32:45 +0000 (17:32 +0000)]
Add description of the "explanation" optional parameter added to the
\versionadded macro.
I originally thought this should not be merged into the 2.1 maintenance
branch, but reconsidered: documentation changes may actually *use* the
new version of the markup, so the lack of this markup variant can
reasonably be considered a bug.
Fred Drake [Wed, 18 Apr 2001 17:29:14 +0000 (17:29 +0000)]
Added support for optional explanation parameter to the \versionadded
macro.
Refactored do_cmd_versionadded() and do_cmd_versionchanged() to do most
of the work in a helper function, with the do_cmd_*() wrappers just supplying
a portion of the replacement text.