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

pep8 crashes on incomplete python script #63

Closed
SpamapS opened this issue May 22, 2012 · 2 comments
Closed

pep8 crashes on incomplete python script #63

SpamapS opened this issue May 22, 2012 · 2 comments
Assignees

Comments

@SpamapS
Copy link

SpamapS commented May 22, 2012

pep8 should catch this TokenError and report it as another problem, not crash. With the input file of just 'a(', pep8 crashes as such (v1.0.1):

Traceback (most recent call last):
File "/usr/bin/pep8", line 9, in
load_entry_point('pep8==1.0.1', 'console_scripts', 'pep8')()
File "/usr/lib/python2.7/dist-packages/pep8.py", line 1348, in _main
runner(path)
File "/usr/lib/python2.7/dist-packages/pep8.py", line 1023, in input_file
errors = Checker(filename).check_all()
File "/usr/lib/python2.7/dist-packages/pep8.py", line 949, 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))

@SpamapS
Copy link
Author

SpamapS commented May 22, 2012

Forgot to mention, I began investigating this because of this bug in Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/pep8/+bug/741381

@ghost ghost assigned florentx May 23, 2012
@florentx
Copy link
Contributor

Fixed in trunk with specific error E901.

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

2 participants