Closed llamallama closed 2 months ago
Since this is an issue with your hashlib package (Jedi does not seem involved here), I will close.
My guess is that something is broken with your Python and import hashlib
generates errors when used within VIM. It might not even work in normal Python. Usually I advice people to reinstall VIM/Python, but I'm not sure that helps here. In hashlib
there's a comment:
# try them all, some may not work due to the OpenSSL
# version not supporting that algorithm.
It also seems that all of these errors are just printed, so they are just annoying. However it seems that pickle
can not be imported (see traceback). This is of course something that should work and it definitely means that there's something completely wrong with the Python you are working with. I'm happy to try to help here, but I'll still close, because there's nothing left to do. But feel free to keep commenting.
Thank you for the reply.
My guess is that something is broken with your Python and
import hashlib
generates errors when used within VIM. It might not even work in normal Python.
From a fresh install of Python 3.11 in NetBSD 10 I entered the hashlib example from here. https://docs.python.org/3/library/hashlib.html. This tells me at least that hashlib works in Python outside of vim.
-bash-5.2$ python3.11
Python 3.11.7 (main, Mar 11 2024, 01:07:07) [GCC 10.5.0] on netbsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> m = hashlib.sha256()
>>> m.update(b"Nobody inspects")
>>> m.update(b" the spammish repetition")
>>> m.digest()
b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x94\x06'
>>> m.hexdigest()
'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'
It also seems that all of these errors are just printed, so they are just annoying.
Apologies. I wasn't sure what was or was not helpful.
However it seems that
pickle
can not be imported (see traceback). This is of course something that should work and it definitely means that there's something completely wrong with the Python you are working with.
Testing here (still outside of vim) I get.
-bash-5.2$ python3.11
Python 3.11.7 (main, Mar 11 2024, 01:07:07) [GCC 10.5.0] on netbsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> animals = ['tiger', 'lion', 'giraffe']
>>> pickle.dumps(animals)
b'\x80\x04\x95\x1e\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x05tiger\x94\x8c\x04lion\x94\x8c\x07giraffe\x94e.'
Does this mean we can at least rule out the base Python install as the culprit here?
I'm happy to try to help here, but I'll still close, because there's nothing left to do. But feel free to keep commenting.
Thank you. I'm happy to keep providing information. I know this is an obscure case, but having jedi-vim running here would make my odd obsession with niche Unix systems a bit more comfortable. :)
Is there any other information I can provide you with?
It also seems that all of these errors are just printed, so they are just annoying.
Apologies. I wasn't sure what was or was not helpful.
No worries, I was just going through this to tell you that hashlib is not really an issue, pickle is.
It feels like you have an issue with Python in VIM. So something seems to be going wrong when VIM is loading Python (which is kind of a weird "embedding". I don't know what one would call that technically, but it's not a separate process. To debug this you can for example try :python3 import pickle
. That will probably result in an error.
I'm not sure why this happens in your case, but we have seen quite a few cases with broken VIM/Python interaction. Most of theses cases can probably not relate to yours, most of them were on MacOS as far as I can remember it. These cases usually fixed themselves by reinstalling VIM.
You’re right. It is an issue with NetBSD’s vim. When importing hashlib and pickle from python in vim I get the exact same errors. Unfortunately, reinstalling is not the answer here as it happens on a fresh install in all of my test scenarios.
At least I know where to direct my attention now. Thank you for your insight and thanks for work on jedi and jedi-vim!
Issue
Steps to reproduce
With a fresh vim install with jedi-vim cloned (including submodules) into
~/.vim/pack/plugins/start/jedi-vim
, I get the following errors when runningvim test.py
minimal.vimrc file used
Output of “:verbose JediDebugInfo”