Patch #102492, fixing bug #116677:
give minidom.py behaviour that complies with the DOM Level 1 REC,
which says that when a node newChild is added to the tree, "if the
newChild is already in the tree, it is first removed."
pulldom.py is patched to use the public minidom interface instead
of setting .parentNode itself. Possibly this reduces pulldom's
efficiency; someone else will have to pronounce on that.
Patch #102955, fixing one of the warnings in bug #121479:
Simplifies ord()'s logic at the cost of some code duplication, removing a
" `ord' might be used uninitialized in this function" warning
Guido van Rossum [Tue, 19 Dec 2000 18:25:58 +0000 (18:25 +0000)]
Adding a warning about the regsub module. This also disables further
warnings in this same module, to prevent getting a warning about
importing regex (we *know* that it's obsolete :-).
Guido van Rossum [Tue, 19 Dec 2000 18:21:39 +0000 (18:21 +0000)]
Adding a warning about the regex module. This is the first official
use of PyErr_Warn()! This module is a good guinea pig because it's
been obsolete since 1.5.0 was released.
Guido van Rossum [Tue, 19 Dec 2000 16:48:13 +0000 (16:48 +0000)]
Be explicit about scheme_chars -- string.letters is locale dependent
so we can't use it.
While I'm at it, got rid of string module use. (Found several new
hard special cases for a hypothetical conversion tool: from string
import join, find, rfind; and a local assignment "find=string.find".)
Guido van Rossum [Tue, 19 Dec 2000 03:58:11 +0000 (03:58 +0000)]
Oops. The value "0 or +1" for the category argument of PyErr_Warn()
doesn't work. Make it 0. (Although it really *should* be 0 or +1 --
the refcount is incremented when it is raised as an exception, but not
otherwise.)
Guido van Rossum [Tue, 19 Dec 2000 02:22:31 +0000 (02:22 +0000)]
Test more split argument combinations:
1) multi-char separator
2) multi-char separator that only occurs at last position
3) all of the above with mixed Unicode and 8-bit-string arguments
Guido van Rossum [Tue, 19 Dec 2000 02:08:38 +0000 (02:08 +0000)]
Minimal fix for the complaints about pickling Unicode objects. (SF
bugs #126161 and 123634).
The solution doesn't use the unicode-escape encoding; that has other
problems (it seems not 100% reversible). Rather, it transforms the
input Unicode object slightly before encoding it using
raw-unicode-escape, so that the decoding will reconstruct the original
string: backslash and newline characters are translated into their
\uXXXX counterparts.
This is backwards incompatible for strings containing backslashes, but
for some of those strings, the pickling was already broken.
Note that SF bug #123634 complains specifically that cPickle fails to
unpickle the pickle for u'' (the empty Unicode string) correctly.
This was an off-by-one error in load_unicode().
XXX Ugliness: in order to do the modified raw-unicode-escape, I've
cut-and-pasted a copy of PyUnicode_EncodeRawUnicodeEscape() into this
file that also encodes '\\' and '\n'. It might be nice to migrate
this into the Unicode implementation and give this encoding a new name
('half-raw-unicode-escape'? 'pickle-unicode-escape'?); that would help
pickle.py too. But right now I can't be bothered with the necessary
infrastructural changes.
Guido van Rossum [Tue, 19 Dec 2000 01:29:00 +0000 (01:29 +0000)]
Minimal fix for the complaints about pickling Unicode objects. (SF
bugs #126161 and 123634).
The solution doesn't use the unicode-escape encoding; that has other
problems (it seems not 100% reversible). Rather, it transforms the
input Unicode object slightly before encoding it using
raw-unicode-escape, so that the decoding will reconstruct the original
string: backslash and newline characters are translated into their
\uXXXX counterparts.
This is backwards incompatible for strings containing backslashes, but
for some of those strings, the pickling was already broken.
Fred Drake [Mon, 18 Dec 2000 13:50:24 +0000 (13:50 +0000)]
Do not talk about "real" numbers; talk about "floats" or "floating point
numbers" instead; we have not described "reals" anywhere else in the
documentation, and this is not the place to change the story!
Fred Drake [Thu, 14 Dec 2000 18:36:12 +0000 (18:36 +0000)]
For the title page, insert the package version number before the date.
This makes the title area more like the title are of the top-level
index, and puts the information more people are interested in first.
Fred Drake [Thu, 14 Dec 2000 18:16:11 +0000 (18:16 +0000)]
Lots of small bug fixes and DOM API conformance improvements:
Make Node inherit from xml.dom.Node to pick up the NodeType values
defined by the W3C recommendation.
When raising AttributeError, be sure to provide the name of the attribute
that does not exist.
Node.normalize(): Make sure we do not allow an empty text node to survive
as the first child; update the sibling links properly.
_getElementsByTagNameNSHelper(): Make recursive calls using the right
number of parameters.
Attr.__setattr__(): Be sure to update name and nodeName at the same time
since they are synonyms for this node type.
AttributeList: Renamed to NamedNodeMap (AttributeList maintained as an
alias). Compute the length attribute dynamically to allow
the underlying structures to mutate.
AttributeList.item(): Call .keys() on the dictionary rather than using
self.keys() for performance.
Fred Drake [Wed, 13 Dec 2000 16:35:53 +0000 (16:35 +0000)]
Add code to DOMException to ensure it cannot be instantiated directly,
since the API documentation will state specifically that the specializations
must be used by the DOM implementations.
Jack Jansen [Tue, 12 Dec 2000 22:42:30 +0000 (22:42 +0000)]
The Mac C library (MSL from CodeWarrior 6) and I/O library (GUSI
2.1.3) finally agree on when the epoch is, so the code to convert
epochs has been disabled.