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

pyflakes crashes on syntactically correct python syntax #184

Closed
pyflakes-bot opened this issue Oct 27, 2012 · 3 comments
Closed

pyflakes crashes on syntactically correct python syntax #184

pyflakes-bot opened this issue Oct 27, 2012 · 3 comments

Comments

@pyflakes-bot
Copy link

Original report by psychicsurgeon on Launchpad:


This is the code in question

try:
if logger.isEnabledFor(logging.DEBUG):
logger.debug("Writing buffer of %d byts" % len(buf))
pylibg15.write_pixmap(buf)
except IOError as (errno, strerror): #<- Crashes on this line
Slogger.error("Failed to send buffer. %d: %s" % ( errno, strerror ) )
traceback.print_exc(file=sys.stderr)
self.disconnect()

This is the traceback.

Traceback (most recent call last):
File "/usr/local/bin/pydbgr", line 9, in
load_entry_point('pydbgr==0.1.5', 'console_scripts', 'pydbgr')()
File "/usr/local/lib/python2.7/dist-packages/pydbgr-0.1.5-py2.7.egg/pydbgr/cli.py", line 337, in main
normal_termination = dbg.run_script(mainpyfile)
File "/usr/local/lib/python2.7/dist-packages/pydbgr-0.1.5-py2.7.egg/pydbgr/debugger.py", line 207, in run_script
execfile(self.mainpyfile, globals_, locals_)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/run.py", line 234, in
main()
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/run.py", line 82, in main
warnings += check_file(path, complexity)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/run.py", line 27, in check_file
warnings += pyflakes.checkPath(path)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 656, in checkPath
return check(open(filename, 'U').read() + '\n', filename)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 707, in check
w = Checker(tree, filename)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 192, in init
self._runDeferred(self._deferredFunctions)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 228, in _runDeferred
handler()
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 571, in runFunction
self.handleNode(stmt, node)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 299, in handleNode
handler(node)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 277, in handleChildren
self.handleNode(node, tree)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 299, in handleNode
handler(node)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 277, in handleChildren
self.handleNode(node, tree)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 299, in handleNode
handler(node)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 277, in handleChildren
self.handleNode(node, tree)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 299, in handleNode
handler(node)
File "/usr/local/lib/python2.7/dist-packages/flake8-1.5-py2.7.egg/flake8/pyflakes.py", line 340, in EXCEPTHANDLER
name = node.name.id
AttributeError: 'Tuple' object has no attribute 'id'

I agree that this particular piece of code is VERY poor and only kind of works. But it's not my code, and pyflakes should handle it since it technically is valid syntax.

@pyflakes-bot
Copy link
Author

Original comment by florent.x (@florentx?) on Launchpad:


With the trunk version I cannot reproduce the issue.

@pyflakes-bot
Copy link
Author

Original comment by icordasc (@sigmavirus24?) on Launchpad:


I can not reproduce this either.

@pyflakes-bot
Copy link
Author

Original comment by florent.x (@florentx?) on Launchpad:


released with 0.6.1

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