Skip to content

Conversation

@brandonschabell
Copy link
Owner

Fixed colon in filename bug

Copilot AI review requested due to automatic review settings October 12, 2025 05:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where colons in filenames were incorrectly treated as scheme separators during URL parsing, causing URLs like http://www.example.com/abc:def.html to be truncated. The fix introduces a custom parsing method that handles query and fragment components without relying on urlsplit, which treats colons as scheme indicators.

Key changes:

  • Added _name_parts property that manually parses the filename into path, query, and fragment components
  • Updated name, query, fragment, and trailing_sep properties to use the new parser instead of urlsplit
  • Added comprehensive test coverage for colons in filenames with various combinations of query and fragment components

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
urlpath/init.py Implements custom URL component parsing to avoid colon-as-scheme issue
tests/test_url.py Adds test cases verifying colon handling in filenames works correctly

@brandonschabell brandonschabell merged commit 280569c into main Oct 12, 2025
3 checks passed
@brandonschabell brandonschabell deleted the colon-in-filename-bug branch October 12, 2025 05:01
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