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 Devin Jeanpierre
Recipients Devin Jeanpierre
Date 2011-04-22.19:31:20
SpamBayes Score 2.6675427e-05
Marked as misclassified No
Message-id <1303500682.88.0.595944133083.issue11909@psf.upfronthosting.co.za>
In-reply-to
Content
From the doctest source:

'Option directives are comments starting with "doctest:".  Warning: this may give false  positives for string-literals that contain the string "#doctest:".  Eliminating these false positives would require actually parsing the string; but we limit them by ignoring any line containing "#doctest:" that is *followed* by a quote mark.'

This isn't a huge deal, but it's a bit annoying. Above being confusing, this is in contradiction with the doctest documentation, which states:

'Doctest directives are expressed as a special Python comment following an example’s source code'

No mention is made of this corner case where the regexp breaks.

As per the comment in the source, the patched version parses the source using the tokenize module, and runs a modified directive regex on all comment tokens to find directives.
History
Date User Action Args
2011-04-22 19:31:22Devin Jeanpierresetrecipients: + Devin Jeanpierre
2011-04-22 19:31:22Devin Jeanpierresetmessageid: <1303500682.88.0.595944133083.issue11909@psf.upfronthosting.co.za>
2011-04-22 19:31:22Devin Jeanpierrelinkissue11909 messages
2011-04-22 19:31:21Devin Jeanpierrecreate