Skip to content

State service doesn't catch permission errors in XDG_RUNTIME_DIR #869

@mr-cal

Description

@mr-cal

What needs to get done

If access to XDG_RUNTIME_DIR fails with a permission error, the state service should either raise a user-friendly error and recommend using CRAFT_STATE_DIR or fall back to util.get_home_temporary_directory().

Why it needs to get done

Craft application raises an internal error when it fails to create a directory here:

state_dir = platformdirs.user_runtime_path(
str(os.getpid()), ensure_exists=True
)

source:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions