diff --git a/src/jupyterhub_config/custom_spawner.py b/src/jupyterhub_config/custom_spawner.py index e118b69..c35f6a6 100644 --- a/src/jupyterhub_config/custom_spawner.py +++ b/src/jupyterhub_config/custom_spawner.py @@ -115,7 +115,7 @@ def _ensure_user_directory(self, user_dir: Path, username: str): gid = user_info.pw_gid self.log.info(f'Creating user directory for {username}') - user_dir.mkdir(parents=True, exist_ok=True) # guard against race conditions + user_dir.mkdir(exist_ok=True) # guard against race conditions # Change the directory's ownership to the user os.chown(user_dir, uid, gid) @@ -139,9 +139,9 @@ def _ensure_user_jupyter_directory(self, user_dir: Path): jupyter_runtime_dir = jupyter_dir / 'runtime' juputer_data_dir = jupyter_dir / 'data' - jupyter_dir.mkdir(parents=True, exist_ok=True) - jupyter_runtime_dir.mkdir(parents=True, exist_ok=True) - juputer_data_dir.mkdir(parents=True, exist_ok=True) + jupyter_dir.mkdir(exist_ok=True) + jupyter_runtime_dir.mkdir(exist_ok=True) + juputer_data_dir.mkdir(exist_ok=True) self.environment['JUPYTER_CONFIG_DIR'] = str(jupyter_dir) self.environment['JUPYTER_RUNTIME_DIR'] = str(jupyter_runtime_dir) @@ -153,7 +153,7 @@ def _ensure_virtual_environment(self, user_env_dir: Path): created with the system site-packages included. """ if not user_env_dir.exists(): - user_env_dir.mkdir(parents=True) + user_env_dir.mkdir(exist_ok=True) self.log.info(f'Creating virtual environment for {self.user.name}') try: # Create a virtual environment with system site-packages access