Skip to content

Fix silent save failures and list crash on fresh clone - #9

Merged
KirobotDev merged 1 commit into
mainfrom
fix/secret-dir-issue8
Sep 5, 2026
Merged

Fix silent save failures and list crash on fresh clone#9
KirobotDev merged 1 commit into
mainfrom
fix/secret-dir-issue8

Conversation

@KirobotDev

Copy link
Copy Markdown
Owner

Fixes #8

On a fresh clone, secret/ is gitignored and never created, so:

  • save (opt 1) silently fails: commands/add.py opens sqlite3.connect("./secret/passwords.db") without the directory existing, and the bare except Exception swallows the error, printing Error: unable to open database file and returning success.
  • list (opt 2) crashes with sqlite3.OperationalError: unable to open database file because the connect happens outside any try/except.

Change

Create the secret/ directory before writing to it:

  • commands/add.py: os.makedirs("./secret", exist_ok=True) before sqlite3.connect so save no longer silently fails and list finds the DB.
  • japanese/commands/add.py: same guard before writing password files to ./secret/.

Ensure the secret/ directory is created before opening the database
or writing password files, so a fresh clone (where secret/ is
gitignored) does not fail.

- commands/add.py: os.makedirs('./secret', exist_ok=True) before
  sqlite3.connect, so save (opt 1) no longer silently fails and
  list (opt 2) no longer crashes with 'unable to open database file'.
- japanese/commands/add.py: same guard before writing password files.

Closes #8
@KirobotDev KirobotDev self-assigned this Sep 5, 2026
@KirobotDev
KirobotDev merged commit b6d0a47 into main Sep 5, 2026
@KirobotDev
KirobotDev deleted the fix/secret-dir-issue8 branch September 5, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: fresh clone cannot save passwords — secret/ dir never created

1 participant