eclim/autoload/eclim/python/validate.vim bug: don't assume pyflakes returncode <= 1 #33

edgimar opened this Issue Dec 1, 2010 · 6 comments


None yet

2 participants

edgimar commented Dec 1, 2010

In line 65 of .vim/eclim/autoload/eclim/python/validate.vim, an error is issued for any returncode > 1. With the latest pyflakes versions, the value of the returncode is equal to the number of warnings (and errors?) found, which can obviously exceed 1, generating an "error running pyflakes" message when there is no error running it.

ervandew commented Dec 2, 2010

What version of pyflakes are you using? I have the Divmod pyflakes 0.4.0 and don't have this issue. Are you using a development version? Perhaps the fork by Kevin Watters?

edgimar commented Dec 2, 2010

I suspect it is the same version. The Ubuntu Lucid package version is 0.4.0-1.

If I save the following to "":

#!/usr/bin/env python

import d
import f
a = b
e = g

then I observe the following at the commandline:


[4 lines of warnings printed]

echo $?

Is this different in your case?

ervandew commented Dec 2, 2010

I get the following:
$ python -c "import pyflakes; print pyflakes.version"

$ pyflakes 'd' imported but unused 'f' imported but unused undefined name 'b' undefined name 'g'

$ echo $?

When I get time I'll try using a vanilla checkout from the divmod svn repos to see what their return codes is since one of our distros (yours: Ubuntu/Debian or mine: Arch) may be mucking with the return code. That or some other oddity is going on.

edgimar commented Dec 2, 2010

On my system /usr/bin/pyflakes exits with whatever pyflakes.scripts.pyflakes.main() returns. And main() returns a variable called "warnings" which (except in the case of more serious errors) contains the number of warnings printed (see lines 69-71).

ervandew commented Dec 9, 2010

Sorry for the long delay in responding. I finally got a chance to look into this and it turns out that debian patches pyflakes to behave this way (which by using Ubuntu you get to inherit). Both the pyflakes on my system and the one on the trunk of the Divmod svn repos exit the pyflakes.scripts.pyflakes main() function like so:
raise SystemExit(warnings > 0)

Then I went to the debian package page ( and there is a patch to pyflakes ( which includes the following change:
--- a/pyflakes/scripts/
+++ b/pyflakes/scripts/
@@ -64,4 +64,4 @@
warnings += check(, '')

-    raise SystemExit(warnings > 0)
+    return warnings

So, it looks like I'll have to make the annoying assumption that everyone's pyflakes behaves this way, or attempt to detect this sillyness and handle it as an edge case.


Closing now that eclim no longer uses pyflakes for validation (switched to pydev).

@ervandew ervandew closed this Mar 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment