Skip to content

Backups made within the same second overwrite each other #12

Closed

Description

@barisgit

kicad_lib_manager/utils/backup.py:28 names backups <file>.backup.%Y%m%d_%H%M%S. Two runs of kilm setup, the env-var updates in utils/env_vars.py, or kilm import (PR #9) on the same file within one second get the same name, and shutil.copy2 overwrites the first backup with the already-modified file, so the original content is lost.

Suspected fix: add sub-second precision or a collision counter, keeping the names sortable for manage_backup_history. Found during review of PR #9; pre-existing on main.

Activity

  1. added a commit that references this issue on Oct 13, 2026
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