Skip to content

Commit 3cc9386

Browse files
author
Martin Durant
committed
fix for http
1 parent c7fbaa0 commit 3cc9386

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

zarr/storage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ def __init__(self, url, normalize_keys=True, key_separator='.',
959959
self.mode = mode
960960

961961
def _normalize_key(self, key):
962-
key = normalize_storage_path(key)
962+
key = normalize_storage_path(key).lstrip('/')
963963
if key:
964964
*bits, end = key.split('/')
965965
key = '/'.join(bits + [end.replace('.', self.key_separator)])
@@ -1015,8 +1015,9 @@ def dir_path(self, path=None):
10151015
def listdir(self, path=None):
10161016
dir_path = self.dir_path(path)
10171017
try:
1018-
return sorted(p.rsplit('/', 1)[-1]
1018+
out = sorted(p.rstrip('/').rsplit('/', 1)[-1]
10191019
for p in self.fs.ls(dir_path, detail=False))
1020+
return out
10201021
except IOError:
10211022
return []
10221023

0 commit comments

Comments
 (0)