Fix Windows drive-letter paths misparsed as cloud schemes#986
Open
Abhishek21g wants to merge 1 commit into
Open
Fix Windows drive-letter paths misparsed as cloud schemes#986Abhishek21g wants to merge 1 commit into
Abhishek21g wants to merge 1 commit into
Conversation
urlparse treats D:/path as scheme='d', so CloudUploader rejected absolute Windows paths as invalid cloud providers. Map single-letter schemes to the local uploader and use the same helper in get/validate/init (issue mosaicml#960).
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 of changes:
On Windows, absolute paths like
D:/testare rejected byCloudUploaderwithValueError: Invalid Cloud provider prefix: d.becauseurllib.parse.urlparsetreats the drive letter as a URL scheme (scheme='d'). That breaksMDSWriter(out=r'D:/...')(issue #960).Root cause:
CloudUploader.get/_validate/__init__usedurlparse(...).schemedirectly and looked it up inUPLOADERS.This PR adds
_provider_prefix(uri)which:''→LocalUploaderdbfs:/Volumeshandlings3,gs, …) unchangedget,_validate, and__init__all use the helper so drive-letter paths are not treated as remote.Testing:
test_instantiation_typewithD:/...andC:/...local casestest_windows_drive_letter_not_cloud_schemeasserts_provider_prefixbehavior + LocalUploader instantiationpytest -vv tests/test_upload.py::TestCloudUploader --no-cov— 9 related tests passed locallyIssue #, if available:
Merge Checklist:
General
Tests
pre-commiton my change.