mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Migrate from urlencoding
to percent-encoding
(#11144)
## Summary This lets us drop a dependency entirely. `percent-encoding` is used by `url` and so is already in the graph, whereas `urlencoding` isn't used by anything else.
This commit is contained in:
parent
027db656aa
commit
8adf4a8977
13 changed files with 30 additions and 32 deletions
|
@ -38,6 +38,7 @@ html-escape = { workspace = true }
|
|||
http = { workspace = true }
|
||||
itertools = { workspace = true }
|
||||
jiff = { workspace = true }
|
||||
percent-encoding = { workspace = true }
|
||||
reqwest = { workspace = true }
|
||||
reqwest-middleware = { workspace = true }
|
||||
reqwest-retry = { workspace = true }
|
||||
|
@ -52,7 +53,6 @@ tokio = { workspace = true }
|
|||
tokio-util = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
url = { workspace = true }
|
||||
urlencoding = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
anyhow = { workspace = true }
|
||||
|
|
|
@ -93,7 +93,7 @@ impl SimpleHtml {
|
|||
// Extract the hash, which should be in the fragment.
|
||||
let decoded = html_escape::decode_html_entities(href);
|
||||
let (path, hashes) = if let Some((path, fragment)) = decoded.split_once('#') {
|
||||
let fragment = urlencoding::decode(fragment)?;
|
||||
let fragment = percent_encoding::percent_decode_str(fragment).decode_utf8()?;
|
||||
(
|
||||
path,
|
||||
if fragment.trim().is_empty() {
|
||||
|
@ -131,7 +131,8 @@ impl SimpleHtml {
|
|||
let filename = filename.split('?').next().unwrap_or(filename);
|
||||
|
||||
// Unquote the filename.
|
||||
let filename = urlencoding::decode(filename)
|
||||
let filename = percent_encoding::percent_decode_str(filename)
|
||||
.decode_utf8()
|
||||
.map_err(|_| Error::UnsupportedFilename(filename.to_string()))?;
|
||||
|
||||
// Extract the `requires-python` value, which should be set on the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue