Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fsspec/implementations/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def ls(self, path, detail=True, **kwargs):
path = self._strip_protocol(path)
r = self.session.get(f"{self.url}/{path}")
if r.status_code == 404:
return FileNotFoundError(path)
raise FileNotFoundError(path)
r.raise_for_status()
out = r.json()

Expand All @@ -63,7 +63,7 @@ def cat_file(self, path, start=None, end=None, **kwargs):
path = self._strip_protocol(path)
r = self.session.get(f"{self.url}/{path}")
if r.status_code == 404:
return FileNotFoundError(path)
raise FileNotFoundError(path)
r.raise_for_status()
out = r.json()
if out["format"] == "text":
Expand Down
5 changes: 5 additions & 0 deletions fsspec/implementations/tests/test_jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ def test_simple(jupyter):
fs = fsspec.filesystem("jupyter", url=url)
assert fs.ls("") == []

with pytest.raises(FileNotFoundError):
fs.ls("not-exist")
with pytest.raises(FileNotFoundError):
fs.cat("not-exist")

fs.pipe("afile", b"data")
assert fs.cat("afile") == b"data"
assert "afile" in os.listdir(d)
Expand Down
Loading