Skip to content

Your lightweight open-source personal agent.

fix(qq): handle file:// URI on Windows in _read_media_bytes

chengyongrue4137736f6aa
diff --git a/nanobot/channels/qq.py b/nanobot/channels/qq.py
index 7442e1006..b9d2d64d8 100644
--- a/nanobot/channels/qq.py
+++ b/nanobot/channels/qq.py
@@ -373,7 +373,9 @@ class QQChannel(BaseChannel):
try:
if media_ref.startswith("file://"):
parsed = urlparse(media_ref)
- local_path = Path(unquote(parsed.path))
+ # Windows: path in netloc; Unix: path in path
+ raw = parsed.path or parsed.netloc
+ local_path = Path(unquote(raw))
else:
local_path = Path(os.path.expanduser(media_ref))