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 fail on Synax Error: invalid syntax #47

nedbat opened this issue Feb 22, 2010 · 1 comment
Closed fail on Synax Error: invalid syntax #47

nedbat opened this issue Feb 22, 2010 · 1 comment
bug Something isn't working


Copy link

nedbat commented Feb 22, 2010

Originally reported by charles.merriam (Bitbucket: charles.merriam, GitHub: Unknown) fails when the last line on the source file does not end in a LF. This is a known exec() wart. Lines with just spaces in the last line do trigger this failure. Usually, people just a "LF" to be sure.


(live_dectools)~/p/decorator_toolkit/dectools (master)$ coverage run test/
Traceback (most recent call last):
  File "/home/chasm/.virtualenvs/live_dectools/bin/coverage", line 8, in <module>
    load_entry_point('coverage==3.2', 'console_scripts', 'coverage')()
  File "/home/chasm/.virtualenvs/live_dectools/lib/python2.6/site-packages/coverage-3.2-py2.6-linux-i686.egg/coverage/", line 590, in main
    status = CoverageScript().command_line(sys.argv[1:])
  File "/home/chasm/.virtualenvs/live_dectools/lib/python2.6/site-packages/coverage-3.2-py2.6-linux-i686.egg/coverage/", line 468, in command_line
    self.run_python_file(args[0], args)
  File "/home/chasm/.virtualenvs/live_dectools/lib/python2.6/site-packages/coverage-3.2-py2.6-linux-i686.egg/coverage/", line 43, in run_python_file
    exec_function(source, filename, main_mod.__dict__)
  File "<exec_function>", line 2, in exec_function
  File "test/", line 59
SyntaxError: invalid syntax

Branch cb8970df (bb) breaks
Branch ccd69d1 (bb) does not break

Hope you enjoyed Pycon. Loved your talk. email if you have questions;

Copy link
Owner Author

nedbat commented Feb 23, 2010

I could have sworn I've dealt with this in the past, but it needed fixing, so fixed it got, in <<changeset c58e0c844834 (bb)>>.

@nedbat nedbat closed this as completed Feb 23, 2010
@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
bug Something isn't working
None yet

No branches or pull requests

1 participant