From ae7e8cde02ee72fc281434e5f7cd5eea5938050e Mon Sep 17 00:00:00 2001 From: beavailable Date: Mon, 30 Sep 2024 12:17:28 +0800 Subject: [PATCH] Print correct QR code for windows --- share.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share.py b/share.py index 5a5e1f8..fb4c89c 100755 --- a/share.py +++ b/share.py @@ -1391,7 +1391,10 @@ def start_server(address, port, certfile, keyfile, keypass, handler_class, show_ import qrcode qr = qrcode.QRCode() qr.add_data(url) - qr.print_tty(sys.stderr) + if is_windows(): + qr.print_ascii(sys.stderr, False, True) + else: + qr.print_tty(sys.stderr) except ModuleNotFoundError: pass server.serve_forever()