Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

"Can't open file" error on Windows 10 #1906

Closed
crishushu opened this issue Nov 3, 2016 · 15 comments
Closed

"Can't open file" error on Windows 10 #1906

crishushu opened this issue Nov 3, 2016 · 15 comments

Comments

@crishushu
Copy link

Seems to be similar to #979:

syntacticcapture

Unfortunately the fix didn't worked out for me!

Btw the output in the screenshot is after having set 'let g:syntactic_debug = 1'

I have no clue what is the purpose of the "missing file". Either way, I cannot find that file on my hard drive.

@lcd047
Copy link
Collaborator

lcd047 commented Nov 3, 2016

What version of syntastic are you using?

@crishushu
Copy link
Author

The last one:

commit 734fde7f0b84ff3f670ab5772ed1b8b0c8c16770
Author: LCD 47 <[email protected]>
Date:   Sun Oct 30 07:33:34 2016 +0200

    Manual: document the proselint checker.

Well using the fix apparently this:

commit 4c2004d2e5f04d6a10a0331aab8070e9c9fb5b39
Author: LCD 47 <[email protected]>
Date:   Thu Feb 6 11:58:30 2014 +0200

    Bug fix: the result of expand('<sfile>:p:h') has to be escaped.

@lcd047
Copy link
Collaborator

lcd047 commented Nov 3, 2016

Plase leave it at the current master HEAD. Edit your vimrc, and set g:syntastic_check_on_open to 0. Then edit your test file, set g:syntastic_debug to 1, run :SyntasticInfo, and post the output.

@crishushu
Copy link
Author

The output based on your instruction:

Syntastic version: 3.8.0-3 (Vim 800, Windows)
Info for filetype: python
Global mode: active
Filetype python is active
The current file will be checked automatically
syntastic: 68.878302: system: command run in 0.371898s
Available checkers: flake8 pep8 pycodestyle pyflakes pylint python
Currently enabled checkers: python flake8 pylint
syntastic: 68.937679: &shell = 'C:\Users\c.schulz\OneDrive\Apps\PortableGit\usr\bin\bash', &shellcmdflag = '-c', &shellpipe = '>%s 2>&1', &shellquote = '', &shellredir = '>%s 2>&1', &shelltemp = 1, &shellxquote = '"', &autochdir = 0, &shellslash = 1 (!), &shellxescape = '"&|<>()@^'

This is the intended output I wanted to post first. Had a typo in 'let g:syntactic_debug = 1' ...

syntacticcapture

@lcd047
Copy link
Collaborator

lcd047 commented Nov 3, 2016

This:

shellslash = 1

means you have to use slashes when setting shell:

shell = 'C:\Users\c.schulz\OneDrive\Apps\PortableGit\usr\bin\bash'

@crishushu
Copy link
Author

First had the impression the error went away, though

syntacticcapture2

put this into .vimrc (before injection of bundles via bundles):

let &shell = expand('$PORT_WIN/Apps/PortableGit/usr/bin/bash')

@lcd047
Copy link
Collaborator

lcd047 commented Nov 3, 2016

Please stop posting screenshots, thank you. They can't be referenced, and can't be indexed.

let &shell = expand('$PORT_WIN/Apps/PortableGit/usr/bin/bash')

According to your logs syntastic doesn't get to see that.

@crishushu
Copy link
Author

Syntastic did see it, not sure if 'expand' did the slashes replacement. Anyway syntastic still complains, when I write out the path:

Messages maintainer: Bram Moolenaar <[email protected]>
"tmp/code/python/vim-as-a-python-ide/demo.py" [unix] 60L, 1734C
syntastic: 1.619197: g:syntastic_version = '3.8.0-3 (Vim 800, Windows)'
syntastic: 1.619811: &shell = 'C:/Users/c.schulz/OneDrive/Apps/PortableGit/usr/bin/bash' (!), &shellcmdflag = '-c', &shellpipe = '>%s 2>&1', &shellquote = '', &shellredir = '>%s 2>&1', &shelltemp = 1, &shellxquote = '"', &autochdir = 0, &shellslash = 1 (!), &shellxescape = '"&|<>()@^'
syntastic: 1.620687: UpdateErrors (auto): default checkers
syntastic: 1.622252: CacheErrors: default checkers
syntastic: 1.623989: g:syntastic_aggregate_errors = 0
syntastic: 1.624492: getcwd() = 'C:/Users/c.schulz'
syntastic: 1.863813: system: command run in 0.139739s
syntastic: 1.864609: CacheErrors: Invoking checker: python/python
syntastic: 1.865842: SyntasticMake: called with options: {'errorformat': '%E%f:%l:%c: %m', 'makeprg': 'python ''C:/Users/c.schulz/.vim/bundle/syntastic/syntax_checkers/python/compile.py'' tmp/code/python/vim-as-a-python-ide/demo.py', 'env': {}, 'returns': [0]}
syntastic: 2.046003: system: command run in 0.178761s
syntastic: 2.046765: getLocList: checker python/python returned 0
syntastic: 2.047344: getLocList: checker python/python run in 0.182281s
syntastic: 2.051722: CacheErrors: Invoking checker: python/flake8
syntastic: 2.052902: 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 tmp/code/python/vim-as-a-python-ide/demo.py', 'env': {}}
syntastic: 3.475636: system: command run in 1.421849s
syntastic: 3.476484: getLocList: checker python/flake8 returned 0
syntastic: 3.476948: getLocList: checker python/flake8 run in 1.424668s
syntastic: 4.729457: system: command run in 1.250112s
syntastic: 4.730306: CacheErrors: Invoking checker: python/pylint
syntastic: 4.731064: SyntasticMake: called with options: {'errorformat': '%A%f:%l:%c:%t: %m,%A%f:%l: %m,%A%f:(%l): %m,%-Z%p^%.%#,%-G%.%#', 'makeprg': 'pylint -f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n tmp/code/python/vim-as-a-python-ide/demo.py', 'env': {}, 'returns': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]}
Error detected while processing function <SNR>38_VimEnterHook[14]..<SNR>38_UpdateErrors[15]..<SNR>38_CacheErrors[34]..16[1]..15[24]..SyntaxCheckers_python_pylint_GetLocList[15]..SyntasticMake[30]..syntastic#util#system:
line   10:
E484: Can't open file C:/Users/C6E35~1.SCH/AppData/Local/Temp/VIo3E.tmp
Error detected while processing function <SNR>38_VimEnterHook[14]..<SNR>38_UpdateErrors[15]..<SNR>38_CacheErrors:
line   34:
E170: Missing :endfor
Error detected while processing function <SNR>38_VimEnterHook[14]..<SNR>38_UpdateErrors:
line   15:
E171: Missing :endif
Error detected while processing function <SNR>38_VimEnterHook:
line   14:
E171: Missing :endif
Press ENTER or type command to continue

Please stop posting screenshots, thank you. They can't be referenced, and can't be indexed

Good point!

put this into .vimrc (before injection of bundles via bundles):

let &shell = expand('$PORT_WIN/Apps/PortableGit/usr/bin/bash')

I meant "... via Pathogen"

@lcd047
Copy link
Collaborator

lcd047 commented Nov 4, 2016

Error detected while processing function <SNR>38_VimEnterHook[14]..<SNR>38_UpdateErrors[15]..<SNR>38_CacheErrors[34]..16[1]..15[24]..SyntaxCheckers_python_pylint_GetLocList[15]..SyntasticMake[30]..syntastic#util#system:
line 10:

What happens if you run

:echo system('pylint -f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n tmp/code/python/vim-as-a-python-ide/demo.py')

in the exact same context as above?

@crishushu
Copy link
Author

crishushu commented Nov 4, 2016

E484: Can't open file C:/Users/C6E35~1.SCH/AppData/Local/Temp/VIo9EAC.tmp

@lcd047
Copy link
Collaborator

lcd047 commented Nov 4, 2016

Your system() is messed up. It seems to run fin the first four times, then in runs into the problem above. Finding out how and why that happens would be an interesting challenge, but it has nothing to do with syntastic. Syntastic needs a working system() to run. shrug

@lcd047 lcd047 closed this as completed Nov 4, 2016
@crishushu
Copy link
Author

crishushu commented Nov 4, 2016

I did the research #772, #814. The following pylint option (if called from inside vim) causes the error:

--msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}"

Replacing the quotes in line 53 in pylint.vim did the trick:

        \       "-f text --msg-template='{path}:{line}:{column}:{C}: [{symbol}] {msg}' -r n" :

@lcd047
Copy link
Collaborator

lcd047 commented Nov 4, 2016

This shouldn't change anything if your shell is bash. If it does make a difference then you aren't running bash.

@crishushu
Copy link
Author

crishushu commented Nov 4, 2016

Well, it made the difference for me. However, in the end its a windows machine...

PC:~$ echo $SHELL
/usr/bin/bash

@lcd047
Copy link
Collaborator

lcd047 commented Nov 4, 2016

Right: it makes a difference because of your shellxquote and shellxescape are left to the defaults. They both should be empty for bash. You should thank Vim for making it this easy to change your shell. 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants