Skip to content

Strip the protocol from the path in LocalFileSystem.lexists - #2250

Merged
martindurant merged 2 commits into
fsspec:masterfrom
LuisFigueroaG:fix/local-lexists-protocol
Oct 9, 2026
Merged

martindurant merged 2 commits into
fsspec:masterfrom
LuisFigueroaG:fix/local-lexists-protocol

Conversation

@LuisFigueroaG

Copy link
Copy Markdown
Contributor

LocalFileSystem.lexists passes the path straight to os.path.lexists, so unlike the other methods it doesn't handle file:///local:// URLs:

>>> fs = fsspec.filesystem("file")
>>> fs.exists("file:///tmp/afile"), fs.lexists("file:///tmp/afile")
(True, False)

It now uses _strip_protocol, like chmod since #2218. The new test fails on master.

@martindurant
martindurant merged commit 94afb3f into fsspec:master Oct 9, 2026
11 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.

2 participants