#254 no information available after ParseError exception

closed-fixed
Edward Loper
5
2008-02-13
2008-02-13
Anonymous
No

I have a module that consistently causes epydoc 3.0.1 to raise a ParseError from line 1820 in docparser.py. The last output is:

Parsing docstrings: pyraf.ipython_api

UNEXPECTED ERROR:
Expected a string

Use --debug to see trace information.

If I use --debug I get the same error with a stack trace of what epydoc was doing.

The bug I am reporting is this: I don't know what the parse error is in my source file, and the exception does not give me any information on how to find it. epydoc should report the file name and line number that it was parsing when it decided to raise the exception.

The command I am using is:

epydoc --config epydoc.cfg -v --debug

The config file is:

[epydoc]
modules: pyraf
output: html
parse: yes
introspect: no

The code for the pyraf module is available from subversion at http://astropy.scipy.org/svn/pyraf/tags/stsci_python_2_6/ -r817

You can send me email at stsci.edu. My email address is sienkiew. (Please don't write out my email address in any public forum, because the spammers have not found me yet.)

Discussion

  • Logged In: NO

    Further information:

    I did a binary search for the offending line. (i.e. delete half the file, see if the error goes away.) In pyraf/ipython_api.py there is a line that says:

    __author__ = '%s <%s>' % Release.authors['Fernando']

    If I trim the entire file down to just that line, I still get the error. If I remove that line, the crash goes away.

     
  • Edward Loper
    Edward Loper
    2008-02-13

    Logged In: YES
    user_id=195958
    Originator: NO

    Anytime that epydoc fails with an 'UNEXPECTED ERROR', it is by definition a bug in epydoc. Given the traceback generated when I run epydoc on your code snippet, I found the bug.

    It's fixed in svn revision 1715. The relevant patch, if you don't want to get epydoc from subversion, is:

    Index: docstringparser.py

    --- docstringparser.py (revision 1712)
    +++ docstringparser.py (working copy)
    @@ -322,7 +322,7 @@
    if field.multivalue and not value:
    try: value = epydoc.docparser.parse_string_list(val_doc.toktree)
    except KeyboardInterrupt: raise
    - except: raise
    + except: pass

    # Add any values that we found.
    for elt in value:

     
  • Edward Loper
    Edward Loper
    2008-02-13

    • status: open --> closed-fixed