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 tim.peters
Recipients Arfrever, eli.bendersky, ezio.melotti, larry, mrabarnett, pitrou, python-dev, serhiy.storchaka, tim.peters
Date 2013-08-04.17:19:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375636767.51.0.973205058605.issue18647@psf.upfronthosting.co.za>
In-reply-to
Content
Serhiy, I don't see the regexp '(?:.*$\n?)*' anywhere in doctest.py.  Are you talking about the _EXAMPLE_RE regexp?  That's the closest I see.

If that's the case, the "nothing to repeat" error is incorrect:  _EXAMPLE_RE also contains a negative lookahead assertion '(?![ ]*$)' to ensure that the later '.*$\n?' part never tries to match an empty string.

That said, it takes some intelligence to realize that the negative lookahead assertion prevents repeating an empty match in this regexp, so it may not be easy to fix this false positive.

A compromise may be to replace

.*$\n?

with

.+$\n? | .*$\n

Both branches then "obviously" consume at least one character.
History
Date User Action Args
2013-08-04 17:19:27tim.peterssetrecipients: + tim.peters, pitrou, larry, ezio.melotti, mrabarnett, Arfrever, eli.bendersky, python-dev, serhiy.storchaka
2013-08-04 17:19:27tim.peterssetmessageid: <1375636767.51.0.973205058605.issue18647@psf.upfronthosting.co.za>
2013-08-04 17:19:27tim.peterslinkissue18647 messages
2013-08-04 17:19:27tim.peterscreate