From 4557e8af8949f5c7fc16115ac1ba8d9c984be0f2 Mon Sep 17 00:00:00 2001 From: Tobias Leuschner Date: Sat, 9 May 2026 10:45:55 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Fehlerbehandlung=20f=C3=BCr=20I/O-Operat?= =?UTF-8?q?ionen=20w=C3=A4hrend=20des=20Kopiervorgangs=20verbessert=20und?= =?UTF-8?q?=20Versionsnummer=20auf=201.0.17=20erh=C3=B6ht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 13 +++++++++++-- version.txt | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index f735e7d..d4f6b75 100644 --- a/app.py +++ b/app.py @@ -638,6 +638,7 @@ def do_copy(src_dev, dst_dev, cfg): dup_mode = cfg.get('duplicate_handling', 'skip') copied_pairs = [] # [(src, dst)] erfolgreich kopiert skipped = 0 + io_errors = 0 # ── Phase 1: Kopieren ────────────────────────────────────────────── for i, f in enumerate(files): @@ -672,10 +673,16 @@ def do_copy(src_dev, dst_dev, cfg): try: shutil.copy2(f, tmp_f) # Erst in Temp-Datei kopieren os.replace(str(tmp_f), str(dst_f)) # Dann atomar umbenennen - except Exception: + except OSError as copy_err: try: tmp_f.unlink(missing_ok=True) except Exception: pass - raise + io_errors += 1 + add_log(f'⚠ Fehler bei {f.name}: {copy_err}') + with copy_lock: + copy_state.update(done=i+1, + progress=int((i+1)/total*100) if total else 100, + current=str(f.name)) + continue copied_pairs.append((f, dst_f)) with copy_lock: @@ -694,6 +701,8 @@ def do_copy(src_dev, dst_dev, cfg): msg_parts = [f'{len(copied_pairs)} kopiert'] if skipped: msg_parts.append(f'{skipped} übersprungen') + if io_errors: + msg_parts.append(f'{io_errors} Fehler (I/O)') # ── Phase 2: Verifizieren ────────────────────────────────────────── verify_errors = 0 diff --git a/version.txt b/version.txt index d941c12..e92964f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.16 \ No newline at end of file +1.0.17 \ No newline at end of file