Skip to content

Commit 7036b5a

Browse files
authored
Implementation of 'local://' URI Scheme Support (#1381)
1 parent 79e62d3 commit 7036b5a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

fsspec/implementations/local.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class LocalFileSystem(AbstractFileSystem):
2929
"""
3030

3131
root_marker = "/"
32-
protocol = "file"
32+
protocol = "file", "local"
3333
local_file = True
3434

3535
def __init__(self, auto_mkdir=False, **kwargs):
@@ -215,6 +215,10 @@ def _strip_protocol(cls, path):
215215
path = path[7:]
216216
elif path.startswith("file:"):
217217
path = path[5:]
218+
elif path.startswith("local://"):
219+
path = path[8:]
220+
elif path.startswith("local:"):
221+
path = path[6:]
218222
return make_path_posix(path).rstrip("/") or cls.root_marker
219223

220224
def _isfilestore(self):

fsspec/implementations/tests/test_reference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def test_fss_has_defaults(m):
408408

409409
fs = fsspec.filesystem("reference", fs={"memory": m}, fo={})
410410
assert fs.fss["memory"] is m
411-
assert fs.fss[None].protocol == "file"
411+
assert fs.fss[None].protocol == ("file", "local")
412412

413413
fs = fsspec.filesystem("reference", fs={None: m}, fo={})
414414
assert fs.fss[None] is m

fsspec/registry.py

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def register_implementation(name, cls, clobber=False, errtxt=None):
6161
# updated with register_implementation
6262
known_implementations = {
6363
"file": {"class": "fsspec.implementations.local.LocalFileSystem"},
64+
"local": {"class": "fsspec.implementations.local.LocalFileSystem"},
6465
"memory": {"class": "fsspec.implementations.memory.MemoryFileSystem"},
6566
"dropbox": {
6667
"class": "dropboxdrivefs.DropboxDriveFileSystem",

0 commit comments

Comments
 (0)