pep8 crashes, integrated with emacs when in python-mode

Bug #741381 reported by Chad Sillitoe
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PEP 8
New
Undecided
Unassigned
emacs23 (Ubuntu)
Invalid
Undecided
Unassigned
pep8 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: pep8

pep8 runs every time I update an emacs buffer in python-mode. Crashes nearly every time I type something new. Not really sure what is going on.

ProblemType: Crash
DistroRelease: Ubuntu 11.04
Package: pep8 0.5.0-1
ProcVersionSignature: Ubuntu 2.6.38-7.38-generic 2.6.38
Uname: Linux 2.6.38-7-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Wed Mar 23 17:36:41 2011
ExecutablePath: /usr/bin/pep8
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100427.1)
InterpreterPath: /usr/bin/python2.7
ProcCmdline: /usr/bin/python /usr/bin/pep8 --repeat genetic_flymake.py
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_US.UTF-8
 LANGUAGE=en_US:en
PythonArgs: ['/usr/bin/pep8', '--repeat', 'genetic_flymake.py']
SourcePackage: pep8
Title: pep8 crashed with TokenError in generate_tokens(): ('EOF in multi-line statement', (179, 0))
UpgradeStatus: Upgraded to natty on 2011-03-23 (0 days ago)
UserGroups: adm admin cdrom dialout lpadmin nopasswdlogin plugdev sambashare

Revision history for this message
Chad Sillitoe (cs-sillitoe-deactivatedaccount) wrote :
tags: removed: need-duplicate-check
Chuck Short (zulcss)
visibility: private → public
Revision history for this message
Dave Walker (davewalker) wrote :

Thanks for the bug report.

Generating TokenError is not necessarily an error with pep8, it's something that is usually handed by modules which import pep8 and use it in a python way. This issue seems to be raised when pep8 cannot parse the syntax.

Not being that familiar with emacs/python-mode i'm not entirely sure, but the ProcCmdline suggests that pep8 is being invoked directly; meaning the error cannot be handled?

Adding emacs to the bug report, and it could be that which is improperly handling the return. We really need some clarification on /where/ the bug is.

Thanks.

Changed in pep8 (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
Changed in emacs23 (Ubuntu):
status: New → Invalid
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

pep8 should not allow this exception from some other library to bubble up through it. I've cofirmed that PEP8 throws an exception with this script:

a(

Traceback (most recent call last):
  File "/usr/bin/pep8", line 9, in <module>
    load_entry_point('pep8==0.6.1', 'console_scripts', 'pep8')()
  File "/usr/lib/python2.7/dist-packages/pep8.py", line 1346, in _main
    runner(path)
  File "/usr/lib/python2.7/dist-packages/pep8.py", line 1027, in input_file
    errors = Checker(filename).check_all()
  File "/usr/lib/python2.7/dist-packages/pep8.py", line 953, in check_all
    for token in tokenize.generate_tokens(self.readline_check_physical):
  File "/usr/lib/python2.7/tokenize.py", line 357, in generate_tokens
    raise TokenError, ("EOF in multi-line statement", (lnum, 0))
tokenize.TokenError: ('EOF in multi-line statement', (2, 0))

I opened the following bug upstream:

https://github.com/jcrocholl/pep8/issues/63

Changed in pep8 (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Clint Byrum (clint-fewbar) wrote :
tags: added: upstream
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

1.1 just landed in quantal with this fix, closing bug as Fix Released.

Changed in pep8 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.