Skip to content

Conversation

ap--
Copy link
Collaborator

@ap-- ap-- commented Oct 4, 2025

This PR enforces that when a user explicitly requests protocol="" (empty) when creating a UPath, they are guaranteed to get a PosixUPath or WindowsUPath instance.

import upath

upath.UPath("s3://bucket/file", protocol="")  # now raises a ValueError
upath.UPath("file:///abc", protocol="")  # also raises a ValueError 
upath.UPath("/a/b/c")  # returns a PosixUPath / WindowsUPath

# whereas:

upath.UPath("file:///abc", protocol="file")  # returns  FilePath
upath.UPath("file:///abc")  # returns FilePath

@ap-- ap-- merged commit 4dd8eb5 into fsspec:main Oct 4, 2025
27 checks passed
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