From 4e387a4e95b1064cca4a97dd7324b29d14b6e3b7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 15 Dec 2023 07:26:24 -0600 Subject: [PATCH] Account for read only file systems in migration (#379) --- jupyter_core/application.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyter_core/application.py b/jupyter_core/application.py index 81d8efe..f2fe221 100644 --- a/jupyter_core/application.py +++ b/jupyter_core/application.py @@ -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()