1. Ned Batchelder
  2. coverage.py
  3. Issues
Issue #47 resolved

coverage.py fail on Synax Error: invalid syntax

created an issue

Coverage.py 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/test_all.py 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/cmdline.py", 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/cmdline.py", 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/execfile.py", line 43, in run_python_file exec_function(source, filename, main_mod.dict) File "<exec_function>", line 2, in exec_function File "test/test_all.py", line 59

SyntaxError: invalid syntax


Branch cb8970df breaks coverage.py Branch ccd69d1 does not break coverage.py git://github.com/merriam/dectools

Hope you enjoyed Pycon. Loved your talk. email if you have questions; charles.merriam@gmail.com

Comments (1)

  1. Log in to comment