crash.log written into repo root on Linux (breaks Syncthing casing sync)
- Vorherrschende Sprache
- Python
- Sterne
- 1
- Forks
- 0
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## 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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne in plotruler/__main__.py bei _crash_log_path() und prüfe, wie sich der Fallback verhält, wenn LOCALAPPDATA und TEMP unter Linux nicht gesetzt sind. Wähle einen plattformgerechten Speicherort und implementiere ihn so, dass im Repository kein großgeschriebenes PlotRuler-Verzeichnis erstellt werden kann. Überprüfe anschließend, dass crash.log außerhalb des Arbeitsbaums geschrieben wird; berücksichtige den zugehörigen .gitignore-Vorschlag.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- desktop
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 78/100