kleopatra999 / pysmell

Automatically exported from code.google.com/p/pysmell
0 stars 0 forks source link

Traceback on trying a completion #24

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I have both a PYSMELLTAGS and PYSMELLTAGS.stdlib in the root directory
of Trac trunk.
2. I vim trac/ticket/query.py
3. I do :setlocal omnifunc=pysmell#Complete
4. I go to the bottom of the window, add a new line and at the beginning I
add 'Query.' and then press CTRL-x CTRL-o and get this traceback after a
bit of 'searching'.
Looks like I can reproduce this 100%.

What is the expected output? What do you see instead?

I expected an overview of completions.
I got:

Traceback (most recent call last):
  File "<string>", line 9, in vimcompletePYSMELL
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/idehelpe
r.py",
line 265, in detectCompletionType
    klass, parents = inferInstance(fullPath, AST, lineNo, var, PYSMELLDICT)
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/idehelpe
r.py",
line 105, in inferInstance
    names, klasses = getNames(AST)
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 526, in getNames
    compiler.walk(tree, inferer)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 106, in walk
    walker.preorder(tree, visitor)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 63, in preorder
    self.dispatch(tree, *args) # XXX *args make sense?
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 57, in dispatch
    return meth(node, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 40, in default
    self.dispatch(child, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 57, in dispatch
    return meth(node, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 40, in default
    self.dispatch(child, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 57, in dispatch
    return meth(node, *args)
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 103, in decorated
    self.handleChildren(args[0])
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 504, in handleChildren
    BaseVisitor.handleChildren(self, node)
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 115, in handleChildren
    self.visit(c)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 57, in dispatch
    return meth(node, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 40, in default
    self.dispatch(child, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 57, in dispatch
    return meth(node, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 40, in default
    self.dispatch(child, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 57, in dispatch
    return meth(node, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 40, in default
    self.dispatch(child, *args)
  File "/usr/local/lib/python2.5/compiler/visitor.py", line 57, in dispatch
    return meth(node, *args)
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 102, in decorated
    fun(self, *args, **kwargs)
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 515, in visitAssign
    self.names[name] = getName(node.expr)
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 296, in getName
    return getNameTwo('%s(%s)', notArgs, node.args, rightJ=', ')
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 269, in getNameTwo
    rightJ.join(map(getName, right)))
  File
"/usr/local/lib/python2.5/site-packages/pysmell-0.7.3-py2.5.egg/pysmell/codefind
er.py",
line 323, in getName
    return '%s %r' % (' '.join(map(getName, node.getChildren()[:-1])),
rhs.value)
AttributeError: Name instance has no attribute 'value'

What version of the product are you using? On what operating system?

0.7.3 on Python 2.5 on FreeBSD 7

Original issue reported on code.google.com by asheme...@gmail.com on 29 Apr 2009 at 11:47

GoogleCodeExporter commented 8 years ago
Is there any progress on this bug? It's kinda annoying since pysmell is totally
unusable due to this bug.

Original comment by enteq...@googlemail.com on 4 Jul 2009 at 7:25

GoogleCodeExporter commented 8 years ago
I get the same traceback. 
Latest pysmell from git as of July 13th 2010. Python 2.6 on Ubuntu, vim 7.1.

Original comment by graham_g...@gkgk.org on 14 Jul 2010 at 4:09