Skip to content

Commit

Permalink
Merge pull request #2298 from 6vision/error_print_ascii_windows
Browse files Browse the repository at this point in the history
Handle ASCII QR code print error on Windows
  • Loading branch information
6vision authored Sep 11, 2024
2 parents 6831743 + c91e7c3 commit bb5ecfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion channel/wechat/wechat_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb5ecfc

Please sign in to comment.