Edward Loper [Fri, 27 Aug 2004 02:07:46 +0000 (02:07 +0000)]
- Removed redundant call to expandtabs in DocTestParesr.
- Improvements to interactive debugging support:
- Changed the replacement pdb.set_trace to redirect stdout to the
real stdout *only* during interactive debugging; stdout from code
continues to go to the fake stdout.
- When the interactive debugger gets to the end of an example,
automatically continue.
- Use a replacement linecache.getlines that will return source lines
from doctest examples; this makes the source available to the
debugger for interactive debugging.
- In test_doctest, use a specialized _FakeOutput class instead of a
temporary file to fake stdin for the interactive interpreter.
Edward Loper [Thu, 26 Aug 2004 18:05:07 +0000 (18:05 +0000)]
- Added DocTestParser.parse(), which parses a docstring into Examples
and intervening text strings.
- Removed DocTestParser.get_program(): use script_from_examples()
instead.
- Fixed bug in DocTestParser._INDENT_RE
- Fixed bug in DocTestParser._min_indent
- Moved _want_comment() to the utility function section
Walter Dörwald [Thu, 26 Aug 2004 16:53:04 +0000 (16:53 +0000)]
Move test_bug1001011() to string_tests.MixinStrUnicodeTest so that
it can be used for str and unicode. Drop the test for
"".join([s]) is s
because this is an implementation detail (and doesn't work for unicode)
Tim Peters [Thu, 26 Aug 2004 05:44:27 +0000 (05:44 +0000)]
output_difference(): In fancy-diff cases, the way this split expected &
actual output into lines created spurious empty lines at the ends of
each. Those matched, but the fancy diffs had surprising line counts (1
larger than expected), and tests kept having to slam <BLANKLINE> into the
expected output to account for this. Using the splitlines() string method
with keepends=True instead accomplishes what was intended directly.
Tim Peters [Thu, 26 Aug 2004 05:21:59 +0000 (05:21 +0000)]
_do_a_fancy_diff(): Pay no attention to the ellipses behind the curtain.
While a fancy diff can be confusing in the presence of ellipses, so far
I'm finding (2-0-0) that it's much more a major aid in narrowing down the
possibilities when an ellipsis-slinging test fails. So we no longer
refuse to do a fancy diff just because of ellipses.
Tim Peters [Thu, 26 Aug 2004 04:47:31 +0000 (04:47 +0000)]
Reorg of exception section. Now that there are fewer details needing
explanation, it's easier to push the remaining insufferably anal details
into a "fine print" section at the bottom.
Edward Loper [Thu, 26 Aug 2004 03:00:24 +0000 (03:00 +0000)]
Changed OutputChecker.output_difference to expect an Example object,
rather than an expected output string. This gives the
output_difference method access to more information, such as the
indentation of the example, which might be useful.
Brett Cannon [Thu, 26 Aug 2004 01:44:07 +0000 (01:44 +0000)]
When building with --disable-toolbox-glue under Darwin, skip building any
Mac-specific modules. Before all modules were compiled but would fail thanks
to a dependence on the code included when Python was built without the compiler
flag.
Edward Loper [Thu, 26 Aug 2004 01:41:51 +0000 (01:41 +0000)]
Renamed UNIFIED_DIFF->REPORT_UDIFF; CONTEXT_DIFF->REPORT_CDIFF; and
NDIFF_DIFF->REPORT_NDIFF. This establishes the naming convention that
all reporting options should begin with "REPORT_" (since reporting
options are a different class from output comparison options; but they
are both set in optionflags).
Edward Loper [Thu, 26 Aug 2004 01:19:50 +0000 (01:19 +0000)]
- Changed the output of report_start() and report_unexpected_exception()
to be more consistent with report_failure()
- If `want` or `got` is empty, then print "Expected nothing\n" or
"Got nothing\n" rather than "Expected:\n" or "Got:\n"
- Got rid of _tag_msg
* Add comment bars segregating this code from the rest.
* Improve readability of the re pattern with indentation and comments on
the same line.
* Replace the groupdict() and get() pair with a direct call to group()
which does the same thing.
Edward Loper [Thu, 26 Aug 2004 00:05:43 +0000 (00:05 +0000)]
Added an "exc_msg" attribute to Example (containing the expected
exception message, or None if no exception is expected); and moved
exception parsing from DocTestRunner to DocTestParser. This is
architecturally cleaner, since it moves all parsing work to
DocTestParser; and it should make it easier for code outside
DocTestRunner (notably debugging code) to properly handle expected
exceptions.
Edward Loper [Wed, 25 Aug 2004 23:07:03 +0000 (23:07 +0000)]
Only recognize the expected output as an exception if it *starts* with
a traceback message. I.e., examples that raise exceptions may no
longer generate pre-exception output. This restores the behavior of
doctest in python 2.3. The ability to check pre-exception output is
being removed because it makes the documentation simpler; and because
there are very few use cases for it.
Bypass peepholing of code with lineno tables having intervals >= 255.
Allows the lineno fixup code to remain simple and not have to deal with
multibyte codings.
* Add an assertion to that effect.
* Remove the XXX comment on the subject.
Barry Warsaw [Wed, 25 Aug 2004 02:22:30 +0000 (02:22 +0000)]
PEP 292 classes Template and SafeTemplate are added to the string module.
This patch includes test cases and documentation updates, as well as NEWS file
updates.
This patch also updates the sre modules so that they don't import the string
module, breaking direct circular imports.
Tim Peters [Wed, 25 Aug 2004 02:14:08 +0000 (02:14 +0000)]
Stop producing or using OverflowWarning. PEP 237 thought this would
happen in 2.3, but nobody noticed it still was getting generated (the
warning was disabled by default). OverflowWarning and
PyExc_OverflowWarning should be removed for 2.5, and left notes all over
saying so.
Skip Montanaro [Tue, 24 Aug 2004 14:26:43 +0000 (14:26 +0000)]
Keep option parser from gobbling up the filename to be profiled and the
flags it accepts. It's too late to change optparse's default behavior now,
but I find the default setting of allow_interspersed_args very weird.
Incorporate review comments courtesy of Neal Norwitz:
* Perform the code length check earlier.
* Eliminate the extra PyMem_Free() upon hitting an EXTENDED_ARG.
* Assert that the NOP count used in jump retargeting matches the NOPs
eliminated in the final step.
* Add an XXX note to indicate that more work is being to done to
handle linenotab with intervals > 255.
* Make a pass to eliminate NOPs. Produce code that is more readable,
more compact, and a tiny bit faster. Makes the peepholer more flexible
in the scope of allowable transformations.
* With Guido's okay, bumped up the magic number so that this patch gets
widely exercised before the alpha goes out.
Tim Peters [Mon, 23 Aug 2004 22:38:05 +0000 (22:38 +0000)]
test_DocTestFinder(): This test failed when test_doctest was run
directly, due to assuming a filename specific to running tests "the
normal way". +ELLIPSIS to the rescue!
Tim Peters [Mon, 23 Aug 2004 21:37:56 +0000 (21:37 +0000)]
debug_script(): I changed this in haste before to take out the use of
NamedTemporaryFile (which can't work for this function's purposes on
Windows). Leaving temp files behind wasn't a great idea either, though,
so try to clean up. At least the test suite no longer leaves any of
these guys behind now.
Dave Cole [Mon, 23 Aug 2004 05:16:23 +0000 (05:16 +0000)]
Updated the socketpair() docstring and documentation to explain that the
default famility is AF_UNIX if defined for the platform, otherwise the
default is AF_INET.
Tim Peters [Mon, 23 Aug 2004 00:26:42 +0000 (00:26 +0000)]
Removed redundant versionadded{} for NDIFF_DIFF. Virtually everything
in this section is new in 2.4, and that's all mentioned already in
versionadded{} thingies at the end of the section. It hurts readability
to have them after every line <wink>.
Tim Peters [Sun, 22 Aug 2004 20:51:53 +0000 (20:51 +0000)]
Start deferring to the LaTeX docs for details. I'd like to move the
docstrings toward being a lot shorter, and telling the whole truth in
the manual instead. This change is an example: the manual has detailed
explanations of the option names now, so it's Bad to repeat them in
the docstring (two detailed descriptions are certain to get out of synch).
Just listing the names has memory-jogging benefits, though, so that's
still helpful in the docstring.
Kurt B. Kaiser [Sun, 22 Aug 2004 05:14:32 +0000 (05:14 +0000)]
1. If user passes a non-existant filename on the commandline, just open
a new file, don't raise a dialog. IDLEfork 954928.
2. Refactor EditorWindow.wakeup() to WindowList.ListedToplevel.wakeup() and
clarify that the Toplevel of an EditorWindow is a WindowList.ListedToplevel.
3. Make a number of improvements to keyboard focus binding. Improve window
raising, especially in the debugger. IDLEfork Bug 763524 (GvR list).
4. Bump idlever to 1.1a3
M Debugger.py
M EditorWindow.py
M FileList.py
M NEWS.txt
M PyShell.py
M WindowList.py
M idlever.py
Tim Peters [Sun, 22 Aug 2004 01:47:51 +0000 (01:47 +0000)]
_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.
Neal Norwitz [Sat, 21 Aug 2004 15:13:52 +0000 (15:13 +0000)]
sf #1009373, #1005936. fix underscores in index entries in PDF files.
I couldn't test this, but it didn't break anything and the patch
reported fixed the problem.
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.
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'.
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.
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.
Edward Loper [Thu, 19 Aug 2004 19:26:06 +0000 (19:26 +0000)]
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.