Skip to content

Commit

Permalink
Account for read only file systems in migration (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Dec 15, 2023
1 parent 257b483 commit 4e387a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jupyter_core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ def migrate_config(self) -> None:
try: # let's see if we can open the marker file
# for reading and updating (writing)
f_marker = Path.open(Path(self.config_dir, "migrated"), "r+")
except PermissionError: # not readable and/or writable
return # so let's give up migration in such an environment
except FileNotFoundError: # cannot find the marker file
pass # that means we have not migrated yet, so continue
except OSError: # not readable and/or writable
return # so let's give up migration in such an environment
else: # if we got here without raising anything,
# that means the file exists
f_marker.close()
Expand Down

0 comments on commit 4e387a4

Please sign in to comment.