astral-sh/uv · error

Invalid Gist URL format

Error message

Invalid Gist URL format

What it means

Error "Invalid Gist URL format" thrown in astral-sh/uv.

Source

Thrown at crates/uv/src/commands/project/run.rs:1928

            }
            Self::Empty => {
                write!(f, "python")?;
                Ok(())
            }
        }
    }
}

/// Resolve a GitHub Gist URL to its raw file URL using the GitHub API.
async fn resolve_gist_url(
    url: &DisplaySafeUrl,
    client_builder: &BaseClientBuilder<'_>,
) -> anyhow::Result<DisplaySafeUrl> {
    // Extract the Gist ID from the URL.
    let gist_id = url
        .path_segments()
        .and_then(|mut segments| segments.nth(1))
        .ok_or_else(|| anyhow!("Invalid Gist URL format"))?;

    // Build the API URL.
    let api_url = format!("https://api.github.com/gists/{gist_id}");

    let client = client_builder.build()?;

    // Build the request with appropriate headers.
    let api_url_parsed = DisplaySafeUrl::parse(&api_url)?;
    let mut request = client
        .for_host(&api_url_parsed)
        .get(Url::from(api_url_parsed));
    request = request.header("Accept", "application/vnd.github.v3+json");

    // Add GitHub token, if available.
    if let Ok(token) = std::env::var(EnvVars::UV_GITHUB_TOKEN) {
        request = request.header("Authorization", format!("Bearer {token}"));
    }

View on GitHub (pinned to f1a42680ff)

When it happens

Trigger: Thrown at crates/uv/src/commands/project/run.rs:1928 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astral-sh/uv@f1a42680ff (2026-08-16). Data as JSON: /api/errors/e66143fc7390dd8d. Report an issue: GitHub.