Commit Graph

3853 Commits

Author SHA1 Message Date
Fredrik Lundh f785042433 a bold attempt to fix things broken by MAL's verify patch: import
'verify' iff it's used by a test module...
2001-01-17 21:51:36 +00:00
Guido van Rossum f27cc5bc74 Marc-Andre must not have run these tests -- they used verify() but
didn't import it.  Also got rid of some inconsistent spaces inside
parentheses in test_gzip.py.
2001-01-17 21:43:06 +00:00
Marc-André Lemburg 3661908a6a This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 19:11:13 +00:00
Tim Peters 8551dd6078 Stop creating an unbounded number of "Jack is my hero" files under Windows.
Not that Jack doesn't deserve them, but saying it so often cheapens the
sentiment.
2001-01-17 18:59:46 +00:00
Marc-André Lemburg ad7c98e264 This patch adds a new builtin unistr() which behaves like str()
except that it always returns Unicode objects.

A new C API PyObject_Unicode() is also provided.

This closes patch #101664.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 17:09:53 +00:00
Andrew M. Kuchling c14fa303e1 Patch #103279: sysconfig.py always looks for versions of files in
sys.prefix + 'config/Makefile'. When building Python for the first
time, these files aren't there, so the files from the build tree have
to be used instead; this file adds an entry point for specifying that
the build tree files should be used.  (Perhaps 'set_python_build' should
should be preceded with an underscore?)
2001-01-17 15:16:52 +00:00
Guido van Rossum 846d6dbbe6 Fix a bizarre typo in the helper class ComparableException: the
__getattr__() method, which clearly (like the other methods) was
intended to pass the __getattr__() call on to the self.err object,
mistakenly returned getattr(self, self.err) rather than
getattr(self.err, attr).  Since self.err is not a string, this always
raises a TypeError.  Apparently that doesn't bother for the one
attribute for which __getattr__() is actually called ('__coerce__'),
but it broke the rich comparisons stuff that I'm trying to get into
shape, so I'm fixing this now.  (I could also simply remove the
__getattr__() method, but fixing it seems more in the spirit of what
the ComparableException class is trying to do.)
2001-01-17 15:08:37 +00:00
Marc-André Lemburg d2ebe8775e Changed name of codec to full path name. This allows importing
the test_charmapcodec test via the test package.
2001-01-17 15:07:00 +00:00
Tim Peters 70c4378dbc Whitespace normalization. 2001-01-17 08:48:39 +00:00
Guido van Rossum e69d3d7587 Use __name__ instead of "test_regex" as the module name in the
warnings.filterwarnings() call.  This suppresses the warning when the
module is imported with its full name (test.test_regex) too.
2001-01-17 03:12:01 +00:00
Andrew M. Kuchling b11bd03626 Fix bugs with integer-valued variables when parsing Makefiles. Values
for done[n] can be integers as well as strings, but the code
concatenates them with strings (fixed by adding a str()) and calls
string.strip() on them (fixed by rearranging the logic)

(Presumably this wasn't noticed previously because parse_makefile()
was only called on Modules/Makefile, which contains no integer-valued
variables.)
2001-01-16 16:33:28 +00:00
Andrew M. Kuchling 9710297e36 Modified version of a patch from Jeremy Kloth, to make .get_outputs()
produce a list of unique filenames:
    "While attempting to build an RPM using distutils on Python 2.0,
    rpm complained about duplicate files.  The following patch fixed
    that problem.
2001-01-16 16:16:03 +00:00
Eric S. Raymond bddbaf7023 Make pop_source and push_source available, as documented. 2001-01-16 15:19:13 +00:00
Marc-André Lemburg 3a645e4dd4 Added checks to prevent PyUnicode_Count() from dumping core
in case the parameters are out of bounds and fixes error handling
for .count(), .startswith() and .endswith() for the case of
mixed string/Unicode objects.

This patch adds Python style index semantics to PyUnicode_Count()
indices (including the special handling of negative indices).

The patch is an extended version of patch #103249 submitted
by Michael Hudson (mwh) on SF. It also includes new test cases.
2001-01-16 11:54:12 +00:00
Fredrik Lundh 1c5aa6901f bumped SRE version number to 2.1. cleaned up and added 1.5.2
compatibility patches.
2001-01-16 07:37:30 +00:00
Tim Peters dfb673b457 Whitespace normalization. 2001-01-16 07:12:46 +00:00
Tim Peters 8a7d2d5cb1 doctest-- The Little Module That Could --finally makes it to the Big Show <wink>. 2001-01-16 07:10:57 +00:00
Thomas Wouters 47adcbafc0 Fix for SF bug #123625: some newsservers need 'authinfo' *before* 'mode
readers', others *after*. (Netscape Collabra for the first category,
INN-which-forks-nnrpd for the second.)
2001-01-16 06:35:14 +00:00
Andrew M. Kuchling bd2983caf3 Add strip_dir argument to the single call to .object_filenames(), to
prevent creating files such as build/lib.whatever/Modules/foo.o
    when given a source filename such as Modules/foo.c.
2001-01-16 03:10:43 +00:00
Tim Peters b8c941771a Variant of Skip's patch 103246 (Remove unneeded string exception compat from Queue). 2001-01-15 22:53:46 +00:00
Ka-Ping Yee 10bc59320c Ugh. Sorry. Checked in the wrong file. Please ignore revision 1.3;
it anticipates another patch i was about to propose.
2001-01-15 22:27:06 +00:00
Ka-Ping Yee 27ac0d1ff5 better format names and error messages 2001-01-15 22:21:39 +00:00
Ka-Ping Yee 2057970601 This patch makes sure that the function name always appears in the error
message, and tries to make the messages more consistent and helpful when
the wrong number of arguments or duplicate keyword arguments are supplied.
Comes with more tests for test_extcall.py and and an update to an error
message in test/output/test_pyexpat.
2001-01-15 22:14:16 +00:00
Ka-Ping Yee 1ff08b1243 Add tokenizer support and tests for u'', U"", uR'', Ur"", etc. 2001-01-15 22:04:30 +00:00
Barry Warsaw 534c60f9ab Add a test case suggested by Guido, where a method is created with the
new module.
2001-01-15 21:00:02 +00:00
Barry Warsaw 4a420a0a75 Committing PEP 232, function attribute feature, approved by Guido.
Closes SF patch #103123.

Regression test for function attributes, with output file.
2001-01-15 20:30:15 +00:00
Guido van Rossum afc4f0413a - Make sure to quote the username and password (SF patch #103236 by
dogfort).

- Don't drop the data argument when calling open_https() from the
  authentication error handler.
2001-01-15 18:31:13 +00:00
Fredrik Lundh 2e24044f9d from the really-stupid-bug department: uppercase literals should match
uppercase strings also when the IGNORECASE flag is set (bug #128899)

(also added test cases for recently fixed bugs to the regression suite
-- or in other words, check in re_tests.py too...)
2001-01-15 18:28:14 +00:00
Guido van Rossum 48450cf0a9 mwh@sourceforge found that UnicodeError can be raised by compiling.
Its base class ValueError can be raised too, so catch that.
2001-01-15 18:13:35 +00:00
Guido van Rossum e6ccf3ab96 Default to passive mode. See SF bug #126851.
This is slightly controversial, but after reading the argumentation in
the bug tracker for and against, I believe this is the right solution.
Let me know if it breaks for you, and how.
2001-01-15 16:32:49 +00:00
Andrew M. Kuchling 3f819ec2ed Fix from Jack Jansen for the Mac and the Metrowerks compiler, posted
to the Distutils-SIG and archived at
http://mail.python.org/pipermail/distutils-sig/2000-November/001755.html
2001-01-15 16:09:35 +00:00
Guido van Rossum fd97a919ff Revert a change I accidentally checked in together with Ping's
"smallest patch ever".
2001-01-15 14:34:20 +00:00
Fredrik Lundh b35ffc0417 added "magic" number to the _sre module, to avoid weird errors caused
by compiler/engine mismatches
2001-01-15 12:46:09 +00:00
Tim Peters e119006e7d Whitespace normalization. Top level of Lib now fixed-point for reindent.py! 2001-01-15 03:34:38 +00:00
Tim Peters b90f89a496 Whitespace normalization. 2001-01-15 03:26:36 +00:00
Tim Peters 495ad3c8cc Whitespace normalization. 2001-01-15 01:36:40 +00:00
Tim Peters 0c9886d589 Whitespace normalization. 2001-01-15 01:18:21 +00:00
Tim Peters 2344fae6d0 Whitespace normalization. 2001-01-15 00:50:52 +00:00
Fredrik Lundh fa25a7d51f -- don't use recursion for unbounded non-greedy repeat
(bugs #115903, #115696)

This is based on a patch by Darrel Gallion.  I'm not 100%
sure about this fix, but I haven't managed to come up with
any test case it cannot handle...
2001-01-14 23:55:55 +00:00
Tim Peters 07e99cb774 Whitespace normalization. 2001-01-14 23:47:14 +00:00
Tim Peters 88869f9787 Whitespace normalization. 2001-01-14 23:36:06 +00:00
Guido van Rossum 752d3f557e - Don't hardcode Unix filename syntax when opening ~/.pdbrc.
- Conform to standard coding style in a few more places.
2001-01-14 23:29:48 +00:00
Guido van Rossum 077153e973 - Use mimetypes.types_map to initialize extensions_map.
- Change the default file type to application/octet-stream.
- Add support to recognize .py, .c, .h files as text/plain (this is
  what I use most :-).
2001-01-14 23:21:25 +00:00
Guido van Rossum 2d3eb133b7 SF Patch #103211.
Ping apparently doesn't check in Accepted patches, so I'm doing this
for him.

According to Ping: The name of the controller class should be
"Konqueror", not "Konquerer". (See the website
http://www.konqueror.org/.)
2001-01-14 23:09:35 +00:00
Guido van Rossum c5f15b088f Make the copyright message the same as for the "real" interpreter. 2001-01-14 23:04:22 +00:00
Tim Peters 11cf605f84 Whitespace normalization. 2001-01-14 21:54:20 +00:00
Guido van Rossum f6922aa435 SF Patch #103232 by dougfort: Preserve Nonstandard Port Number in Host
Header

Dougfort's comments: httplib does not include ':port ' in the HTTP 1.1
'Host:' header.  This causes problems if the server is not listening
on Port 80.  The test case I use is the login to /manage under Zope,
with Zope listening on port 8080. Zope returns a <frameset> with the
<frame> source URLs lacking the :8080.
2001-01-14 21:03:01 +00:00
Fredrik Lundh 470ea5ab94 SRE: stricter pattern syntax checking (covers parts of bug #115900) 2001-01-14 21:00:44 +00:00
Tim Peters 146965abf2 Whitespace standardization. 2001-01-14 18:09:23 +00:00
Fredrik Lundh 538f05c94d reapplied Fred's "recommended style" patch... 2001-01-14 15:15:37 +00:00
Fredrik Lundh 770617b23e SRE fixes for 2.1 alpha:
-- added some more docstrings
-- fixed typo in scanner class (#125531)
-- the multiline flag (?m) should't affect the \Z operator (#127259)
-- fixed non-greedy backtracking bug (#123769, #127259)
-- added sre.DEBUG flag (currently dumps the parsed pattern structure)
-- fixed a couple of glitches in groupdict (the #126587 memory leak
   had already been fixed by AMK)
2001-01-14 15:06:11 +00:00
Guido van Rossum 9464a7de60 - Added keyword argument 'append' to filterwarnings(); if true, this
appends to list of filters instead of inserting at the front.  This
  is useful to add a filter with a lower priority than -W options.

- Cosmetic improvements to a docstring and an error message.
2001-01-14 14:08:40 +00:00
Tim Peters 8373218e28 Reverting a dumb experimental version I checked in by mistake. 2001-01-14 05:12:40 +00:00
Tim Peters 2caf8df868 SF bug 128713: type(mmap_object) blew up on Linux. 2001-01-14 05:05:51 +00:00
Guido van Rossum 3ad167ae34 mwh: [ Patch #103228 ] traceback.py nit.
When the exception has no message, don't insert a colon after the
exception name.
2001-01-13 22:14:31 +00:00
Guido van Rossum 4ec59c75e3 SF Patch #103227 by mwh: make code.py appreciate softspace 2001-01-13 22:10:41 +00:00
Tim Peters 5ceadc8cba No text file relying on significant trailing whitespace is robust under
modification.  Removed the need for that.
2001-01-13 19:16:21 +00:00
Guido van Rossum b2825205a2 SF Patch #103225 by Ping: httplib: smallest Python patch ever
The ASCII-art diagram at the top of httplib contains a backslash at
  the end of a line, which causes Python to remove the newline. This
  one-character patch adds a space after the backslash so it will
  appear at the end of the line in the docstring as intended.
2001-01-13 16:55:33 +00:00
Tim Peters 73cbc5e616 Fix stupidity. 2001-01-13 03:45:59 +00:00
Tim Peters 9fadfb0d1d Guido found a brand new race in tempfile on Linux, due to Linux changing
pid across threads (but in that case, it's still the same process, and so
still sharing the "template" cache in tempfile.py).  Repaired that, and
added a new std test.
On Linux, someone please run that standalone with more files and/or more
threads; e.g.,

    python lib/test/test_threadedtempfile.py -f 1000 -t 10

to run with 10 threads each creating (and deleting) 1000 temp files.
2001-01-13 03:04:02 +00:00
Tim Peters 1baa22aff0 A variant of SF patch 103028 (Make tempfile.mktemp threadsafe).
Tested on Windows.  Should be tested on Linux.  Should also be
tested on some platform without threads (I simulated that by
making the "import thread" fail, but that's not the same as
actually doing it!).
2001-01-12 10:02:46 +00:00
Andrew M. Kuchling 0d36206afd Delete unused import of pprint module 2001-01-11 15:35:16 +00:00
Martin v. Löwis bb0a4b7898 Patch #103134: Support import lines in pth files. 2001-01-11 13:02:43 +00:00
Guido van Rossum 62c11155eb Adapted version of SF Patch #103173 by pyretic: make uu.decode work
with spaces in filename.

I changed the module to use string methods instead of the string
module.  Also, instead of stripping the last character of the filename
(assuming this is the linefeed), I strip trailing whitespace (assuming
creating files with trailing whitespace in their name cannot possibly
be a wise idea).

(Note that I believe that /F's "workaround for broken uuencoders" is
no longer needed since the recent fix to binascii.c, but I'll leave it
in since it appears pretty harmless.)
2001-01-10 19:14:28 +00:00
Marc-André Lemburg ef34274d3b Moved the test codec definition to a new module and updated the test and
codec to test all charmap codec features.

As side-effect of moving the test codec into a new module, the encodings
package codec import mechanism is checked as well.
2001-01-10 10:21:11 +00:00
Tim Peters 58c82f0b56 Assorted xreadlines problems:
Wasn't built on Windows; not in config.c either.
    Module init function missing DL_EXPORT magic.
    test_xreadline output file obviously wrong (started w/ "test_xrl").
    test program very unclear about what was expected.
2001-01-09 23:26:39 +00:00
Guido van Rossum 07b78a8778 Test for xreadline. 2001-01-09 21:47:44 +00:00
Andrew M. Kuchling 705a3ada6f Check in patch #102971: if library_dirs is a string, split it using
os.pathsep
2001-01-09 03:15:47 +00:00
Andrew M. Kuchling 9d56cd100e Patch #102953: Fix bug #125452, where shlex.shlex hangs when it
encounters a string with an unmatched quote, by adding a check for
    EOF in the 'quotes' state.
2001-01-09 03:01:15 +00:00
Fred Drake e1fd5260ea GetoptError is always initialized with exactly two parameters, so simplify
the constructor.
2001-01-08 15:39:32 +00:00
Moshe Zadka b2a0a838e0 Fixed bug which caused HTTPS not to work at all with string URLs 2001-01-08 07:09:25 +00:00
Fred Drake daa823ad9a Text.__init__(): Make sure the data parameter is a string (8-bit or
Unicode); raise TypeError if not.

This closes SF bug #126866.
2001-01-08 04:04:34 +00:00
Tim Peters 3a55f950a9 18 isn't a prime (duh). 2001-01-08 01:17:26 +00:00
Tim Peters 86821b2563 MS Win32 .readline() speedup, as discussed on Python-Dev. This is a tricky
variant that never needs to "search from the right".
Also fixed unlikely memory leak in get_line, if string size overflows INTMAX.
Also new std test test_bufio to make sure .readline() works.
2001-01-07 21:19:34 +00:00
Fred Drake e3fb18c1c4 Add more regression tests, including for the import statement variations.
These will detect regression on SF bug #127271 and other import statement
bugs.
2001-01-07 06:02:19 +00:00
Marc-André Lemburg 1109db443e This patch adds a new feature to the builtin charmap codec:
the mapping dictionaries can now contain 1-n mappings, meaning
that character ordinals may be mapped to strings or Unicode object,
e.g. 0x0078 ('x') -> u"abc", causing the ordinal to be replaced by
the complete string or Unicode object instead of just one character.

Another feature introduced by the patch is that of mapping oridnals to
the emtpy string. This allows removing characters.

The patch is different from patch #103100 in that it does not cause a
performance hit for the normal use case of 1-1 mappings.

Written by Marc-Andre Lemburg, copyright assigned to Guido van Rossum.
2001-01-06 15:09:57 +00:00
Guido van Rossum 4795524101 Speed it up by using readlines(sizehint). It's still slower than
other ways of reading input. :-(

In the process, I added an optional bufsize argument to the input()
function and the FileInput class.
2001-01-05 14:44:39 +00:00
Fred Drake a4d18a008f Add test cases based on RFC 1808. So now we actually have a test suite
the urljoin() function, which exercises the urlparse() and urlunparse()
functions as side effects.

(Moshe, why did we have perfectly empty tests checked in for this?)
2001-01-05 05:57:04 +00:00
Fred Drake 867952f6e4 urlunparse(): Do not add a leading slash to the path if it is empty.
urljoin():  Make this conform to RFC 1808 for all examples given in that
            RFC (both "Normal" and "Abnormal"), so long as that RFC does
            not conflict the older RFC 1630, which also specified
            relative URL resolution.

This closes SF bug #110832 (Jitterbug PR#194).
2001-01-05 05:54:41 +00:00
Fred Drake 1a7aab70d1 When a PyCFunction that takes only positional parameters is called with
an empty keywords dictionary (via apply() or the extended call syntax),
the keywords dict should be ignored.  If the keywords dict is not empty,
TypeError should be raised.  (Between the restructuring of the call
machinery and this patch, an empty dict in this situation would trigger
a SystemError via PyErr_BadInternalCall().)

Added regression tests to detect errors for this.
2001-01-04 22:33:02 +00:00
Neil Schemenauer 0ee7d8233f No more RCmp. 2001-01-04 01:36:50 +00:00
Neil Schemenauer 623116a870 Sequence repeat works now for in-place multiply with an integer type
as the left operand.  I don't know if this is a feature or a bug.
2001-01-04 01:36:25 +00:00
Neil Schemenauer aa726ba991 __rcmp__ no longer gets called on instances. Remove the test for it. 2001-01-04 01:34:52 +00:00
Neil Schemenauer 38f0223c9c Numbers no longer compare smaller than all other types. Fix the only
part of the testsuite that breaks.  The old behavior may be restored.
2001-01-04 01:33:41 +00:00
Jeremy Hylton 5ab366119e Actually call the object with an __call__ method, instead of just
checking if it is callable.  This is the only place in the test suite
where an __call__ method is called.
2001-01-03 23:53:31 +00:00
Marc-André Lemburg a866df806d 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.

This patch closes the bugs #116285 and #119960.
2001-01-03 21:29:14 +00:00
Neil Schemenauer e7e694fd22 Use == rather than cmp(). The return value of cmp() is not well defined when
comparing different types.
2001-01-03 02:13:26 +00:00
Neil Schemenauer 38796d07a5 Use numbers that can be accurately represented on binary machines. I hope
this works on all platforms.
2001-01-03 01:52:11 +00:00
Andrew M. Kuchling 6d0cee1170 Add forgotten import 2001-01-02 20:56:42 +00:00
Guido van Rossum 352ca8cbce Duh. Instead of string.whitespace and string.digits, use isspace()
and isdigit() methods.
2001-01-02 20:36:32 +00:00
Neil Schemenauer fd288c7cd5 Add more tests for compare and coercion in preparation for the coercion
overhaul.  Closes SF patch #102878.
2001-01-02 16:30:31 +00:00
Guido van Rossum a659efe5c7 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.
2001-01-01 19:11:07 +00:00
Andrew M. Kuchling ad4a558af8 Added test case for legal DOM children 2000-12-31 04:03:27 +00:00
Andrew M. Kuchling 291ed4fb3f Patch #102485 ] Check for legal children when adding children to a DOM node 2000-12-31 03:50:23 +00:00
Tim Peters 1a4d77b252 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.
2000-12-30 22:21:22 +00:00
Tim Peters d31b6328e1 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.
2000-12-29 02:17:56 +00:00
Tim Peters 36cdad12dd 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.
2000-12-29 02:06:45 +00:00
Martin v. Löwis 011ea47577 Merge with 1.8 of pulldom.py:
Use types.UnicodeType if available, not type(u"").
2000-12-28 18:43:02 +00:00
Martin v. Löwis 156c337f66 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).
2000-12-28 18:40:56 +00:00
Guido van Rossum 7dd06966cb Make Traceback header conform to new traceback ("innermost last" ->
"most recent call last").
2000-12-27 19:12:58 +00:00
Tim Peters dd699b62c5 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.
2000-12-27 08:05:05 +00:00
Tim Peters da7bf4e236 Add test case for SF bug
https://sourceforge.net/bugs/?func=detailbug&bug_id=126863&group_id=5470
2000-12-27 08:03:20 +00:00
Andrew M. Kuchling 0cc87f37b3 Make isspace(chr(32)) return true 2000-12-26 16:07:59 +00:00
Fred Drake 1e0611b208 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.
2000-12-23 22:12:07 +00:00
Fred Drake 9a1a7dda8f The regression test for the regex module should not trip the deprecation
warning for that module, so suppress just that one warning.
2000-12-23 22:08:27 +00:00
Andrew M. Kuchling 49d27c82e6 Remove superfluous semicolons 2000-12-23 14:20:24 +00:00
Andrew M. Kuchling 9f5eeebb26 Wrapper for _curses_panel module; currently this adds nothing extra
beyond what's in _curses_panel
2000-12-22 21:58:29 +00:00
Andrew M. Kuchling 04a45e9bb1 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.
2000-12-20 14:47:24 +00:00
Andrew M. Kuchling c867f74a10 Change expected message for ValueError, fixing bug #126400 2000-12-20 00:55:46 +00:00
Andrew M. Kuchling 8fe2c12d49 Add forgotten initialization. Fixes bug #120994, "Traceback with
DISTUTILS_DEBUG set"
2000-12-20 00:48:12 +00:00
Guido van Rossum 7292e921fc 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 :-).
2000-12-19 18:25:58 +00:00
Guido van Rossum fad81f0838 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".)
2000-12-19 16:48:13 +00:00
Guido van Rossum 70f128861f Use binary mode to open "wave" files. 2000-12-19 06:32:57 +00:00
Guido van Rossum d1db30b7b5 Improve error messages for invalid warning arguments; don't raise
exceptions but always print a warning message.
2000-12-19 03:04:50 +00:00
Guido van Rossum 5aff7752eb Make string.translate(s, table) work for Unicode s. Two things are
required to work around restrictions on the arguments of
u.translate():

1) don't pass the deletions argument if it's empty;

2) convert table to Unicode if s is Unicode.

This fixes SF bug #124060.
2000-12-19 02:39:08 +00:00
Guido van Rossum 8b26454273 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
2000-12-19 02:22:31 +00:00
Guido van Rossum 8b74b15b92 Test some Unicode pickling endcases. 2000-12-19 02:01:12 +00:00
Guido van Rossum a31b4ef7c5 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.
2000-12-19 01:29:00 +00:00
Neil Schemenauer 99664e455b gdbm.open() no longer accepts garbage in the flags string. Fix the tests. 2000-12-18 17:28:05 +00:00
Fred Drake 95b4ec5fbe Do not assume that types.UnicodeType exists; we might be running in an old
version of Python.  ;-(
2000-12-16 01:45:11 +00:00
Fred Drake 1402ab2cb9 Use the string module instead of string methods; this should still work
with Python 1.5.2 for now.
2000-12-16 01:43:40 +00:00
Fred Drake f16527c863 Typo caught by /F -- thanks! 2000-12-15 23:56:43 +00:00
Guido van Rossum 2a862c614d Python part of the warnings subsystem. 2000-12-15 21:59:53 +00:00
Fred Drake 1703cf662c Before calling traceback.print_exc(), call sys.stdout.flush(). This makes
it much easier to see where things went wrong.
2000-12-15 21:31:59 +00:00
Fred Drake 279aa6cabc DOMException.__init__(): Remember to pass self to Exception.__init__(). 2000-12-15 21:07:59 +00:00
Guido van Rossum 5080b33046 Comment out a debugging print statement that triggered a complaint in
c.l.py.
2000-12-15 20:08:39 +00:00
Guido van Rossum e6e03eafed Get rid of string functions. 2000-12-15 15:49:08 +00:00
Guido van Rossum c80f182dc4 Get rid of string functions. References to string.whitespace,
string.digits are left.
2000-12-15 15:37:48 +00:00
Guido van Rossum 34735a6682 Get rid of string functions.
There should really be a little tool to help with this -- it's rather
tedious and there are lots of special cases!
2000-12-15 15:09:42 +00:00
Guido van Rossum b2493f855a Get rid of string functions, except maketrans() (which is *not*
obsolete!).

Fix a bug in ftpwrapper.retrfile() where somehow ftplib.error_perm was
assumed to be a string.  (The fix applies str().)

Also break some long lines and change the output from test() slightly.
2000-12-15 15:01:37 +00:00
Andrew M. Kuchling 4d192b37ec Add test case for error message raised by bad % format character
(Oh, look, it adds another little utility function for testing)
2000-12-15 13:09:06 +00:00
Fred Drake 3277da0f33 Update the test suite to cover more ground.
This closes patch #102477.
2000-12-14 18:20:22 +00:00
Fred Drake f7cf40d331 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.

AttributeList.setNamedItem(), .setNamedItemNS():
        Added methods.

Text.splitText():
        Added method.

DocumentType:
        Added implementation class.

DOMImplementation:
        Added implementation class.

Document.appendChild():  Do not allow a second document element to be added.

Document.documentElement:  Find this dynamically, so that one can be
        removed and another added.

Document.unlink():  Clear the doctype attribute.

_get_StringIO():  Only use the StringIO module; cStringIO does not support
                  Unicode.
2000-12-14 18:16:11 +00:00
Fred Drake c16adce273 Adjust PullDOM to use a DOMImplementation instance to create new Document
objects; uses minidom if one is not provided to the constructor.

parse():  Pick up the default_bufsize default value dynamically so that
          the value in the module may be (meaningfully) changed at runtime.

This (partially) closes patch #102477.
2000-12-14 18:00:18 +00:00
Fred Drake ec126dab9c When raising KeyError, provide the key value that failed. 2000-12-13 20:48:29 +00:00
Moshe Zadka dd802208a7 Changing allow_reuse_address's default value, and documenting it. 2000-12-13 20:39:22 +00:00
Fred Drake a63bd1c65b Untabify! (Barry, this is gonna cost you a bottle of wine! ;) 2000-12-13 20:23:11 +00:00
Guido van Rossum ff87174db1 Get rid of string module and string exceptions. 2000-12-13 18:11:56 +00:00
Fred Drake 5d1b5eaf55 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.
2000-12-13 16:35:53 +00:00
Martin v. Löwis 64acf1db22 Add standard DOM exception hierarchy. 2000-12-13 14:21:07 +00:00
Fred Drake 8152d32375 Update the code to better reflect recommended style:
Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
2000-12-12 23:20:45 +00:00
Barry Warsaw c140131995 Change the file's indentation from tabs to 4 spaces per level. 2000-12-12 23:16:51 +00:00
Barry Warsaw c7ed0e3c13 Accept Finn Bock's patch #102208 to hardcode EINVAL to 22 when errno
can't be imported.  This makes StringIO.py work with Jython.

Also, get rid of the string module by converting to string methods.

Shorten some lines by using augmented assignment where appropriate.
2000-12-12 23:12:23 +00:00
Fred Drake 132dce2246 Update the code to better reflect recommended style:
Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
2000-12-12 23:11:42 +00:00
Jack Jansen d49056cd90 The ".pth" code knew about the layout of Python trees on unix and
windows, but not on the mac. Fixed.
2000-12-12 22:39:04 +00:00
Guido van Rossum 1072c3872d Add popitem(). 2000-12-12 22:06:00 +00:00
Guido van Rossum b822c6138e Added test for {}.popitem(). 2000-12-12 22:02:59 +00:00
Marc-André Lemburg 988ad2bdff Changed .getaliases() support to register the new aliases in the
encodings package aliases mapping dictionary rather than in the
internal cache used by the search function.

This enables aliases to take advantage of the full normalization
process applied to encoding names which was previously not available.

The patch restricts alias registration to new aliases. Existing
aliases cannot be overridden anymore.
2000-12-12 14:45:35 +00:00
Fred Drake 6bcf4c2a0b Update the docstring.
Add a Node class that defines the NodeType constants, based on discussion
in the XML-SIG.
2000-12-11 22:29:23 +00:00
Fred Drake e1578ce204 Added tests to avoid regression on bug #125375.
roundtrip():  Show the offending syntax tree when things break; this makes
              it a little easier to debug the module by adding test cases.

(Still need better tests for this module, but there's not enough time
 today.)
2000-12-11 22:12:09 +00:00