aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-09-28 16:58:06 -0700
committerPinapelz <yukais@pinapelz.com>2026-09-28 16:58:06 -0700
commit616fd077f83b0681555d1b027f729fe4c50d6835 (patch)
treee3588f64bba6248f500a20ec40df119f80ac3c09
parent7cf4b355eec8488af774e6d6ce263d7cb7024a95 (diff)
fix(windows): handle iter_files error due to UTF-8 beta
-rw-r--r--expergo.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/expergo.py b/expergo.py
index 3d98641..7d5a26a 100644
--- a/expergo.py
+++ b/expergo.py
@@ -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]:
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage