Menu ▾ ▴

#2 Error highlighting?

v1.0 (example)
open
nobody
None
5
2015-02-03
2013-12-07
No

Hi, trying to use your software for the first time, the following exception is generated:

The following error occured during highlighting of differences on the AST level:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/html_report.py", line 208, in writeReport
    d[j] = statements[j].ast_node.as_string()
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 452, in class_as_string
    node.code.as_string())
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 725, in stmt_as_string
    stmts = '\n'.join([n.as_string() for n in node.nodes])
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 534, in function_as_string
    node.code.as_string())
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 725, in stmt_as_string
    stmts = '\n'.join([n.as_string() for n in node.nodes])
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 702, in return_as_string
    return 'return %s' % node.value.as_string()
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 357, in add_as_string
    return '(%s) + (%s)' % (node.left.as_string(), node.right.as_string())
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 357, in add_as_string
    return '(%s) + (%s)' % (node.left.as_string(), node.right.as_string())
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 357, in add_as_string
    return '(%s) + (%s)' % (node.left.as_string(), node.right.as_string())
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 357, in add_as_string
    return '(%s) + (%s)' % (node.left.as_string(), node.right.as_string())
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/clonedigger-1.1.0-py2.7.egg/clonedigger/logilab/astng/nodes.py", line 357, in add_as_string
    return '(%s) + (%s)' % (node.left.as_string(), node.right.as_string())
AttributeError: IfExp instance has no attribute 'as_string'
using diff highlight

Let me know if any environment info is needed, and I will try to get that to you as best I can. My python version is 2.7.5, running on MacOSX 10.8.5. Clonedigger was installed using easy_install and ran by invoking "clonedigger ." in the project's top-level directory (i.e. the same folder including the requirements.txt file)

Discussion

  • James French

    James French - 2013-12-07

    I should note that this is merely the first of many exceptions generated, there are others, in the following order:

    IfExp instance has no attribute 'as_string'
    "logilab/astng/nodes.py", line 402, in assign_as_string
    "logilab/astng/nodes.py", line 357, in add_as_string

    AbstractSyntaxTree instance has no attribute 'ast_node'
    "html_report.py", line 190, in set_as_string_node_parent (occurs 12 times)

    IfExp instance has no attribute 'as_string'
    "logilab/astng/nodes.py", line 702, in return_as_string
    "html_report.py", line 190, in set_as_string_node_parent

     
  • James French

    James French - 2013-12-07

    It appears the program did in fact successfully generate an output.html! Perhaps these errors are merely cosmetic. Thanks for clonedigger, this is very useful!

     

Log in to post a comment.