This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nouri
Recipients nouri
Date 2007-10-22.20:19:05
SpamBayes Score 0.047996964
Marked as misclassified No
Message-id <1193084346.99.0.810572537289.issue1312@psf.upfronthosting.co.za>
In-reply-to
Content
doctest.DocTestParser._EXCEPTION_RE does not allow for output before the
actual traceback.

Attached is a simple test that demonstrates the problem.  This patch
fixes it:

--- /usr/lib/python2.5/doctest.py 2007-10-22 21:45:21.000000000 +0200
+++ /home/daniel/tmp/doctest.py       2007-10-22 22:19:12.000000000 +0200
@@ -513,7 +513,7 @@
     _EXCEPTION_RE = re.compile(r"""
         # Grab the traceback header.  Different versions of Python have
         # said different things on the first traceback line.
-        ^(?P<hdr> Traceback\ \(
+        .*^(?P<hdr> Traceback\ \(
             (?: most\ recent\ call\ last
             |   innermost\ last
             ) \) :


    _EXCEPTION_RE = re.compile(r"""
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        """, re.VERBOSE | re.MULTILINE | re.DOTALL)
Files
File name Uploaded
doctest-bug.py nouri, 2007-10-22.20:19:05
History
Date User Action Args
2007-10-22 20:19:07nourisetspambayes_score: 0.047997 -> 0.047996964
recipients: + nouri
2007-10-22 20:19:07nourisetspambayes_score: 0.047997 -> 0.047997
messageid: <1193084346.99.0.810572537289.issue1312@psf.upfronthosting.co.za>
2007-10-22 20:19:06nourilinkissue1312 messages
2007-10-22 20:19:05nouricreate