From: David G. <go...@py...> - 2003-04-24 19:58:09
|
Aahz wrote: > I'm trying to use:: > > .. include:: ../ToC > > but I get the error message:: > > [Errno 2] No such file or directory: '../../Chapters/Toc'. Obvious question: such a file *does* exist, correct? What's its path? Please show us the command-line you're using. > It appears that this is being caused by the use of > ``utils.relative_path()`` in ``docutils/parsers/rst/directives/misc.py``, > in the ``include()`` function. It's not clear to me why > ``relative_path()`` is returning an incorrect path, but I assume it has > something to do with not correctly handling a parent directory. Question > is, should I waste time tracking down the bug in ``relative_path()``, or > just remove the call from ``include()``? I had thought all the path bugs had been squashed. Drat. Path manipulations are tricky to get right. What you do is up to you. I'll track down the bug eventually, but I can't say when. Go ahead and fix your local copy, but please don't remove the relative_path call from CVS; there's good reason for it. What *would* be a big help would be a minimal unit test case that fails but shouldn't. There are already a bunch of path-related tests in test/test_parsers/test_rst/test_directives/test_include.py; the last one is most relevant. A failing test is even better than a to-do list entry. Before adding a test or fixing code though, please run the test suite to rule out platform- or environment-related issues. -- David Goodger http://starship.python.net/~goodger Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv |