Skip to content

Fix Windows readonly deletion and add confirmation menu toggle - #17

Open
lukisch wants to merge 16 commits into
masterfrom
fix/delete-confirmation-20261001
Open

lukisch wants to merge 16 commits into
masterfrom
fix/delete-confirmation-20261001

Conversation

@lukisch

@lukisch lukisch commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Depends on #15 and #14. This branch is the final stack head (8a4f544), with the tested #15/#14 candidate (4145cc3) as its first parent and original PR17 head (3e4331d) as its second parent. Base is master to run the configured pull-request CI. Merge order is #15, then #14, then #17; the independent approval requirement remains. After the earlier PRs land, this PR's diff isolates the deletion changes.

Windows deletion of a folder containing a read-only regular file previously failed with WinError 5. Retry once only for a single-link regular file with the read-only attribute; propagate ACL or sharing failures and restore the attribute after a failed retry. Deletion uses lstat, unlinks selected symlinks and removes selected mount-point junctions without following their targets. Multi-hardlink files keep the original error so aliases retain their attributes.

Adds a translated “Vor dem Löschen nachfragen” checkbox to the Edit menu. Confirmation defaults on, the setting persists immediately in JSON and stays synchronized with Settings. Only explicit JSON false disables the confirmation dialog.

Validation on the combined local source tree at 8a4f544:

  • Full suite: 471 passed, 8 skipped in 376.92s, RC 0. Six Windows symlink tests require a privilege unavailable on this host; the release smoke needs a local packaged EXE, and the screenshot smoke needs a native Qt platform.
  • Focused capacity/query/GC/delete/browser/Store regression tests: 85 passed, 6 symlink-privilege skips in 123.64s, RC 0.
  • Translation check: 362 entries complete in DE/EN/ES/ZH/JA/RU, with all prior values unchanged. Ruff, compileall, and diff check passed.
  • New CI matrix 37142839285 and CodeQL 37142837674 are running on this head.

No package, build, Store submission, or release is claimed.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Welcome! Thanks for your first pull request in this repository.

A maintainer will review it soon. Please make sure:

  • Your changes are tested
  • Documentation is updated if needed
  • The PR description explains what changed and why

Thanks for contributing.

@lukisch
lukisch changed the base branch from master to fix/codex-checksum-close-lifecycle-20261001 October 1, 2026 10:51
Lukas Geiger added 3 commits October 3, 2026 19:19
Signed-off-by: Lukas Geiger <lukas@um-bruch.org>
Signed-off-by: Lukas Geiger <lukas@um-bruch.org>
Signed-off-by: Lukas Geiger <lukas@um-bruch.org>
@lukisch
lukisch changed the base branch from fix/codex-checksum-close-lifecycle-20261001 to master October 3, 2026 18:03

@lukisch lukisch left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zweitmodell-Review: CI grün (12/12), eine Regelfrage für den Maintainer.

1. Löschbestätigung abschaltbar (Projektregel)
delete_selection überspringt den Bestätigungsdialog, wenn general.confirm_delete auf False steht. Die Hard Rule in CLAUDE.md verlangt für Löschen "Bestätigungsdialoge oder sicheres Recycling". Mit abgeschalteter Abfrage ist delete_path ein sofortiges, unwiderrufliches Löschen ohne Papierkorb. Bitte bewusst entscheiden: Option beibehalten (dann in der Doku als Ausnahme festhalten), oder statt Abfrage abschalten auf Papierkorb (send2trash/Qt moveToTrash) umstellen.

2. shutil.rmtree(..., onerror=)
onerror ist seit Python 3.12 deprecated (onexc). Funktioniert noch, erzeugt aber DeprecationWarnings. Vorschlag: onexc ab 3.12, onerror darunter.

3. Positiv
Der Read-only-Retry löscht nur reguläre Einzel-Link-Dateien (Hardlink-Schutz, Rückgabe des Read-only-Bits bei Fehlschlag), Symlinks und Junctions werden nicht durchlaufen. Der Kapazitätsabruf läuft in einem Subprozess mit Timeout (10 s), --drive-capacity-query wird in main.py vor dem Qt-Import behandelt. Keine Credentials oder Nutzerpfade im Diff.

4. Überlappung
drive_usage.py, drive_capacity.py, sidebar_main.py, gui_gc.py und checksum_dialog.py sind auch in #14 enthalten. Bitte Reihenfolge klären.


Generated by Claude Code

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.

1 participant