Repository navigation
FIX: Reject a blob URL without a container instead of raising IndexError - #3329
Merged
Roman Lutz (romanlutz) merged 2 commits intoOct 19, 2026
Merged
Conversation
parse_blob_url documents ValueError for an invalid blob URL, but a URL with a scheme and host and no path raised IndexError, and a trailing slash produced an empty container name. _resolve_blob_name only catches ValueError, so its fallback never ran for those inputs.
Roman Lutz (romanlutz)
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
AzureBlobStorageIO.parse_blob_urldocumentsValueError: If file_path is not a valid blob URL, but only the missing-scheme / missing-host case raises it. A URL with a scheme and host and no path (https://account.blob.core.windows.net) reachedparsed_url.path.split("/")[1]and raisedIndexError: list index out of range, and a URL ending in/produced an empty container name instead._resolve_blob_namecatchesValueErroronly, so its fallback to treating the input as a local path never ran for either input, and every entry point that goes through it (read_file_async,write_file_async,path_exists_async,delete_file_async,is_file_async) inherited theIndexError.The path is now checked the same way the scheme and host are: a container segment that is missing or empty raises
ValueError("Invalid blob URL").Tests and Documentation
Test:
pytest tests/unit/memory/storage/test_storage.py -q -k "without_container_path or empty_container_name or without_container_falls_back"fails on main —IndexErroratstorage.py:309for two of them andDID NOT RAISEfor the third — and passes here.pytest tests/unit/memory/storage -q→ 128 passed; the wider set (storage +test_azure_sql_memory+ the Azure Blob target) → 235 passed, 1 skipped.ruff checkandruff format --checkclean;ty checkreports the same single pre-existing diagnostic atstorage.py:97before and after.No documentation change beyond what the docstring already promised.