diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-09-28 16:58:06 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-09-28 16:58:06 -0700 |
| commit | 616fd077f83b0681555d1b027f729fe4c50d6835 (patch) | |
| tree | e3588f64bba6248f500a20ec40df119f80ac3c09 /expergo.py | |
| parent | 7cf4b355eec8488af774e6d6ce263d7cb7024a95 (diff) | |
fix(windows): handle iter_files error due to UTF-8 beta
Diffstat (limited to 'expergo.py')
| -rw-r--r-- | expergo.py | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -18,12 +18,21 @@ _lyrics_semaphore = threading.Semaphore(3) _claimed_names: set[Path] = set() _claimed_names_lock = threading.Lock() - +_windows_winerror_warning_sent = threading.Event() def iter_files(base: Path) -> Iterator[Path]: for p in base.rglob("*"): - if p.is_file(): - yield p.resolve() + try: + if p.is_file(): + yield p.resolve() + except OSError as e: + if getattr(e, 'winerror', None) == 234: + if not _windows_winerror_warning_sent.is_set(): + print("[WARNING] UTF-8 Beta is enabled on this device, bypassing WinError 234") + _windows_winerror_warning_sent.set() + yield p + else: + continue def find_flacs(base_dir: Path) -> list[Path]: |
