Skip to content
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

TypeError: string indices must be integers in utils.py #49

Closed
jrens opened this issue Jan 22, 2019 · 5 comments
Closed

TypeError: string indices must be integers in utils.py #49

jrens opened this issue Jan 22, 2019 · 5 comments

Comments

@jrens
Copy link

jrens commented Jan 22, 2019

Traceback (most recent call last):
File "/home/justin/.local/bin/keep", line 11, in
sys.exit(cli())
File "/usr/lib/python3/dist-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/justin/.local/lib/python3.6/site-packages/keep/commands/cmd_list.py", line 14, in cli
utils.list_commands(ctx)
File "/home/justin/.local/lib/python3.6/site-packages/keep/utils.py", line 72, in list_commands
table_data.append(['$ ' + cmd, fields['desc'], fields['alias']])
TypeError: string indices must be integers

Entirely suspect user error of some form but I'm not much of a python developer and don't see anything overly wrong there.
Running keep works fine.
Above trace was from keep list
Reverting back to 2.4.2 works fine other than a nag to update.

@OrkoHunter
Copy link
Owner

This is surely a bug. Can you please provide more info on it?

  1. What is the version that caused this error? Is it the latest one on pypi i.e. 2.6.1?
  2. Does ~/.keep/commands.json exist?
  3. Can you please share your ~/.keep/commands.json? (Please hide any sensitive data before posting)

@jrens
Copy link
Author

jrens commented Jan 22, 2019

  1. 2.6.1. Also 2.5.2
  2. Exists

commands.zip

@OrkoHunter
Copy link
Owner

Great! I can now replicate the same error. I will get back once I am able to debug.

@OrkoHunter
Copy link
Owner

Hi @jrens!

Thank you for raising the issue. The problem is that after 2.4.2, the schema of the commands.json was changed. There should have been a migrating script. Apologies for not being careful.

I have migrated your commands.json to the newer format. Please use it with the latest version of keep. Thank you!

commands.json.zip

@jrens
Copy link
Author

jrens commented Jan 22, 2019

Thanks for taking care of that. That works

@jrens jrens closed this as completed Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants