powerline vim, NameError, invalid expression error on the latest update.


I have vim with pathogen and on the latest update of the powerline.vim, everything broke.

It turns out that my old default config files are incompatible with the new version of powerline. See GitHub issue.

When I ran vim with --cmd 'let g:powerline_config_overrides={"common":{"log_file":"/tmp/powerline.log"}}' as suggested, a bunch of config mapping errors showed up:

2014-09-03 15:36:33,992:ERROR:vim:matcher_generator:Failed to import attr ctrlp from module powerline.matchers.plugin.ctrlp: No module named plugin.ctrlp
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/__init__.py", line 311, in get_module_attr
    return getattr(__import__(module, fromlist=(attr,)), attr)
ImportError: No module named plugin.ctrlp
2014-09-03 15:36:33,993:ERROR:vim:matcher_generator:Failed to import attr gundo_preview from module powerline.matchers.plugin.gundo: No module named plugin.gundo
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/__init__.py", line 311, in get_module_attr
    return getattr(__import__(module, fromlist=(attr,)), attr)
ImportError: No module named plugin.gundo
2014-09-03 15:36:33,995:ERROR:vim:matcher_generator:Failed to import attr nerdtree from module powerline.matchers.plugin.nerdtree: No module named plugin.nerdtree
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/__init__.py", line 311, in get_module_attr
    return getattr(__import__(module, fromlist=(attr,)), attr)
ImportError: No module named plugin.nerdtree
2014-09-03 15:36:33,998:ERROR:vim:matcher_generator:Failed to import attr gundo from module powerline.matchers.plugin.gundo: No module named plugin.gundo
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/__init__.py", line 311, in get_module_attr
    return getattr(__import__(module, fromlist=(attr,)), attr)
ImportError: No module named plugin.gundo
2014-09-03 15:36:34,010:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'mode', u'exclude_modes': [u'nc']}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,010:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 10, u'name': u'visual_range', u'exclude_modes': [u'nc']}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 10, u'name': u'paste_indicator', u'exclude_modes': [u'nc']}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 30, u'name': u'branch', u'exclude_modes': [u'nc']}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'after': u' ', u'name': u'readonly_indicator', u'draw_soft_divider': False}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 40, u'name': u'file_directory', u'draw_soft_divider': False}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'file_name', u'draw_soft_divider': False}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'file_vcs_status', u'draw_soft_divider': False, u'before': u' '}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'modified_indicator', u'before': u' '}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 50, u'module': u'powerline.segments.plugin.syntastic', u'exclude_modes': [u'nc'], u'name': u'syntastic'}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'draw_soft_divider': False, u'priority': 50, u'module': u'powerline.segments.plugin.tagbar', u'exclude_modes': [u'nc'], u'name': u'current_tag'}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 60, u'name': u'file_format', u'draw_soft_divider': False, u'exclude_modes': [u'nc']}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 60, u'name': u'file_encoding', u'exclude_modes': [u'nc']}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 60, u'name': u'file_type', u'exclude_modes': [u'nc']}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 50, u'width': 4, u'align': u'r', u'name': u'line_percent'}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'width': 3, u'align': u'r', u'name': u'line_current', u'draw_soft_divider': False}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'
2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'virtcol_current', u'align': u'l', u'priority': 20, u'width': 3, u'draw_soft_divider': False, u'before': u':'}: u'function'
Traceback (most recent call last):
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
    function_name = segment['function']
KeyError: u'function'

The quickest solution is to take the new default config files and dump them in your ~/.config/powerline directory.


%d bloggers like this: