obscure doctest error, triggers IndexError

Kumar McMillan avatarKumar McMillan created an issue

Hi. Sorry that I don't have a better description for this. I have no idea what is breaking. I'm not sure that it is Sphinx's fault or doctest's. I am using Python 2.5

If you want to try it out, here is how to reproduce it using Sphinx 0.6b from PyPI:

hg clone -r 644e09539876 http://bitbucket.org/kumar303/fudge
virtualenv-2.5 _env
source _env/bin/activate
easy_install -U nose Sphinx
cd docs/
make doctest

I am attaching the full Sphinx traceback which ends in:

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py", line 1310, in __patched_linecache_getlines
    example = self.test.examples[int(m.group('examplenum'))]
IndexError: list index out of range

If you want to see the error in my code that causes the bug, you can run:

cd ..

there should be one test failure that I used to debug it (fudge/fudge/tests/test_fudge.py:177)

It is fixed in the tip of my repos. the offending doctest is at fudge/docs/using-fudge.rst:195 ; if you comment out that block and the one after with try/finally then sphinx and doctest do not break.

Comments (6)

  1. Georg Brandl

    This is interesting... I expect it has to do with the way that Sphinx uses doctest. It's probably a bit involved, so I can't debug it right now, but I'm scheduling it for the next milestone.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.