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

fix DocumentURI error for [email protected] #1762

Closed
wants to merge 1 commit into from

Conversation

WinChua
Copy link

@WinChua WinChua commented Sep 19, 2024

When use YCM for golang with [email protected], I meet such response

{"jsonrpc":"2.0","error":{"code":-32700,"message":"JSON RPC parse error: DocumentURI scheme is not \'file\': file:/data/home/winchua/test/g"},"id":1}

which disable YCM.

After some debugging, it's cause by the code from gopls which requires uri of local files should starts with 'file://'

So, I make a pr here.


This change is Reviewable

Copy link
Collaborator

@bstaletic bstaletic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request.
I do not understand when/how did you get this error.
Especially considering that urljoin('file:', path) does add the two slashes:

>>> urljoin('file:', '/home') == 'file:///home'
True
>>> urljoin('file://', '/home') == urljoin('file:', '/home')
True

Can you share the complete stderr log, so we can see what is going on?

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: 0 of 2 LGTMs obtained (waiting on @WinChua)

@WinChua
Copy link
Author

WinChua commented Sep 20, 2024

o, I see. I compiled python from source code yestoday. This commit
change the behavior of urljoin .

>>> urljoin("file:", "/home")
'file:/home'

Not so sure such behavior is expected.

@bstaletic

@bstaletic
Copy link
Collaborator

Since python3.13 has been released and still urljoin('file:', '/home') == 'file:///home', I will close this.
@WinChua if you run into a problem again, feel free to yell at me.

@bstaletic bstaletic closed this Oct 10, 2024
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

Successfully merging this pull request may close these issues.

2 participants