endolith / endolith/plotruler

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

Open Beginner friendly
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## 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`:

```python
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.:

```python
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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in plotruler/__main__.py at _crash_log_path() and inspect how the fallback behaves when LOCALAPPDATA and TEMP are unset on Linux. Choose and implement a platform-appropriate location that cannot create a capitalized PlotRuler directory in the repository, then verify that crash.log is written outside the working tree; consider the related .gitignore suggestion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.