question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"SyntaxError: invalid syntax" from running latest diff-cover

See original GitHub issue

diff-cover just started failing in our CI environment, perhaps as a result of the latest release. The same command seemed to work yesterday. Note that the change I made that triggered the latest build did change coverage, and I have not tried to verify whether this error occurs with a different version of diff-cover or with the older version of my project.

Running "shell:diff-cover" (shell) task
Traceback (most recent call last):
  File "/usr/bin/diff-cover", line 9, in <module>
    load_entry_point('diff-cover==1.0.7', 'console_scripts', 'diff-cover')()
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2570, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2230, in load
    return self.resolve()
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2236, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.6/site-packages/diff_cover/tool.py", line 18, in <module>
    from diff_cover.report_generator import (
  File "/usr/lib/python2.6/site-packages/diff_cover/report_generator.py", line 18
    violation.line for violation in violations
                     ^
SyntaxError: invalid syntax

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sgilroycommented, Mar 16, 2019

@Bachmann1234 Sounds good. Thanks Matt! Someone else had updated the version of diff-cover (from some significantly earlier version) without me realizing it. The release of 1.0.7 seems to have just been a coincidence. Thanks for maintaining a great project that continues to be very valuable to our team!

0reactions
Bachmann1234commented, May 31, 2019

This is a dead issue but talking somewhere I just realized there is a fairly easy work around if you wanted you update diff cover without updating your other python stuff

Diff cover is a tool not a library. So it’s not like it would break your code to remove diff cover from the dependencies of your project and have a separate and more modern python interpreter installed just to run tools.

Your call if it’s worth it but just thought I’d put it here for the record

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid Syntax in Python: Common Reasons for SyntaxError
This means that the Python interpreter got to the end of a line (EOL) before an open string was closed. To fix this,...
Read more >
SyntaxError: invalid syntax when using match case [closed]
I'm aware that match cases are quite new to python, but I'm using 3.10 so I'm not sure why they always return this...
Read more >
SyntaxError: invalid syntax when running supervisor-stdout ...
The problem I installed supervisor using pip like: pip install supervisor supervisor-stdout Installation was succesful.
Read more >
How to Fix Invalid SyntaxError in Python - Rollbar
The Python SyntaxError occurs when the interpreter encounters invalid syntax in code. Learn how to fix it.
Read more >
Programming with Python: Errors and Exceptions
In that case, hopefully the custom error message is informative enough to help you figure out what went wrong. Syntax Errors. When you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found