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

Issue installing HTML-escaped local version #1338

Closed
stefanvanburen opened this issue Feb 15, 2024 · 6 comments · Fixed by #1440
Closed

Issue installing HTML-escaped local version #1338

stefanvanburen opened this issue Feb 15, 2024 · 6 comments · Fixed by #1440
Labels
bug Something isn't working

Comments

@stefanvanburen
Copy link

Hey! uv looks great; nice work. Not sure if this issue is on my end or yours:

$ uv pip install connectrpc-eliza-grpc-python --extra-index-url https://buf.build/gen/python
error: Received some unexpected HTML from https://buf.build/gen/python/connectrpc-eliza-grpc-python
  Caused by: Unexpected fragment (expected `#sha256=...`) on URL: 43;edc8ae343b96-py3-none-any.whl

I'm assuming this is because we're serving local versions with a + delimiter, which is then URL-escaped. The HTML looks something like:

    <a
      href="https://buf.build/gen/python/connectrpc-eliza-grpc-python/connectrpc_eliza_grpc_python-1.61.0.1.20230913231627&#43;233fca715f49-py3-none-any.whl"
      data-requires-python="&gt;=3.7"
      >connectrpc_eliza_grpc_python-1.61.0.1.20230913231627&#43;233fca715f49-py3-none-any.whl</a>

I haven't seen this as an issue with pip; it seems like something our repository should fix, but thought I'd mention in case the parsing should handle these escaped values.

@charliermarsh
Copy link
Member

Thanks, I'll take a look!

@charliermarsh charliermarsh added the bug Something isn't working label Feb 15, 2024
@charliermarsh charliermarsh self-assigned this Feb 15, 2024
@davidszotten
Copy link
Contributor

i'm running devpi and don't have fragments at all which results in

 uv pip install --extra-index-url <devpi> <package>
error: Received some unexpected HTML from <devpi>/<package>
  Caused by: Unexpected fragment (expected `#sha256=...`) on URL:

(not truncated, there is nothing after URL:)

@charliermarsh
Copy link
Member

Thanks! That should be an easy fix.

@davidszotten
Copy link
Contributor

happy to give it a go if you have some pointers?

@charliermarsh
Copy link
Member

@davidszotten - I haven't tried it yet, but I'd start in crates/uv-client/src/html.rs which has a parse_hash. I think the SHA256 used to be required but we relaxed it and didn't update that code.

@charliermarsh
Copy link
Member

@davidszotten - I moved that out to a separate issue: #1441

charliermarsh added a commit that referenced this issue Feb 16, 2024
## Summary

If a distribution contains a `+`, it'll be HTML-escaped; so when we try
to identify the `#`, we'll split in the wrong location.

Closes #1338.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants