Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting docstring starting with "<word>:" raises error #55

Open
cfrings opened this issue Mar 6, 2018 · 0 comments
Open

Starting docstring starting with "<word>:" raises error #55

cfrings opened this issue Mar 6, 2018 · 0 comments

Comments

@cfrings
Copy link

cfrings commented Mar 6, 2018

When processing following file:

class A:

    def __init__(self, x, y):
        """Arguments:
            x - is x
            y - is obviously y
        """
        pass

I get an error:

Traceback (most recent call last):
  File "e:\python34(86)\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\python34(86)\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Python34(86)\Scripts\doxypypy.exe\__main__.py", line 9, in 
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 874, in main
    astWalker.parseLines()
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 757, in parseLines
    self.visit(inAst)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 573, in visit
    return visitor(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 603, in visit_Module
    self.generic_visit(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 558, in generic_visit
    self.visit(item, containingNodes=kwargs['containingNodes'])
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 573, in visit
    return visitor(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 749, in visit_ClassDef
    self.generic_visit(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 558, in generic_visit
    self.visit(item, containingNodes=kwargs['containingNodes'])
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 573, in visit
    return visitor(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 690, in visit_FunctionDef
    containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 429, in _processDocstring
    docstringConverter.send(lineInfo)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 248, in __alterDocstring
    lines[-1], inCodeBlock)
IndexError: list index out of range

If Arguments is replaced with another, non-significant, word (e.g. Lemon), another error is raised:

Traceback (most recent call last):
  File "e:\python34(86)\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\python34(86)\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Python34(86)\Scripts\doxypypy.exe\__main__.py", line 9, in 
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 874, in main
    astWalker.parseLines()
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 757, in parseLines
    self.visit(inAst)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 573, in visit
    return visitor(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 603, in visit_Module
    self.generic_visit(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 558, in generic_visit
    self.visit(item, containingNodes=kwargs['containingNodes'])
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 573, in visit
    return visitor(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 749, in visit_ClassDef
    self.generic_visit(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 558, in generic_visit
    self.visit(item, containingNodes=kwargs['containingNodes'])
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 573, in visit
    return visitor(node, containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 690, in visit_FunctionDef
    containingNodes=containingNodes)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 429, in _processDocstring
    docstringConverter.send(lineInfo)
  File "e:\python34(86)\lib\site-packages\doxypypy\doxypypy.py", line 310, in __alterDocstring
    if lines[-1] == '# @par':

Errors disappear if : is removed from the first line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant