Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Oct 15, 2023
1 parent 46eef6c commit 41820c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions jupyter_server/services/contents/fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def atomic_writing(self, os_path, *args, **kwargs):
Depending on flag 'use_atomic_writing', the wrapper perform an actual atomic writing or
simply writes the file (whatever an old exists or not)"""
with self.perm_to_403(os_path):
kwargs["log"] = self.log # type:ignore[attr-defined]
kwargs["log"] = self.log
if self.use_atomic_writing:
with atomic_writing(os_path, *args, **kwargs) as f:
yield f
Expand Down Expand Up @@ -234,7 +234,7 @@ def _copy(self, src, dest):
like shutil.copy2, but log errors in copystat
"""
copy2_safe(src, dest, log=self.log) # type:ignore[attr-defined]
copy2_safe(src, dest, log=self.log)

def _get_os_path(self, path):
"""Given an API path, return its file system path.
Expand Down Expand Up @@ -361,7 +361,7 @@ async def _copy(self, src, dest):
like shutil.copy2, but log errors in copystat
"""
await async_copy2_safe(src, dest, log=self.log) # type:ignore[attr-defined]
await async_copy2_safe(src, dest, log=self.log)

async def _read_notebook(self, os_path, as_version=4, capture_validation_error=None):
"""Read a notebook from an os path."""
Expand Down
4 changes: 2 additions & 2 deletions tests/services/contents/test_fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_path_to_invalid(tmpdir):
@pytest.mark.skipif(os.name == "nt", reason="test fails on Windows")
def test_file_manager_mixin(tmpdir):
mixin = FileManagerMixin()
mixin.log = logging.getLogger() # type:ignore[attr-defined]
mixin.log = logging.getLogger()
bad_content = tmpdir / "bad_content.ipynb"
bad_content.write_text("{}", "utf8")
with pytest.raises(HTTPError):
Expand All @@ -161,7 +161,7 @@ def test_file_manager_mixin(tmpdir):
@pytest.mark.skipif(os.name == "nt", reason="test fails on Windows")
async def test_async_file_manager_mixin(tmpdir):
mixin = AsyncFileManagerMixin()
mixin.log = logging.getLogger() # type:ignore[attr-defined]
mixin.log = logging.getLogger()
bad_content = tmpdir / "bad_content.ipynb"
bad_content.write_text("{}", "utf8")
with pytest.raises(HTTPError):
Expand Down

0 comments on commit 41820c6

Please sign in to comment.