Thread: [Epydoc-devel] AttributeError: _Sentinel instance has no attribute '__getitem__'
Brought to you by:
edloper
From: Nicholas C. <nic...@gm...> - 2007-03-29 13:17:19
|
Hi. I'm using the latest epidoc beta, and it keeps failing with the following error (I've included the warnings, in case they signify for this issue). If this is a known issue, is there anything I can do in my code as a work-around? Best wishes, N. Warning: Module npyscreen.ActionForm is shadowed by a variable with the same name. Warning: Module npyscreen.NewMenu is shadowed by a variable with the same name. Warning: Module npyscreen.Popup is shadowed by a variable with the same name. Warning: Module npyscreen.FormWithMenus is shadowed by a variable with the same name. Warning: Module npyscreen.NPSApp is shadowed by a variable with the same name. Warning: Module npyscreen.NPSAppManaged is shadowed by a variable with the same name. Warning: npyscreen.Menu shadows itself Warning: npyscreen.Form shadows itself Traceback (most recent call last): Progress: 00:02 File "/Library/Frameworks/Python.framework/Versions/Current/bin/epydoc", line 13, in <module> Writing HTML docs: epydoc.js cli() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/epydoc/cli.py", line 946, in cli main(options, names) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/epydoc/cli.py", line 764, in main write_html(docindex, options) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/epydoc/cli.py", line 804, in write_html html_writer.write(options.target) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/epydoc/docwriter/html.py", line 553, in write indices = {'ident': self.build_identifier_index(), File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/epydoc/docwriter/html.py", line 2817, in build_identifier_index name = plaintext_to_html(doc.canonical_name[-1]) AttributeError: _Sentinel instance has no attribute '__getitem__' |
From: Nicholas C. <nic...@gm...> - 2007-03-29 15:01:30
|
On 3/29/07, Daniele Varrazzo <pi...@de...> wrote: > This bug has been already reported in the tracker, but i wasn't able to > reproduce it yet. > > Is the package you are documenting available on the web or is a private > project? It's a private project (for the moment at least - if only because the documentation is so poor!). > What is the command line you are using? epydoc --debug --output auto-doc/ npyscreen/ (npyscreen is the name of the package) > > Warning: Module npyscreen.ActionForm is shadowed by a variable with the > > same name. > > Correct me: in your package there is a module named "ActionForm.py" > containing a class named "ActionForm"? I suspect that this kind of errors > (and so issues like #1682525) are caused by a name clash like this, but i > don't have a test case yet (the people who reported the issue above gave me > one, but i have to setup a VM to test it and i haven't had the time to do > that yet). Yes, there is. I assume that the error is being caused by the fact that the __init__.py file for the package does things like the following to expose an API: from ActionForm import ActionForm > To work around the bug you may try to --introspect-only or --parse-only. > Please, report success/failures of doing this. --introspect-only fails with the same error --parse-only works perfectly, and doesn't give the warnings above. Instead I get the output I've printed below (minor warnings). Best wishes, Nicholas epydoc --parse-only --debug --output auto-doc/ npyscreen/ Warning: 6 markup errors were found while processing docstrings. Use the verbose switch (-v) to display markup errors. stav092:~/projects/spook/mnpyscreen nicholas$ epydoc -v --parse-only --debug --output auto-doc/ npyscreen/ +---------------------------------------------------------------------------------------------- | File /Users/nicholas/projects/spook/mnpyscreen/npyscreen/NPSAppManaged.py, line 11, in | npyscreen.NPSAppManaged.NPSAppManaged | Warning: Line 13: Lists must be indented. | +---------------------------------------------------------------------------------------------- | File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/textwrap.py, line 33, in | textwrap.TextWrapper | Warning: Lines 41, 42, 44, 45, 47, 48, 50, 51, 54, 55, 59, 60, 63, 64: Improper paragraph | indentation. | +---------------------------------------------------------------------------------------------- | File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/textwrap.py, line 147, | in textwrap.TextWrapper._fix_sentence_endings | Warning: Lines 149, 152: Improper paragraph indentation. | +---------------------------------------------------------------------------------------------- | File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/textwrap.py, line 165, | in textwrap.TextWrapper._handle_long_word | Warning: Line 166: Improper paragraph indentation. | +---------------------------------------------------------------------------------------------- | File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/textwrap.py, line 115, | in textwrap.TextWrapper._munge_whitespace | Warning: Lines 117, 121: Improper paragraph indentation. | +---------------------------------------------------------------------------------------------- | File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/textwrap.py, line 132, | in textwrap.TextWrapper._split | Warning: Lines 137, 139: Improper paragraph indentation. | |
From: Daniele V. <pi...@de...> - 2007-03-29 15:44:46
|
> On 3/29/07, Daniele Varrazzo <pi...@de...> wrote: >> This bug has been already reported in the tracker, but i wasn't able to >> reproduce it yet. >> >> Is the package you are documenting available on the web or is a private >> project? > > It's a private project (for the moment at least - if only because the > documentation is so poor!). > >> What is the command line you are using? > > epydoc --debug --output auto-doc/ npyscreen/ > > (npyscreen is the name of the package) > > >> > Warning: Module npyscreen.ActionForm is shadowed by a variable with the >> > same name. >> >> Correct me: in your package there is a module named "ActionForm.py" >> containing a class named "ActionForm"? I suspect that this kind of errors >> (and so issues like #1682525) are caused by a name clash like this, but i >> don't have a test case yet (the people who reported the issue above gave >> me >> one, but i have to setup a VM to test it and i haven't had the time to do >> that yet). > > Yes, there is. I assume that the error is being caused by the fact that the > __init__.py file for the package does things like the following to > expose an API: > > from ActionForm import ActionForm Great, i'll focus on this issue and try to crash Epydoc like this :) >> To work around the bug you may try to --introspect-only or --parse-only. >> Please, report success/failures of doing this. > > --introspect-only fails with the same error Ok, this further narrows where to look for troubles. > --parse-only works perfectly, and doesn't give the warnings above. > Instead I get the output I've printed below (minor warnings). Those warnings are only about bad Epytext docstring. By default Epydoc expects doctrings formatted in the Epytext markup language, which is widely documented in the manual. You may also choose different markups; specifically, if you want Epydoc to assume no markup, use the --docformat=plaintext command line switch. Thank you very much for the report: i will try to fix the bug and release a beta2 version soon (many bugs have been reported and most of them have been fixed since the beta1 was released). -- Daniele Varrazzo - Develer S.r.l. http://www.develer.com |