Floobits / floobits-neovim

Floobits plugin for NeoVim
Apache License 2.0
167 stars 7 forks source link

AttrbuteError when joining a workspace. #39

Closed ghost closed 8 years ago

ghost commented 8 years ago
AttributeError("'unicode' object has no attribute 'get'",)
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/neovim/msgpack_rpc/session.py", line 185, in handler
    rv = self._request_cb(name, args)
  File "/Library/Python/2.7/site-packages/neovim/api/nvim.py", line 151, in filter_request_cb
    result = request_cb(self._from_nvim(name), args)
  File "/Library/Python/2.7/site-packages/neovim/plugin/host.py", line 74, in _on_request
    rv = handler(*args)
  File "/Users/eshan/.vim/bundle/floobits-neovim/rplugin/python/floobits/__init__.py", line 137, in check_and_join_workspace
    if not self.start_ticker():
  File "/Users/eshan/.vim/bundle/floobits-neovim/rplugin/python/floobits/__init__.py", line 124, in start_ticker
    if not utils.can_auth():
AttributeError: 'unicode' object has no attribute 'get'

When I run :FlooJoinWorkspace <url> I get the above error. The URL is valid, other clients like Atom can connect to it just fine. I have done all the setup and have double checked my ~/.floorc.json. What could be wrong here?

ggreer commented 8 years ago

The latest release (v3.2.2) should fix this crash. I think you put something invalid in the auth section of your floorc.json. Something like...

{
    "auth": {
      "floobits.com": {
        "api_key": "...",
        "secret": "...",
        "username": "..."
      },
      "debug": "true"
    }
}

(Notice that debug is in the auth section, not the global section. Also, its value is a string instead of a boolean.)

ghost commented 8 years ago

Sorry for replying so late. For me, what the source of the error turned out to be was that I was using 4 spaces to indent the JSON in the configuration instead of two. When I corrected it, the error no longer appeared. I assume that this is either unintended behaviour, or just how JSON parsing is itself supposed to work.

Either way, thanks!

ggreer commented 8 years ago

Indentation shouldn't matter for JSON. I just tried with no indentation and with 4 spaces, and it worked fine.