Skip to content

crash.log written into repo root on Linux (breaks Syncthing casing sync) #3

Description

@endolith

Summary

When run on Linux with LOCALAPPDATA/TEMP unset, _crash_log_path() falls back to ".", so the crash log is written to ./PlotRuler/crash.log inside the repository working tree.

Code

plotruler/__main__.py:

def _crash_log_path():
    base = os.environ.get("LOCALAPPDATA") or os.environ.get("TEMP") or "."
    return os.path.join(base, "PlotRuler", "crash.log")
  • Windows: LOCALAPPDATA is set → %LOCALAPPDATA%\PlotRuler\crash.log (fine).
  • Linux/macOS: neither var is set → logs to ./PlotRuler/crash.log.

Problem

The repo root already contains the lowercase package plotruler/. On case-insensitive filesystems (Windows/macOS) the two collide, and tools that sync the tree — e.g. Syncthing — report a casing conflict:

remote "Programming\GraphRuler\PlotRuler" uses different upper or lowercase characters than local "Programming\GraphRuler\plotruler"

so the items never sync until the stray PlotRuler/ dir is deleted manually.

Suggestion

Use a platform-appropriate XDG path on non-Windows, e.g.:

base = os.environ.get("LOCALAPPDATA") or os.environ.get("XDG_STATE_HOME", os.path.expanduser("~/.local/state"))

and/or log with the app name directly rather than a capital-cased dir that can shadow the lowercase package. Also consider ignoring the runtime dir in .gitignore as a belt-and-suspenders measure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions