Fred Drake [Mon, 28 Oct 2002 19:30:45 +0000 (19:30 +0000)]
Chapter titles that get split over multiple lines in the typeset
formats can't have whitespace after the last non-blank character (bug
in LaTeX?); fix up a couple of instances of this.
Jack Jansen [Fri, 25 Oct 2002 20:36:53 +0000 (20:36 +0000)]
Backport of 1.5:
Under Jaguar it seems that 'errn' return value keyword parameters don't
(or don't always?) show up with missed(). I think this is a bug in
Jaguar, but as it is a potential dangerous problem (the OSA event has
failed, but the Python code isn't told about this and happily continues)
this is a quick workaround.
Fred Drake [Thu, 24 Oct 2002 19:36:41 +0000 (19:36 +0000)]
Update an example to use the DOM implementation object. Explain that
the parse() and parseString() functions use a separate parser, not
actually implement a parser. (This is a common question.)
Fred Drake [Wed, 23 Oct 2002 20:24:46 +0000 (20:24 +0000)]
Deal with a FAQ:
Explain that the "xml" package requires that at least one
SAX-compliant XML parser be installed, and why this may not be
available by default. Point to the PyXML package as an extended
version of the "xml" package that can provide this fuctionality.
Note that the docs for the xml.dom and xml.sax packages are the
definitiona of the Python bindings for the DOM and SAX interfaces.
Barry Warsaw [Mon, 14 Oct 2002 18:21:49 +0000 (18:21 +0000)]
I'd forgotten that tcsh was the default for 10.1, but SF's 10.1 system
uses bash and so does my 10.2 system. "limit stacksize 2048" is the
right invocation for tcsh/csh.
Barry Warsaw [Mon, 14 Oct 2002 18:13:24 +0000 (18:13 +0000)]
I'd forgotten that tcsh was the default for 10.1, but SF's 10.1 system
uses bash and so does my 10.2 system. "limit stacksize 2048" is the
right invocation for tcsh/csh.
Barry Warsaw [Mon, 14 Oct 2002 18:03:04 +0000 (18:03 +0000)]
There was a typo in the MacOSX section regarding the stacksize issue.
There's no limit command near as I can tell. Should be the bash
builtin ulimit command.
Guido van Rossum [Fri, 11 Oct 2002 20:37:58 +0000 (20:37 +0000)]
Backport 2.193:
PyObject_Init[Var] is almost always called from the PyObject_NEW[_VAR]
macros. The 'op' argument is then the result from PyObject_MALLOC,
and that can of course be NULL. In that case, PyObject_Init[Var]
would raise a SystemError with "NULL object passed to
PyObject_Init[Var]". But there's nothing the caller of the macro can
do about this. So PyObject_Init[Var] should call just PyErr_NoMemory.
Tim Peters [Fri, 11 Oct 2002 18:38:20 +0000 (18:38 +0000)]
SF bug 621507: python22.dll incorrect "File version".
The MS resource compiler can't do arithmetic. Fixed it by hand. Note
that the new PCbuild\field3.py was added to help with this, and injects
another manual step into the Python Windows release process.
Tim Peters [Fri, 11 Oct 2002 18:29:54 +0000 (18:29 +0000)]
Backporting a new file from 2.3 needed to worm around that MS's
resource compiler can't do correct arithmetic. The 3rd 16-bit int
in the "binary file version" we produce on Windows has been nonsense
as a result. I'll fix that next.
Guido van Rossum [Fri, 11 Oct 2002 00:47:20 +0000 (00:47 +0000)]
Backport stringobject.c 2.194 and unicodeobject.c 2.172:
Fix a nasty endcase reported by Armin Rigo in SF bug 618623:
'%2147483647d' % -123 segfaults. This was because an integer overflow
in a comparison caused the string resize to be skipped. After fixing
the overflow, this could call _PyString_Resize() with a negative size,
so I (1) test for that and raise MemoryError instead; (2) also added a
test for negative newsize to _PyString_Resize(), raising SystemError
as for all bad arguments.
An identical bug existed in unicodeobject.c, of course.
Guido van Rossum [Fri, 11 Oct 2002 00:22:22 +0000 (00:22 +0000)]
New in 2.2.2!
In inherit_slots(), get rid of the COPYSLOT(tp_dictoffset). Copying
the offset from a non-dominant base makes no sense: either the
non-dominant base has a nonzero tp_dictoffset, and then we should have
already copied it from the dominant base (at the very end of
inherit_special()), or the non-dominant base has no tp_dictoffset and
for some reason type_new() decided not to add one. The tp_dictoffset
from a non-dominant base is likely to conflict with the instance
layout of the dominant base, so copying the tp_dictoffset from the
non-dominant base would be a really bad idea in that case. This bug
can only be triggered by multiple inheritance from an extension class
that doesn't set tp_dictoffset and a new-style user-level class that
does have one. There are no such extension classes in the
distribution, but there are 3rd party ones. (Zope3 now has one,
that's how I found this. :-)
I've asked a few heavy users of new-style classes, extension classes
and metaclasses (David Abrahams and Kevin Jacobs), and neither of them
found any problems in their test suite after applying this fix, so I
assume it's safe.
Guido van Rossum [Fri, 11 Oct 2002 00:09:51 +0000 (00:09 +0000)]
Backport the relevant part of 2.192:
The string formatting code has a test to switch to Unicode when %s
sees a Unicode argument. Unfortunately this test was also executed
for %r, because %s and %r share almost all of their code. This meant
that, if u is a unicode object while repr(u) is an 8-bit string
containing ASCII characters, '%r' % u is a *unicode* string containing
only ASCII characters!
Barry Warsaw [Thu, 10 Oct 2002 00:59:16 +0000 (00:59 +0000)]
detect_modules(): Be more conservative about adding
runtime_library_dirs (i.e. -R flags) when building the _socket.so
module. Whitelist only the platforms we know need the flags, which
are only sunos (aka Solaris) platforms at the moment. Tested on
RH7.3, OSX 10.2, and Solaris 8.
Tim Peters [Tue, 8 Oct 2002 21:03:26 +0000 (21:03 +0000)]
The
list(xrange(sys.maxint / 4))
test. Changed 4 to 2.
The belief is that this test intended to trigger a bit of code in
listobject.c's NRESIZE macro that's looking for arithmetic overflow. As
written, it doesn't achieve that, though, and leaves it up to the platform
realloc() as to whether it wants to allocate 2 gigabytes. Some platforms
say "sure!", although they don't appear to mean it, and disaster ensues.
Changing 4 to 2 (just barely) manages to trigger the arithmetic overflow
test instead, leaving the platform realloc() out of it.
Fred Drake [Tue, 8 Oct 2002 19:49:36 +0000 (19:49 +0000)]
Fix some code that was added to the r22-maint branch to allow it to work with
arbitrary versions of Expat.
Not applicable to Python 2.3, which will incorporate an Expat that does not
need this crutch.
News for 2.2.2b1. I'm exhausted -- this was a multi-hour job of
poring over the logs. Quite likely I've forgotten some things,
introduced typos, and organized things less than ideally.
- Changed new-style class instantiation so that when C's __new__
method returns something that's not a C instance, its __init__ is
not called. [SF bug #537450]
XXX This is arguably a semantic change, but it's hard to imagine a
reason for wanting to depend on the old behavior. If problems with
this are reported within a week of the release of 2.2.2 beta 1, we may
revert this change.
Extend stripid() to handle strings ending in more than one '>'.
Add resolve() to handle looking up objects and names (fix SF bug 586931).
Add a nicer error message when given a filename that doesn't exist.
Barry Warsaw [Mon, 7 Oct 2002 17:05:28 +0000 (17:05 +0000)]
openfile(): Go back to opening the files in text mode. This undoes
the change in revision 1.11 (test_email.py) in response to SF bug
#609988. We now think that was the wrong fix and that WinZip was the
real culprit there.
This and the Parser.py patch will be forward ported into Python 2.3
and email 2.5.
Barry Warsaw [Mon, 7 Oct 2002 17:02:40 +0000 (17:02 +0000)]
_parsebody(): Use get_content_type() instead of the deprecated
get_type(). Also, one of the regular expressions is constant so might
as well make it a module global. And, when splitting up digests,
handle lineseps that are longer than 1 character in length
(e.g. \r\n).
Fred Drake [Mon, 7 Oct 2002 16:26:28 +0000 (16:26 +0000)]
Backport patches from trunk revisions 1.62, 1.63. Modified to be
easier to read for both HTML and typeset renderings. Relies on
../perl/python.perl revision 1.116.4.4.
Fred Drake [Mon, 7 Oct 2002 16:18:57 +0000 (16:18 +0000)]
Back-port part of 1.128 from the trunk:
\productioncont: Replace leading spaces with so that it's
possible to control the indentation of continuation lines.
In both spilldata() functions, pretend that the docstring for
non-callable objects is always None. This makes for less confusing
output and fixes the problem reported in SF patch #550290.
Backport 1.70 and 1.71 (which really go together):
1.70:
whichmodule() should skip dummy package entries in sys.modules.
This fixes the charming, but unhelpful error message for
>>> pickle.dumps(type.__new__)
Can't pickle <built-in method __new__ of type object at 0x812a440>: it's not the same object as datetime.math.__new__
1.71:
Fiddle comments and variable names in whichmodule().