Skip to content

fix: decode encoded Windows drive separators#2209

Open
Bortlesboat wants to merge 1 commit into
microsoft:mainfrom
Bortlesboat:fix/2208-encoded-drive
Open

fix: decode encoded Windows drive separators#2209
Bortlesboat wants to merge 1 commit into
microsoft:mainfrom
Bortlesboat:fix/2208-encoded-drive

Conversation

@Bortlesboat

Copy link
Copy Markdown

Summary

  • recognize a percent-encoded Windows drive separator before url2pathname performs drive detection
  • avoid abspath prepending the current drive to an already-decoded drive path
  • cover parity between file:///C:/... and file:///C%3A/...

Closes #2208

Verification

  • PYTHONPATH=packages/markitdown/src python -m pytest packages/markitdown/tests/test_module_misc.py::test_file_uri_with_percent_encoded_drive_colon -q (1 passed on Windows)
  • python -m ruff check packages/markitdown/src/markitdown/_uri_utils.py packages/markitdown/tests/test_module_misc.py
  • python -m ruff format --check packages/markitdown/src/markitdown/_uri_utils.py packages/markitdown/tests/test_module_misc.py
  • git diff --check

The existing test_file_uris case hard-codes POSIX paths and therefore does not run successfully on Windows; the new regression is isolated with a Windows marker.

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.

Percent-encoded Windows drive colon in file URI produces a duplicated drive path

1 participant