Commit Graph

9442 Commits

Author SHA1 Message Date
Tim Peters e594bee535 _ellipsis_match(): Removed special-casing of "...\n". The semantics
are non-obvious either way because the newline character "is invisible",
but it's still there all the same, and it's easier to explain/predict
if that reality is left alone.
2004-08-22 01:47:51 +00:00
Johannes Gijsbers 6abc685a03 Patch #880621: the last message of a Babyl mailbox ends in '\037' instead of
'\037\014\n' (see http://quimby.gnus.org/notes/BABYL) so look for that as well,
so that applications won't get '\037' as the last line of the last message.
2004-08-21 12:30:26 +00:00
Johannes Gijsbers 6d63a8dd09 Patch #1011123: Use urllib.quote() instead of cgi.escape() for encoding the
href attribute in list_directory(). This fixes the links for legal Unix
filenames such as 'a"b'.
2004-08-21 10:43:29 +00:00
Tim Peters 037b3ee44e Patch 1012740: cStringIO's truncate doesn't
truncate() left the stream position unchanged, which meant the
"truncated" data didn't go away:

>>> io.write('abc')
>>> io.truncate(0)
>>> io.write('xyz')
>>> io.getvalue()
'abcxyz'

Patch by Dima Dorfman.
2004-08-21 06:55:43 +00:00
Martin v. Löwis 37af986ebf Bump minimum Python version to 2.1. Fixes #1009803. 2004-08-20 07:31:37 +00:00
Martin v. Löwis 61d77e0d97 Replace tricky and/or with straight-forward if:else: 2004-08-20 06:35:46 +00:00
Martin v. Löwis cd4d297a23 Remove debug print. 2004-08-20 06:19:23 +00:00
Tim Peters a45cacfc1c Whitespace normalization. 2004-08-20 03:47:14 +00:00
Tim Peters 8d7626c23f Stab at SF 1010777: test_queue fails occasionally
test_queue has failed occasionally for years, and there's more than one
cause.

The primary cause in the SF report appears to be that the test driver
really needs entirely different code for thread tests that expect to
raise exceptions than for thread tests that are testing non-exceptional
blocking semantics.  So gave them entirely different code, and added a
ton of explanation.

Another cause is that the blocking thread tests relied in several places
on the difference between sleep(.1) and sleep(.2) being long enough for
the trigger thread to do its stuff sot that the blocking thread could make
progress.  That's just not reliable on a loaded machine.  Boosted the 0.2's
to 10.0's instead, which should be long enough under any non-catastrophic
system conditions.  That doesn't make the test take longer to run, the 10.0
is just how long the blocking thread is *willing* to wait for the trigger
thread to do something.  But if the Queue module is plain broken, such
tests will indeed take 10 seconds to fail now.

For similar (heavy load) reasons, changed threaded-test termination to
be willing to wait 10 seconds for the signal thread to end too.
2004-08-20 03:27:12 +00:00
Tim Peters afe5297b8a Semantic-neutral format and comment changes. 2004-08-20 02:37:25 +00:00
Tim Peters b0a04e1592 Gave _ellipsis_match() an attractive new leading underscore. 2004-08-20 02:08:04 +00:00
Raymond Hettinger 27dbcf2162 Establish policies with respect to 2.3 compatibilty and treated spec
updates as bugfixes.
2004-08-19 22:39:55 +00:00
Raymond Hettinger 6114679099 SF bug #1012315: weakref.WeakValueDictionary should override .has_key()
* Check the found object for a None value during a contains/has_key
  lookup.  Perhaps it will help the OP who is likely suffering from an
  occassional GC or threading object deletion after self.data is checked.

* Complete the previous patch by removing the unnecessary indirection
  for weak dict iterators.  Makes the code cleaner and more readable.
2004-08-19 21:32:06 +00:00
Edward Loper 3a3817f506 Got rid of nooutput() (was used by DocTestCase.debug())
It's redundant, since no output is written anyway: DebugRunner doesn't
generate any output for failures and unexpected exceptions, and since
verbose=False, it won't generate any output for non-failures either.
2004-08-19 19:26:06 +00:00
Edward Loper b7503ff631 Updated __all__ to include every non-underscored class, function, and
constant defined by the module (except the test*() functions, which
should be integrated into test/test_doctest.py, anyway).
2004-08-19 19:19:03 +00:00
Tim Peters 026f8dc103 Now that they've settled down, document doctest directives. 2004-08-19 16:38:58 +00:00
Johannes Gijsbers 3caf9c1edd Port test_zipfile to unittest (patch #736962). 2004-08-19 15:11:50 +00:00
Tim Peters dc5de3bab2 ellipsis_match(): Changed treatment of start- and end-of-string exact
matches to be symmetric.  This makes the algorithm easier to understand.
2004-08-19 14:06:20 +00:00
Tim Peters 26b3ebb515 Replaced the ELLIPSIS implementation with a worst-case linear-time one. 2004-08-19 08:10:08 +00:00
Tim Peters 1cf3aa6e66 ELLIPSIS implementation: an ellipsis couldn't match nothing if it
appeared at the end of a line.  Repaired that.  Also noted that it's
too easy to provoke this implementation into requiring exponential
time, and especially when a test fails.  I'll replace the implementation
with an always-efficient one later.
2004-08-19 06:49:33 +00:00
Brett Cannon caa9798410 Rewrite test_order so as to be more "proper". Originally relied on an
error based on decorating with staticmethod too soon for the code to execute.
This meant that if the test didn't pass it just errored out.  Now if the test
doesn't pass it leads to a failure instead.
2004-08-19 03:48:24 +00:00
Martin v. Löwis babc5ec630 Expand tabs. 2004-08-18 17:47:40 +00:00
Hye-Shik Chang f64700a512 Add support for FreeBSD 6. 2004-08-18 15:13:41 +00:00
Martin v. Löwis 75b9da4aaf Patch #995126: Correct directory size, and generate GNU tarfiles by default. 2004-08-18 13:57:44 +00:00
Martin v. Löwis deacce2c87 Patch #800236: add HTTPResponse.getheaders(). 2004-08-18 12:46:26 +00:00
Johannes Gijsbers c473c99d16 Patch #1006219: let inspect.getsource show '@' decorators and add tests for
this (which are rather ugly, but it'll have to do until test_inspect gets a
major overhaul and a conversion to unittest). Thanks Simon Percivall!
2004-08-18 12:40:31 +00:00
Martin v. Löwis 318a12eb01 Patch #791776: Replace SMTPHandler.date_time with email.Utils.formatdate. 2004-08-18 12:27:40 +00:00
Martin v. Löwis fe84d17a6a Patch #764217: Add nametofont function, exists parameter. 2004-08-18 11:06:45 +00:00
Michael W. Hudson 0ccff074cd This is Mark Russell's patch:
[ 1009560 ] Fix @decorator evaluation order

From the description:

Changes in this patch:

- Change Grammar/Grammar to require
newlines between adjacent decorators.

- Fix order of evaluation of decorators
in the C (compile.c) and python
(Lib/compiler/pycodegen.py) compilers

- Add better order of evaluation check
to test_decorators.py (test_eval_order)

- Update the decorator documentation in
the reference manual (improve description
of evaluation order and update syntax
description)

and the comment:

Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html)

(I'm checking this in for Anthony who was having problems getting SF to
talk to him)
2004-08-17 17:29:16 +00:00
Edward Loper b51b23405b Fixed bug in line-number finding for examples (DocTestParser wasn't
updating line numbers correctly for bare prompts & examples containing
only comments).
2004-08-17 16:37:12 +00:00
Raymond Hettinger f04d8a8898 There are no longer any special case test skips. 2004-08-17 16:34:51 +00:00
Raymond Hettinger 673cb28b2a Remove test of obsolete trim() operation which was supplanted by
normalize() in Draft 1.06 (9 October 2002):

  The normalize operation has been added; it reduces a number to a
  canonical form.  (This replaces the trim operator, which only
  removed trailing fractional zeros.)
2004-08-17 16:27:04 +00:00
Johannes Gijsbers e7691d36b7 Use readline/raw_input() in pydoc.Helper.interact if available and self.input
is sys.stdin. Based on a patch (#726204) by Dmitry Vasiliev and a comment from
Guido in an older patch (#549901).
2004-08-17 13:21:53 +00:00
Thomas Heller 30d0008577 The get_installer_filename() method forgot to return the name it
calculates.  Spotted by Cort Danger Stratton.
2004-08-17 10:15:07 +00:00
Raymond Hettinger 1f65b472c3 SF bug #833957: Ctrl+key combos stop working in IDLE
Make key combinations work with upper and lowercase as is the MS standard.
2004-08-17 08:01:19 +00:00
Raymond Hettinger ba4e47db57 This file is no longer used in version 2.39.
Was supplanted by tointegral.decTest.
2004-08-17 06:56:25 +00:00
Raymond Hettinger 3ee3ed2e80 Add two new files and update remaining tests from the latest update of the
test suite in version 2.39 of dectest.zip.
2004-08-17 06:42:13 +00:00
Raymond Hettinger d6c700a320 Revise max() and min() to comply with the 8/2/2004 update to the specification
(version 1.45):

The max and min operations follow the rules in the current IEEE 754 revision draft:
if one operand is a quiet NaN and the other is number, then the number is always returned
if both operands are finite and equal in numerical value then an ordering is applied:
    if the signs differ then max returns the operand with the positive sign and
    min returns the operand with the negative sign; if the signs are the same then
    the exponent is used to select the result.
2004-08-17 06:39:37 +00:00
Raymond Hettinger f63ba43733 * Dynamically build a list of files to be tested (necessary because
version 2.39 of dectest.zip adds some new test files and because
  some existing test files were getting skipped).
* Remove two docstrings which cluttered unittest's output.
* Simplify a for-loop with a list comprehension.
2004-08-17 05:42:09 +00:00
Barry Warsaw 06fa042034 Test cases and fixes for bugs described in patch #873418: email/Message.py:
del_param fails when specifying a header.
2004-08-16 15:47:34 +00:00
Skip Montanaro d4ff206906 Being bsd-based, darwin/macosx has the same limitation w.r.t. the "echo"
service.
2004-08-16 15:35:54 +00:00
Raymond Hettinger 84f107dd15 Minor formatting cleanup. 2004-08-16 01:45:34 +00:00
Raymond Hettinger 3258e72c82 * Uncomment the SyntaxError doctest after Tim demonstrated how.
* Remove unnecessary sys.PS2 prompt lines.
2004-08-16 01:35:28 +00:00
Matthias Klose 2e829c0214 - Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)). 2004-08-15 17:04:33 +00:00
Brett Cannon add33601c2 Correct the order of application for decorators. Meant to be bottom-up and not
top-down.  Now matches the PEP.
2004-08-15 07:21:25 +00:00
Johannes Gijsbers 9e15dd6861 Let cgi.parse_header() properly unquote headers (patch #1008597). 2004-08-14 15:39:34 +00:00
Johannes Gijsbers 34c4120731 bug #989672: pdb.doc and the help messages for the help_d and help_u methods
of the pdb.Pdb class gives have been corrected. d(own) goes to a newer frame,
u(p) to an older frame, not the other way around.
2004-08-14 15:19:28 +00:00
Johannes Gijsbers 4ec40648a5 bug #990669: os.path.realpath() will resolve symlinks before normalizing the
path, as normalizing the path may alter the meaning of the path if it contains
symlinks.

Also add tests for infinite symlink loops and parent symlinks that need to be
resolved.
2004-08-14 15:01:53 +00:00
Johannes Gijsbers f9a098efe1 Catch OSError raised when src or dst argument to os.path.samefile doesn't
exist.
2004-08-14 14:51:01 +00:00
Johannes Gijsbers 68128715f2 Unwrap too-smart loop: we can't use `src` for both hard and symbolic links. 2004-08-14 13:57:08 +00:00