美文网首页
解决YouCompleteMe 'encoding

解决YouCompleteMe 'encoding

作者: 婆娑人 | 来源:发表于2017-06-18 21:37 被阅读31次

今天试着配置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解决

相关文章

网友评论

      本文标题:解决YouCompleteMe 'encoding

      本文链接:https://www.haomeiwen.com/subject/enswqxtx.html