fix(platforms): make QR fallback install tip target the active interpreter

The Feishu, WeCom, QQ onboarding and Telegram managed-bot flows printed a
hard-coded 'pip install qrcode' tip when the qrcode package was missing. In
Hermes' isolated venv the bare pip either doesn't exist or targets an
unrelated system Python. Print '{sys.executable} -m pip install qrcode'
instead, matching the existing codebase convention for install hints.

Fixes #111695
This commit is contained in:
Kevin Rajan
2026-09-15 03:06:36 -05:00
committed by Teknium
parent 3250020b34
commit 505b36b7af
5 changed files with 18 additions and 4 deletions
+2 -1
View File
@@ -30,6 +30,7 @@ import logging
import mimetypes
import os
import re
import sys
import threading
import time
import uuid
@@ -4103,7 +4104,7 @@ def _qr_register_inner(*, initial_domain: str, timeout_seconds: int) -> Optional
print(f"\n Scan the QR code above, or open this URL directly:\n {qr_url}")
else:
print(f" Open this URL in Feishu / Lark on your phone:\n\n {qr_url}\n")
print(" Tip: pip install qrcode to display a scannable QR code here next time")
print(f" Tip: {sys.executable} -m pip install qrcode to display a scannable QR code here next time")
print()
result = _poll_registration(
device_code=begin["device_code"], interval=begin["interval"],
+2 -1
View File
@@ -10,6 +10,7 @@ import asyncio
import json
import logging
import re
import sys
import time
import uuid
from datetime import datetime, timezone
@@ -674,7 +675,7 @@ def qr_scan_for_bot_info(*, timeout_seconds: int = _QR_POLL_TIMEOUT) -> Optional
print(f"\n Scan the QR code above, or open this URL directly:\n {page_url}")
except Exception:
print(f" Open this URL in WeCom on your phone:\n\n {page_url}\n")
print(" Tip: pip install qrcode to display a scannable QR code here next time")
print(f" Tip: {sys.executable} -m pip install qrcode to display a scannable QR code here next time")
print("\n Fetching configuration results...", end="", flush=True)
deadline = time.monotonic() + timeout_seconds
query_url = f"{_QR_QUERY_URL}?scode={urllib.parse.quote(scode)}"