Commit Graph

3853 Commits

Author SHA1 Message Date
Guido van Rossum 7f9b5e014b OK, changed my mind once more on this. The comparison hierarchy is
now

    None < all numeric types < all other types

so that once again

    map(max, Squares(3), Squares(2))

equals

    [0, 1, 4]
2001-01-22 19:30:07 +00:00
Guido van Rossum d9bae8b95a Numeric-smelling objects now once again compare smaller than
non-numeric ones, so 4 < None again in the 'map' test.
2001-01-22 16:01:24 +00:00
Guido van Rossum 31584cb43d Finn Bock (SF patch #103349):
Allow pickle.py to be using with Jython unicode strings
2001-01-22 14:53:29 +00:00
Guido van Rossum f317a18a4a Finn Bock (SF patch #103345): Avoid outdated exec form in
test_class.py.
2001-01-22 14:51:41 +00:00
Tim Peters 0c94724cc7 Patch #103342: Make shutil.copytree more useful under Jython. 2001-01-21 20:00:00 +00:00
Tim Peters d304f44906 Patch #103343: Allow the important test_pkg to succeed under Jython. 2001-01-21 19:51:53 +00:00
Martin v. Löwis db786876b6 In format(), consider sign only after grouping.
Suggested by Kevin Jacobs in bug report #129417.
2001-01-21 18:52:33 +00:00
Tim Peters 08dabf0a73 Patch #103344: Sort dicts from extcall for easier comparison with Jython. 2001-01-21 18:52:02 +00:00
Tim Peters dfc538acae Whitespace normalization. 2001-01-21 04:49:16 +00:00
Tim Peters 384fd106e8 Bug #128475: mimetools.encode (sometimes) fails when called from a thread.
pythonrun.c:  In Py_Finalize, don't reset the initialized flag until after
the exit funcs have run.
atexit.py:  in _run_exitfuncs, mutate the list of pending calls in a
threadsafe way.  This wasn't a contributor to bug 128475, it just burned
my eyeballs when looking at that bug.
2001-01-21 03:40:37 +00:00
Skip Montanaro eccd02a40d more __all__ updates 2001-01-20 23:34:12 +00:00
Skip Montanaro e78b92a062 added some tests for urlencode 2001-01-20 20:22:30 +00:00
Skip Montanaro e99d5ea25b added __all__ lists to a number of Python modules
added test script and expected output file as well
this closes patch 103297.
__all__ attributes will be added to other modules without first submitting
a patch, just adding the necessary line to the test script to verify
more-or-less correct implementation.
2001-01-20 19:54:20 +00:00
Skip Montanaro c955f89225 docstring typo 2001-01-20 19:12:54 +00:00
Guido van Rossum 6bd6835c1f I've been using gdb a lot lately -- I'm missing 'bt' as a command in
pdb (pdb calls it 'where').  Added 'bt' as an alias for 'where'.
2001-01-20 17:57:37 +00:00
Skip Montanaro 663f6c2ad2 rewrite of robotparser.py by Bastian Kleineidam. Closes patch 102229. 2001-01-20 15:59:25 +00:00
Skip Montanaro a5d23a19e6 modify urlencode so sequences in the dict are treated as multivalued
parameters.  This closes the code part of patch 103314.
2001-01-20 15:56:39 +00:00
Fredrik Lundh f60560626c Better error message if ucnhash cannot be found (obscure attribute
errors aren't that helpful), or doesn't contain what's expected from
it.  Also tweaked the test script so it compiles even if ucnhash is
missing.
2001-01-20 11:15:25 +00:00
Guido van Rossum 0a5f91f1d9 Now that Marc-Andre has retracted unistr(), remove the tests. 2001-01-19 21:57:52 +00:00
Guido van Rossum 48eb9cd62f A hack to augment sys.path with the build/lib.<platform> directory
created by Andrew's setup.py script, *if* we're actually running from
the build directory.  (The test for that: whether the sys.path[-1]
ends in "/Modules".)

This has one disadvantage: it imports a fair amount of code from the
distutils package, just in order to be able to calculate the correct
pathname.  See if I care. :-)
2001-01-19 21:54:59 +00:00
Guido van Rossum a8e14d4d03 Use a saner test filename, to work on Windows. 2001-01-19 21:06:50 +00:00
Moshe Zadka ccc2e3d05d OK, checking in patch 103329.
Please check it against your nearest pop server --
mine doesn't support APOP (I checked I'm getting the same error
message, though)
2001-01-19 19:56:27 +00:00
Barry Warsaw 2e9b396740 Add some regression tests of coredump bugs in funcobject.c 2.31. Also
added a test of a coredump that would occur when del'ing
func_defaults (put here for convenience).
2001-01-19 19:55:12 +00:00
Guido van Rossum a1374e429b Change verify() function to raise TestFailed, not AssertionError.
(I realize that I didn't really test this, because all the tests
succeed, so verify() never raised an AssertionError -- but the test
suite still succeeds, so I'm not too worried.)
2001-01-19 19:01:56 +00:00
Guido van Rossum 10b04180a0 Bump __version__; add authorship note for the BaseServer patch. 2001-01-19 16:45:46 +00:00
Andrew M. Kuchling 989835c9fc Patch #103220 from Jason Tishler:
This patch adds support for Cygwin to util.get_platform(). A Cygwin
  specific case is needed due to the format of Cygwin's uname command,
  which contains '/' characters.
2001-01-19 16:26:12 +00:00
Fredrik Lundh 2acb54a194 improved the ucnhash test a bit 2001-01-19 11:13:46 +00:00
Fredrik Lundh ee865c64da added "getcode" and "getname" methods to the ucnhash module (they're
probably more useful for the test code than for any applications, but
one never knows...)
2001-01-19 11:00:42 +00:00
Fredrik Lundh 0fdb90cafe refactored the unicodeobject/ucnhash interface, to hide the
implementation details inside the ucnhash module.

also cleaned up the unicode copyright blurb a little; Secret Labs'
internal revision history isn't that interesting...
2001-01-19 09:45:02 +00:00
Tim Peters cc58363611 urllib.py very recently changed to produce uppercase escapes, but no
corresponding changes were made to its std test.
2001-01-19 07:00:08 +00:00
Tim Peters 8880f6d3c4 Whitespace normalization. 2001-01-19 06:12:17 +00:00
Tim Peters 1a8a53d16f test_urllib is failing on Windows. I don't know why, but I can at least
change the test to give a clue about *where* it's failing.
2001-01-19 06:06:37 +00:00
Tim Peters 983874dd32 Use constructor form of "raise"; normalize <wink> docstrings. 2001-01-19 05:59:21 +00:00
Tim Peters d93c0b6a37 Jeremy's patch #103323: trivial tests of all untested modules. 2001-01-19 05:41:36 +00:00
Jeremy Hylton 1a34c879bc make the output of _test() suitable for use in the regression test 2001-01-19 03:30:22 +00:00
Guido van Rossum e27a7b8074 Anonymous SF bug 129288: "The python 2.0 urllib has %%%x as a format
when quoting forbidden characters. There are scripts out there that
break with lower case, therefore I guess %%%X should be used."

I agree, so am fixing this.
2001-01-19 03:28:15 +00:00
Jeremy Hylton e1bb5f9814 make error msg more informative when test of exec fails 2001-01-19 03:26:33 +00:00
Jeremy Hylton 047e2c93e2 add test for SyntaxError on
def f(a):
        global a
2001-01-19 03:25:56 +00:00
Jeremy Hylton b4ed8c4db0 add test of bastion and rexec to std regression test suite 2001-01-19 03:22:48 +00:00
Guido van Rossum fc53c13dd5 Checking in a slight variation of Barry's patch 103303. 2001-01-19 02:41:41 +00:00
Guido van Rossum 90cb9067b8 SF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer class
for SocketServer.py (inherited by TCPServer)

Luke wrote:

  The socketserver code, with a little bit of tweaking, can be made
  sufficiently general to service "requests" of any kind, not just by sockets.
  The BaseServer class was created, for example, to poll a table in a MYSQL
  database every 2 seconds. each entry in the table can be allocated a
  Handler which deals with the entry.

  With this patch, using BaseServer and ThreadedServer classes, the creation
  of the server that reads and handles MySQL table entries instead of a
  socket was utterly trivial: about 50 lines of python code.

  You may consider this code to be utterly useless [why would anyone else
  want to do anything like this???] - you are entitled to your opinion. if you
  think so, then think of this: have you considered how to cleanly add SSL to
  the TCPSocketServer? What about using shared memory as the
  communications mechanism for a server, instead of sockets? What about
  communication using files?

  The SocketServer code is extremely good every useful. it's just that as it
  stands, it is tied to sockets, which is not as useful.

I heartily approve of this idea.
2001-01-19 00:44:41 +00:00
Guido van Rossum 2312024eb7 Add test that ensures hash() of objects defining __cmp__ or __eq__ but
not __hash__ raises TypeError.
2001-01-18 23:47:15 +00:00
Guido van Rossum 0c6614c789 Add test that ensures hash([]) and hash({}) raise TypeError. 2001-01-18 23:36:14 +00:00
Guido van Rossum 4e8db2ed9d Since I'm about to check in a change to the recursion-detection code
for comparisons that outlaws requets for ordering on recursive data
structures, remove the tests for ordering recursive data structures.
2001-01-18 21:52:26 +00:00
Guido van Rossum 2f1064c77b A dumb test for the dumdbm module. 2001-01-18 16:46:52 +00:00
Guido van Rossum 890f209619 Add test for comparing recursive data types. 2001-01-18 16:21:57 +00:00
Guido van Rossum 753a68e2cc Bite the bullet: use rich comparisons here, too. 2001-01-18 16:09:55 +00:00
Guido van Rossum 9710bd5deb Add test for misbehaving rich comparisons (always returning 0) --
these fall back to __cmp__.
2001-01-18 15:55:59 +00:00
Guido van Rossum c4a6e8b65a Rich comparison tests 2001-01-18 15:48:05 +00:00
Tim Peters d2bf3b7ca6 Whitespace normalization. Leaving tokenize_tests.py alone for now. 2001-01-18 02:22:22 +00:00
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