Skip to content

Commit

Permalink
Fix startup when no write permissions
Browse files Browse the repository at this point in the history
Making the parent directories of the config file could cause an exception if the process doesn't have write permissions. This is common with remote debugging in containers. Catch exceptions, log, and continue, same as other parts of the settings that cannot raise exceptions. The next stage of saving the config file will also fail, but this is already caught.
  • Loading branch information
fffergal authored and inducer committed Aug 29, 2024
1 parent bcbe618 commit e67fe51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pudb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def get_save_config_path():
return None

path = os.path.join(XDG_CONFIG_HOME, XDG_CONF_RESOURCE)
os.makedirs(path, mode=0o700, exist_ok=True)
try:
os.makedirs(path, mode=0o700, exist_ok=True)
except Exception:
settings_log.exception("Failed to make config dir")

return path

Expand Down

0 comments on commit e67fe51

Please sign in to comment.