This patch changes the default behaviour of the builtin charmap
codec to not apply Latin-1 mappings for keys which are not found
in the mapping dictionaries, but instead treat them as undefined
mappings.
The patch was originally written by Martin v. Loewis with some
additional (cosmetic) changes and an updated test script
by Marc-Andre Lemburg.
The standard codecs were recreated from the most current files
available at the Unicode.org site using the Tools/scripts/gencodec.py
tool.
Patch by kragen@pobox.com: When tracing is turned on, lines shorter
than a pixel don't get drawn at all. If you're building long curves
made of such lines, this is a bad thing.
Thomas Wouters [Sun, 31 Dec 2000 22:52:59 +0000 (22:52 +0000)]
Change documentation of 'else' clause of 'try/except' to make clear that it
doesn't get triggered by 'return', 'break' or 'continue'. If the
'try-inside-continue' patch does not get accepted before next release, the
'or continue' should be removed ;P
Tim Peters [Sat, 30 Dec 2000 22:21:22 +0000 (22:21 +0000)]
Christmas present to myself: changed regrtest in two ways:
1. When running in verbose mode, if any test happens to pass, print
a warning that the apparent success may be bogus (stdout isn't
compared in verbose mode). Been fooled by that too often.
2. When a test fails because the expected stdout doesn't match the
actual stdout, print as much of stdout as did match before the
first failing write. Else we get failures of the form "expected
'a', got 'b'" and a glance at the expected output file shows
500 instances of 'a' -- no idea where it failed, and, as in #1,
trying to run in verbose mode instead doesn't help because
stdout isn't compared then.
Tim Peters [Fri, 29 Dec 2000 02:17:56 +0000 (02:17 +0000)]
getopt used to sort the long option names, in an attempt to simplify
the logic. That resulted in a bug. My previous getopt checkin repaired
the bug but left the sorting. The solution is significantly simpler if
we don't bother sorting at all, so this checkin gets rid of the sort and
the code that relied on it.
Tim Peters [Fri, 29 Dec 2000 02:06:45 +0000 (02:06 +0000)]
Fred, THIS NEEDS DOCS! The function docstrings tell the tale.
Christmas present to myself: the bisect module didn't define what
happened if the new element was already in the list. It so happens
that it inserted the new element "to the right" of all equal elements.
Since it wasn't defined, among other bad implications it was a mystery
how to use bisect to determine whether an element was already in the
list (I've seen code that *assumed* "to the right" without justification).
Added new methods bisect_left and insort_left that insert "to the left"
instead; made the old names bisect and insort aliases for the new names
bisect_right and insort_right; beefed up docstrings to explain what
these actually do; and added a std test for the bisect module.
Martin v. Löwis [Thu, 28 Dec 2000 18:40:56 +0000 (18:40 +0000)]
Merge changes up to 1.10 from PyXML:
- implement hasAttribute and hasAttributeNS (1.7)
- Node.replaceChild(): Update the sibling nodes to point to newChild. Set
the .nextSibling attribute on oldChild instead of adding a .newChild
attribute (1.9).
Barry Warsaw [Wed, 27 Dec 2000 17:41:47 +0000 (17:41 +0000)]
(python-font-lock-keywords): Add highlighting of `as' as a keyword,
but only in "import foo as bar" statements (including optional
preceding `from' clause).
Tim Peters [Wed, 27 Dec 2000 08:05:05 +0000 (08:05 +0000)]
Fix for SF bug
https://sourceforge.net/bugs/?func=detailbug&bug_id=126863&group_id=5470
"getopt long option handling broken". Tossed the excruciating logic in
long_has_args in favor of something obviously correct.
Fred Drake [Sat, 23 Dec 2000 22:12:07 +0000 (22:12 +0000)]
The "context" parameter to the ExternalEntityRefParameter exposes internal
information from the Expat library that is not part of its public API.
Do not print this information as the format of the string may (and will)
change as Expat evolves.
Add additional tests to make sure the ParserCreate() function raises the
right exceptions on illegal parameters.
Choose the smallest value of x,y for the clock's radius (instead of just taking the
y coordinate), and change radius of second indicator to compensate
Remove redundant setting of sradius
Patch #102813: add a wrapper for the panel library included with ncurses.
Original version written by Thomas Gellekum, reshaped into a separate
module by AMK.
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.