diff --git a/channel/wechat/wechat_channel.py b/channel/wechat/wechat_channel.py index 8b4455481..d79bda042 100644 --- a/channel/wechat/wechat_channel.py +++ b/channel/wechat/wechat_channel.py @@ -100,7 +100,10 @@ def qrCallback(uuid, status, qrcode): qr = qrcode.QRCode(border=1) qr.add_data(url) qr.make(fit=True) - qr.print_ascii(invert=True) + try: + qr.print_ascii(invert=True) + except UnicodeEncodeError: + print("ASCII QR code printing failed due to encoding issues.") @singleton