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.

Title: doctest gets line numbers wrong due to quotes in comments
Type: Stage:
Components: Tests Versions: Python 2.7, Python 2.6
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: flox, ggenellina, guyer
Priority: normal Keywords: patch

Created on 2008-12-22 18:26 by guyer, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
doctest_find_lineno.diff guyer, 2008-12-22 18:26 patch against r67899
Messages (3)
msg78206 - (view) Author: (guyer) Date: 2008-12-22 18:26
My text editor places a comment block at the top of each source file with 
a block of information about the author, the project, license, etc. One 
(rather pointless) line of this block looks like

 # FILE: ""

The re in `_find_lineno()` misinterprets this line as the beginning of the 
docstring. I believe the attached patch maintains the spirit of the re, 
while avoiding this false positive.
msg78310 - (view) Author: Gabriel Genellina (ggenellina) Date: 2008-12-26 22:00
I could not reproduce the behaviour you describe.
Could you provide a test case? That fails with the current code and is 
fixed after applying your patch.

(BTW, the r.e. should be a raw string literal, even the original one)
msg113417 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-08-09 14:47
Out of date.
Date User Action Args
2022-04-11 14:56:43adminsetgithub: 48976
2010-08-09 14:47:23floxsetstatus: pending -> closed
nosy: + flox
messages: + msg113417

2010-06-25 22:04:00terry.reedysetstatus: open -> pending
resolution: works for me
versions: - Python 2.5, Python 2.4
2008-12-26 22:00:07ggenellinasetnosy: + ggenellina
messages: + msg78310
2008-12-22 18:26:23guyercreate