Skip to content

Unix user_log_dir doesn't create log dir #207

@qarkai

Description

@qarkai

With opinion=True (default) and ensure_exists=True.
Minimal reproducible example:

from platformdirs import PlatformDirs
app_dirs = PlatformDirs("app", ensure_exists=True)
open(app_dirs.user_log_path / "app.log", "w")

Expected: ~/.local/state/app/log/app.log is created.
Actual: only ~/.local/state/app is created, got FileNotFoundError.

No error with opinion=False, file ~/.local/state/app/app.log is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions