fix(qq): handle file:// URI on Windows in _read_media_bytes
urlparse on Windows puts the path in netloc, not path. Use (parsed.path or parsed.netloc) to get the correct raw path.
This commit is contained in:
@@ -373,7 +373,9 @@ class QQChannel(BaseChannel):
|
|||||||
try:
|
try:
|
||||||
if media_ref.startswith("file://"):
|
if media_ref.startswith("file://"):
|
||||||
parsed = urlparse(media_ref)
|
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:
|
else:
|
||||||
local_path = Path(os.path.expanduser(media_ref))
|
local_path = Path(os.path.expanduser(media_ref))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user