解决YouCompleteMe"encoding" is an invalid keyword 错误

今天试着配置vim关于python的设置,在使用YouCompleteMe操作的时候,提示'encoding' is an invalid keyword argument on python files,查看message,为:
~/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py中的ReadFile引起的问题:

 def ReadFile( filepath ):
   with open( filepath, encoding = 'utf8' ) as f:
     return f.read()

排查发现,是因为这段代码只支持python3,所以需要vim支持python3,用brew install vim --with-python3解决

猜你喜欢

转载自blog.csdn.net/qq_39469761/article/details/74939578