Issues

Issue #130 resolved

obscure doctest error, triggers IndexError

Kumar 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 .. nosetests }}}

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 (7)

  1. Georg Brandl repo owner

    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