-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
escape pyscript_path #57
Comments
@grafi-tt Would you mind fixing the problem please? Thanks! |
As suggested by @josephholsten, escaping is required. diff --git a/plugin/editorconfig.vim b/plugin/editorconfig.vim
index 87fbaa6..9abd008 100644
--- a/plugin/editorconfig.vim
+++ b/plugin/editorconfig.vim
@@ -121,15 +121,15 @@ function! s:FindPythonFiles() " {{{1
let l:python_core_files_dir = fnamemodify(
\ findfile(g:EditorConfig_python_files_dir . '/main.py',
- \ ','.&runtimepath), ':p:h')
+ \ fnameescape(','.&runtimepath)), ':p:h')
if empty(l:python_core_files_dir)
let l:python_core_files_dir = ''
else
- " expand python core file path to full path, and remove the appending '/'
- let l:python_core_files_dir = substitute(
- \ fnamemodify(l:python_core_files_dir, ':p'), '/$', '', '')
+ " expand python core file path to full path, and remove the appending '/'
+ let l:python_core_files_dir = substitute(
+ \ fnamemodify(l:python_core_files_dir, ':p'), '/$', '', '')
endif
let &shellslash = l:old_shellslash
@@ -247,7 +247,7 @@ function! s:InitializePythonBuiltin(editorconfig_core_py_dir) " {{{2
" The following line modifies l:ret. This is a bit confusing but
" unfortunately to be compatible with Vim 7.3, we cannot use pyeval. This
" should be changed in the future.
- execute s:pyfile_cmd s:pyscript_path
+ execute s:pyfile_cmd fnameescape(s:pyscript_path)
return l:ret
endfunction
@@ -391,8 +391,8 @@ endfunction
function! s:UseConfigFiles_Python_External() " {{{2
" Use external python interp to run the python EditorConfig Core
- let l:cmd = s:editorconfig_python_interp . ' ' .
- \ s:editorconfig_core_py_dir . '/main.py'
+ let l:cmd = shellescape(s:editorconfig_python_interp) . ' ' .
+ \ shellescape(s:editorconfig_core_py_dir . '/main.py')
call s:SpawnExternalParser(l:cmd) |
@grafi-tt I've applied the patch, thanks! 75fe572 @josephholsten Can you try it with the latest version? |
After upgrading, I now see an error:
I'm guessing this error is because the absolute path to my vim plugins includes whitespace.
I'm thinking we should either escape where pyscript_path is set
plugin/editorconfig.vim:39
or where it's passed to pyscriptplugin/editorconfig.vim:250
.The text was updated successfully, but these errors were encountered: