Open armonyG opened 1 year ago
Hey @armonyG, thanks for reporting. We'll take a look at this in a future release.
@dalthviz, do you know how we could address this problem?
Not sure to be honest. Maybe updating the path handling logic to use pathlib
could help?
I just ran into a similar issue but from Jedi (I was trying to rename a variable) Here is the traceback:
My hunch is that somewhere the path loses one of the \
at the beginning.
Maybe when converting from '\\<network>\data\<project>'
to \\\\<network>\\data\\<project>'
only single \
are doubled
This issue is not resolved in version 1.7.4
The error from Jedi is resolved. Now when I rename a variable I get:
I am running jupyter lab from a directory on a network drive.
When python-lsp runs with jupyter lab, it raises
ValueError: path is on mount 'C:', start on mount '\\\\<path to network drive>\\data
With this trackback:editing the raise message in relpath to show the full paths reveals the issue: Both paths are almost identical, the difference is at the prefix: start:
\\\\<network>\\data\\<project>\\.virutal_documents
path:\\<network>\\data\\<project>\\.virutal_documents
relpath
callsos.path.abspath()
on bothstart
andpath
The problem is that:os.path.abspath(start)
gives\\\\<network>\\data\\<project>\\.virutal_documents
whileos.path.abspath(path)
givesC:\\<network>\\data\\<project>\\.virutal_documents
which puts them on different mounts, hence the error.path
has only one '\' when it should have two (two and not four) I followed the trackback and I think that this comes fromuri.to_fs_path()
but I got lost trying to find where the uri comes from.As a temporary solution I removed the call to
os.path.relpath()
in line 68 of_ultils.py
and it seems to work. I don't submit this as a pull request since it probably will not work in other configurations.