Skip to content

Windows file permission errors when saving overrides/settings #153

@winterbourne

Description

@winterbourne

Symptoms

  • Saving overrides, settings, or other data frequently fails on Windows
  • Error messages are unclear or missing
  • Workaround is to manually run attrib -R / attrib +R on files
  • Setting file to read-only prevents crashes but blocks saves
  • No clear feedback in the Web UI when a save fails

Root Causes

  1. pronunciation_store.py:_save_db() uses shutil.move() which doesn't handle Windows file locking
  2. No cleanup of stale temp files before writing
  3. Weak error reporting—500 errors with no user-facing message

Expected Behavior

  • All saves should work without permission errors
  • If a save fails, show a clear error message to the user
  • No need for manual file permission commands

Impact

  • MEDIUM – Setup/troubleshooting friction; experienced users only
  • Lost data if save silently fails
  • User confusion about why files need manual permission changes

Fix Required

  1. Use os.replace() for atomic writes (Windows-compatible)
  2. Delete stale temp files before writing
  3. Add robust error handling with user-facing messages
  4. Log errors for debugging

Part of a larger set of bugs found during testing: see also issue #150, #151, #152.

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