Skip to content

More fully sanitize the filename in PackageIndex._download_url #4951

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

Merged
merged 5 commits into from
Apr 19, 2025

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Apr 19, 2025

  • Extract _resolve_download_filename with test.
  • Add a check to ensure the name resolves relative to the tmpdir.
  • Extract _sanitize method for sanitizing the filename.
  • Rely on re.sub to perform the decision in one expression.
  • Add news fragment.

Summary of changes

Closes

Pull Request Checklist

@jaraco jaraco merged commit 100e9a6 into main Apr 19, 2025
38 of 42 checks passed
@jaraco jaraco deleted the security/4946 branch April 19, 2025 18:02
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.

1 participant