#313 splitdrive error

v3.0
open
nobody
None
5
2009-06-26
2009-06-26
AndiDog
No

I have a project with a very simple module documentation that should work 100%. epydoc gives me the following error

Traceback (most recent call last):-] Building documentation: somemodule...
File "C:\Program Files\Python\Scripts\epydoc.py", line 16, in <module>
cli()
File "C:\Program Files\Python\lib\site-packages\epydoc\cli.py", line 965, in cli
main(options, names)
File "C:\Program Files\Python\lib\site-packages\epydoc\cli.py", line 757, in main
exclude_parse=exclude_parse)
File "C:\Program Files\Python\lib\site-packages\epydoc\docbuilder.py", line 206, in build_doc_index
doc_pairs = _get_docs_from_items(items, options)
File "C:\Program Files\Python\lib\site-packages\epydoc\docbuilder.py", line 398, in _get_docs_from_items
item, doc_pairs[-1], options, progress_estimator)
File "C:\Program Files\Python\lib\site-packages\epydoc\docbuilder.py", line 567, in _get_docs_from_submodules
package_dir = os.path.split(pkg_docs[0].filename)[0]
File "C:\Program Files\Python\lib\ntpath.py", line 170, in split
d, p = splitdrive(p)
File "C:\Program Files\Python\lib\ntpath.py", line 125, in splitdrive
if p[1:2] == ':':
AttributeError: _Sentinel instance has no attribute '__getitem__'

With "--parse-only" the error does not occur so it must be some kind of problem with the introspection. The following patch (let's call it hack) will fix it, but I don't know why:

In "docbuilder.py", after line 565 ("pkg_path = pkg_docs[0].path"), add the line

if str(pkg_docs[0].filename) == "<UNKNOWN>": return []

Hope you can fix that ;)

Discussion