Closed WhyNotHugo closed 3 years ago
I'm getting the impression that some library (or maybe python itself?) started returning PosixPath instead of str somewhere, and this isn't being handled properly.
I dug a bit and jedi changed code to work with Path objects in https://github.com/davidhalter/jedi/commit/db0e90763be0f65de1a03a270f10272b46184892. Moving to master fixes the first error.
A naive fix for this particular issue is changing
https://github.com/neoclide/coc-python/blob/master/pythonFiles/completion.py#L420 to do module_path.as_posix()
(I suspect this is not the right thing on windows). However this is a more overarching issue that would need to be dealt with (I see a lot of other stuff that will break in the same way).
Possible solutions
I'm not intimate enough with this code to know what's the best course of action, but I think the info here will make the work for anyone who knows the codebase easier.
Path
objects implement __str__
they way you'd expect them to work, so str(module_path)
is the right way to go and should work on any platform
Also str(module_path)
should avoid breakage if someone is using an old version of Jedi, since it'll just return the same string.
Faced this issue, it looks like this fix is merged too, but I haven't seen a release for this package in a while. (Forgive my ignorance but) Can you help me understand why that is? I mean shouldn't this be released to npm so that people can use it without having to use master etc.?
When I try to jump to a definition using Jedi 0.17.0 or 0.17.2, I'm getting this error:
I tried using Jedi
master
, but I get this other error (again, when jumping to a definition):I'm getting the impression that some library (or maybe python itself?) started returning
PosixPath
instead ofstr
somewhere, and this isn't being handled properly.Output of
pip freeze
: