syntastic: error: checker python/python returned abnormal status 1

Created on 6 Dec 2016  路  12Comments  路  Source: vim-syntastic/syntastic

When I use syntastic I meet this problem

Flake8 found issues
syntastic: error: checker output:
Traceback (most recent call last):
File "/home/stone/.vim/bundle/syntastic/syntax_checkers/python/compile.py", li
ne 11, in
compile(open(argv[1]).read(), argv[1], 'exec', 0, 1)
IOError: [Errno 2] No such file or directory: ''
syntastic: error: checker python/python returned abnormal status 1

Could anyone help me solve this problem?

Most helpful comment

@mattamizer Looking at the sources it seems vim-flake8 shouldn't be incompatible with syntastic, provided that you don't run both at the same time. So you could in principle either remove the autocmd on BufWritePost for vim-flake8, or configure syntastic_mode_map to be passive for python. But syntastic has a flake8 checker, so there doesn't seem to be much point in running both vim-flake8 and syntastic against the same file anyway.

On the other hand, detecting autocmd conflicts like this is not possible because of limitations of Vim's API, so syntastic couldn't really do anything better here. That's just about all there is to it, I think.

All 12 comments

Please open your test file, set g:syntastic_debug to 33, run :SyntasticCheck python, run :mes, and post the output. Please use cut & paste rather than screenshots.

I run :mes after :SyntasticCheck python

"my_Code/stuff/my_arg.py" 16L, 423C
syntastic: 1.631629: g:syntastic_version = '3.8.0-3 (Vim 704, Linux)'
syntastic: 1.631855: &shell = '/bin/bash', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir =
'>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir = 0, &shellxescape = ''
syntastic: 1.632579: UpdateErrors: python
syntastic: 1.632901: CacheErrors: python
syntastic: 1.633758: g:syntastic_aggregate_errors = 0
syntastic: 1.633936: $TERM = 'xterm'
syntastic: 1.634056: $PATH = '/home/stone/.pyenv/plugins/pyenv-virtualenv/shims:/home/stone/.pyenv/shims:/home/stone/.pyen
v/bin:/home/stone/perl5/bin:/usr/local/texlive/2015/bin/i386-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
:/bin:/usr/games:/usr/local/games:/usr/local/texlive/2015/bin/x86_64-linux'
syntastic: 1.634213: getcwd() = '/home/stone'
syntastic: 1.697550: system: command run in 0.051171s
syntastic: 1.697791: python/python: getVersion: 'python --version': ['Python 2.7.6', '']
syntastic: 1.698030: python/python: python version = [2, 7, 6]
syntastic: 1.698306: CacheErrors: Invoking checker: python/python
syntastic: 1.698535: python/python: using compiler script '/home/stone/.vim/bundle/syntastic/syntax_checkers/python/compil
e.py'
syntastic: 1.699505: SyntasticMake: called with options: {'errorformat': '%E%f:%l:%c: %m', 'makeprg': 'python /home/stone/
.vim/bundle/syntastic/syntax_checkers/python/compile.py my_Code/stuff/my_arg.py', 'env': {'TERM': 'dumb'}, 'returns': [0]}

syntastic: 1.771510: system: command run in 0.071405s
syntastic: 1.772121: getLocList: checker python/python returned 0
syntastic: 1.772450: getLocList: checker python/python run in 0.073988s
syntastic: 7.760464: g:syntastic_version = '3.8.0-3 (Vim 704, Linux)'
syntastic: 7.760699: &shell = '/bin/bash', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir =
'>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir = 0, &shellxescape = ''
syntastic: 7.761242: UpdateErrors: python
syntastic: 7.761594: CacheErrors: python
syntastic: 7.762381: g:syntastic_aggregate_errors = 0
syntastic: 7.762569: $TERM = 'xterm'
syntastic: 7.762699: $PATH = '/home/stone/.pyenv/plugins/pyenv-virtualenv/shims:/home/stone/.pyenv/shims:/home/stone/.pyen
v/bin:/home/stone/perl5/bin:/usr/local/texlive/2015/bin/i386-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
:/bin:/usr/games:/usr/local/games:/usr/local/texlive/2015/bin/x86_64-linux'
syntastic: 7.762867: getcwd() = '/home/stone'
syntastic: 7.763486: CacheErrors: Invoking checker: python/python
syntastic: 7.763710: python/python: using compiler script '/home/stone/.vim/bundle/syntastic/syntax_checkers/python/compil
e.py'
syntastic: 7.764540: SyntasticMake: called with options: {'errorformat': '%E%f:%l:%c: %m', 'makeprg': 'python /home/stone/
.vim/bundle/syntastic/syntax_checkers/python/compile.py my_Code/stuff/my_arg.py', 'env': {'TERM': 'dumb'}, 'returns': [0]}

syntastic: 7.836444: system: command run in 0.071423s
syntastic: 7.837021: getLocList: checker python/python returned 0
syntastic: 7.837351: getLocList: checker python/python run in 0.073704s

According to your logs all commands have finished normally.

Thanks for your answer

I'm having the same issue. The output per your request is

Flake8 found issues
syntastic: 414.169683: g:syntastic_version = '3.8.0-10 (Vim 704, Neovim, Darwin)'
syntastic: 414.169877: &shell = '/bin/zsh', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir = '>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir
 = 0, &shellxescape = ''
syntastic: 414.170442: UpdateErrors (auto): default checkers
syntastic: 414.170909: CacheErrors: default checkers
syntastic: 414.172459: g:syntastic_aggregate_errors = 0
syntastic: 414.172658: $TERM = 'screen-256color'
syntastic: 414.172776: $TMPDIR = '/var/folders/70/vftfsmm538z6qghqbxxt1n7w0000gn/T/'
syntastic: 414.172910: $PATH = '/Users/mmorrissey/google-cloud-sdk/bin:/Users/matthew.morrissey/.rvm/gems/ruby-2.1.5/bin:/Users/matthew.morrissey/.rvm/gems/ruby-2.1.5@global/bin:/Us
ers/matthew.morrissey/.rvm/rubies/ruby-2.1.5/bin:/usr/local/bin:.git/safe/../../bin:/Users/matthew.morrissey/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/ma
tthew.morrissey/.rvm/bin:/Users/mmorrissey/gocode/bin:/Users/mmorrissey/.fzf/bin'
syntastic: 414.173234: getcwd() = '/Users/mmorrissey/code/foo'
syntastic: 414.174044: CacheErrors: Invoking checker: python/python
syntastic: 414.174925: python/python: using compiler script '/Users/mmorrissey/.vim/plugged/syntastic/syntax_checkers/python/compile.py'
syntastic: 414.176072: SyntasticMake: called with options: {'errorformat': '%E%f:%l:%c: %m', 'makeprg': 'python /Users/mmorrissey/.vim/plugged/syntastic/syntax_checkers/python/compi
le.py ''''', 'env': {'TERM': 'dumb'}, 'returns': [0]}
syntastic: 414.230920: system: command run in 0.054316s
syntastic: error: checker output:
Traceback (most recent call last):
  File "/Users/mmorrissey/.vim/plugged/syntastic/syntax_checkers/python/compile.py", line 11, in <module>
    compile(open(argv[1]).read(), argv[1], 'exec', 0, 1)
IOError: [Errno 2] No such file or directory: ''
syntastic: error: checker python/python returned abnormal status 1
syntastic: 414.232067: getLocList: checker python/python run in 0.057208s
syntastic: 414.232298: CacheErrors: Invoking checker: python/flake8
syntastic: 414.232711: SyntasticMake: called with options: {'errorformat': '%E%f:%l: could not compile,%-Z%p^,%A%f:%l:%c: %t%n %m,%A%f:%l: %t%n %m,%-G%.%#', 'makeprg': 'flake8 '''''
, 'env': {'TERM': 'dumb'}}
syntastic: 414.653831: system: command run in 0.420789s
syntastic: 414.654391: getLocList: checker python/flake8 returned 0
syntastic: 414.654680: getLocList: checker python/flake8 run in 0.422295s
syntastic: 414.655001: CacheErrors: Checker python/pylint is not available

EDIT: It seems that the only time this error is triggered - for me at least - is when there are flake8 or syntastic errors found within the file.

'makeprg': 'python /Users/mmorrissey/.vim/plugged/syntastic/syntax_checkers/python/compi le.py '''''

@mattamizer Unless you did set syntastic_python_python_fname to an empty string, this looks like a Neovim issue. As I said elsewhere, syntastic should work with Neovim, but that combination is not supported. Can you reproduce the problem with plain Vim? Can you reproduce it with all other plugins disabled?

It is reproducible with plain VIM:

Flake8 found issues
syntastic: 23.770264: g:syntastic_version = '3.8.0-10 (Vim 704, Darwin)'
syntastic: 23.770449: &shell = '/bin/zsh', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir = '>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir = 0, &shellxescape = ''
syntastic: 23.770785: UpdateErrors (auto): default checkers
syntastic: 23.771233: CacheErrors: default checkers
syntastic: 23.772190: g:syntastic_aggregate_errors = 0
syntastic: 23.772330: $TERM = 'screen-256color'
syntastic: 23.772408: $TMPDIR = '/var/folders/70/vftfsmm538z6qghqbxxt1n7w0000gn/T/'
syntastic: 23.772636: $PATH = '/Users/mmorrissey/google-cloud-sdk/bin:/Users/matthew.morrissey/.rvm/gems/ruby-2.1.5/bin:/Users/matthew.morrissey/.rvm/gems/ruby-2.1.5@global/bin:/Users/matthew.morrissey/.rvm/rubies/ruby-2.1.5/bin:/usr/local/bin:.git/safe/../../bin:/Users/matthew.morrissey/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/matthew.morrissey/.rvm/bin:/Users/mmorrissey/gocode/bin:/Users/mmorrissey/.fzf/bin'
syntastic: 23.773862: getcwd() = '/Users/mmorrissey/code/dramafever/www'
syntastic: 23.775039: CacheErrors: Invoking checker: python/python
syntastic: 23.775488: python/python: using compiler script '/Users/mmorrissey/.vim/plugged/syntastic/syntax_checkers/python/compile.py'
syntastic: 23.777006: SyntasticMake: called with options: {'errorformat': '%E%f:%l:%c: %m', 'makeprg': 'python /Users/mmorrissey/.vim/plugged/syntastic/syntax_checkers/python/compile.py ''''', 'env': {'TERM': 'dumb'}, 'returns': [0]}
syntastic: 23.837205: system: command run in 0.059487s
syntastic: error: checker output:
Traceback (most recent call last):
  File "/Users/mmorrissey/.vim/plugged/syntastic/syntax_checkers/python/compile.py", line 11, in <module>
    compile(open(argv[1]).read(), argv[1], 'exec', 0, 1)
IOError: [Errno 2] No such file or directory: ''
syntastic: error: checker python/python returned abnormal status 1
syntastic: 23.856991: getLocList: checker python/python run in 0.081618s
syntastic: 23.859841: CacheErrors: Invoking checker: python/flake8
syntastic: 23.860902: SyntasticMake: called with options: {'errorformat': '%E%f:%l: could not compile,%-Z%p^,%A%f:%l:%c: %t%n %m,%A%f:%l: %t%n %m,%-G%.%#', 'makeprg': 'flake8 ''''', 'env': {'TERM': 'dumb'}}
syntastic: 24.598594: system: command run in 0.737179s
syntastic: 24.601009: getLocList: checker python/flake8 returned 1
syntastic: 24.601399: getLocList: checker python/flake8 run in 0.741338s
syntastic: 24.602085: CacheErrors: Checker python/pylint is not available

With all plugins save syntastic disabled everything seems to work fine, so I think this issue can safely be closed. I'll dig and figure out what the conflict is. Thanks!

EDIT: Seems the conflict was with the vim-flake8 plugin. Removing that plugin has fixed the errors for both nvim and vim.

@mattamizer You could try something like binary search to isolate the conflicting plugin. It's always useful to understand how and why these problems happen.

I edited my comment above but I'll add the same here for clarity; the conflict was with vim-flake8. Not really sure why I had that installed as well as syntastic but there you have it. Thanks for the assistance @lcd047!

@mattamizer There seem to be several plugins named vim-flake8. Which one did you have installed?

@lcd047 nvie/vim-flake8

@mattamizer Looking at the sources it seems vim-flake8 shouldn't be incompatible with syntastic, provided that you don't run both at the same time. So you could in principle either remove the autocmd on BufWritePost for vim-flake8, or configure syntastic_mode_map to be passive for python. But syntastic has a flake8 checker, so there doesn't seem to be much point in running both vim-flake8 and syntastic against the same file anyway.

On the other hand, detecting autocmd conflicts like this is not possible because of limitations of Vim's API, so syntastic couldn't really do anything better here. That's just about all there is to it, I think.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ErikBjare picture ErikBjare  路  3Comments

dunatotatos picture dunatotatos  路  6Comments

noprompt picture noprompt  路  5Comments

cookiengineer picture cookiengineer  路  7Comments

HabbaRazzer picture HabbaRazzer  路  5Comments