leetcode.vim icon indicating copy to clipboard operation
leetcode.vim copied to clipboard

Error invoking LeetCodeList

Open vochicong opened this issue 6 years ago • 12 comments

Error detected while processing function leetcode#ListProblems:
line   30:
E121: Undefined variable: s:topics_and_companies
E15: Invalid expression: s:topics_and_companies['topics']

vochicong avatar Aug 29 '19 21:08 vochicong

Could you describe how you triggered this error?

ianding1 avatar Aug 29 '19 21:08 ianding1

Yes. In neovim, after successfully installing the plugin, I failed to :LeetCodeList with the error above. The same error happened even after a manual :LeetCodeSignIn beforehand.

vochicong avatar Aug 29 '19 22:08 vochicong

Hi, I tried on my own laptop and didn't find this problem. You could try to update the plugin to the newest version and see if it works.

ianding1 avatar Sep 01 '19 22:09 ianding1

I also use this plugin with neovim which version is 0.4.2. I know it has login problem. And another problem is when I submit problem and the answer is wrong, it will not function well. @ianding1 Do you use nvim or vim?

zhoupro avatar Oct 09 '19 02:10 zhoupro

I'll look into it

ianding1 avatar Oct 09 '19 04:10 ianding1

@ianding1 I also had start to learn writing vim plugin several days ago. This is a very useful plugin,and I also want to add some feature, such as top like list. Thanks for your hardworking.

zhoupro avatar Oct 09 '19 05:10 zhoupro

Hi zhoupro,

I repeated on Ubuntu 18.04 and found an issue in python-keyring. I'm not sure if it's the very bug that you met:

The bug occurred when I tried to sign in. It printed some errors about python-keyring. Part of it is:

    raise InitError("Failed to unlock the collection!")
keyring.errors.InitError: Failed to unlock the collection!

The way to fix it is to create a file ~/.local/share/python_keyring/keyringrc.cfg with the content:

[backend]
default-keyring=keyring.backends.Gnome.Keyring

The solution was proposed in this thread.

I can use the plugin normally after creating the file.

Please tell me if you still have issues. If so, any additional information such as screenshots or error messages would be very helpful.

ianding1 avatar Oct 11 '19 20:10 ianding1

@ianding1 I try it again, thanks.

zhoupro avatar Oct 12 '19 02:10 zhoupro

@ianding1 Yes, after create ~/.local/share/python_keyring/keyringrc.cfg, The problem is solved.

zhoupro avatar Oct 12 '19 03:10 zhoupro

same issue

yanbodiaoweng avatar Oct 20 '19 14:10 yanbodiaoweng

in nvim of macos. After install the plungin successfully, I only call :LeetCodeList successfully once. And then there is always the same error Error detected while processing function leetcode#ListProblems: line 30: E121: Undefined variable: s:topics_and_companies E15: Invalid expression: s:topics_and_companies['topics']

yanbodiaoweng avatar Oct 20 '19 14:10 yanbodiaoweng

In Ubuntu 18.04 and neovim v0.4.2 , I'm having the same error (after sign in). For me, the problem is, if I use the "~/.local/share/python_keyring/keyringrc.cfg" solution, I get an error as below and I can't even log in: browser_cookie3 not installed: pip3 install browser_cookie3 --user

I think this is because:

#### without the "keyringrc.cfg" solution ####
$ keyring --list-backends                         
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.SecretService.Keyring (priority: 5)
keyring.backends.chainer.ChainerBackend (priority: 10)
keyrings.alt.file.EncryptedKeyring (priority: 0.6)
keyrings.alt.file.PlaintextKeyring (priority: 0.5)

#### with the "keyringrc.cfg" solution ####
$ keyring --list-backends   
....
ModuleNotFoundError: No module named 'keyring.backends.Gnome'

For information, keyring

$ pip3 list | grep keyring           
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
keyring (21.1.0)
keyrings.alt (3.4.0)

ywpkwon avatar Jan 27 '20 00:01 ywpkwon