lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.27k stars 662 forks source link

Version 7.4 can not generate correct qrcode with url length >= 123 #304

Closed gtxx3600 closed 1 year ago

gtxx3600 commented 1 year ago

tried version 7.3.1 and everything works fine

mattiasj-axis commented 1 year ago

Can confirm, this reproducer fails to scan:

import qrcode
qr = qrcode.QRCode(version=8)
qr.add_data("This is a test")
qr.make()
qr.print_ascii(invert=True)

version <= 7 will scan version >= 8 will not scan (tested up to 10)

mattiasj-axis commented 1 year ago

Bisect says f2fee0ae63c49663922bf5827ef8ec024b1df312 is the fault commit

Reverting the changes to create_bytes to how it looked before that commit solves the issue.

iulica commented 1 year ago

That was a bugger, yesterday 100 bills went away with a bad QR code. Please release a fix soon, or remove the buggy version.

Thanks for fixing

Edit: also, I looked for tests and couldn't find one with a larger text.

SmileyChris commented 1 year ago

Yikes! Apologies for this bug. If someone wants to write some test against some larger qr code sizes with their expected results, that might be useful to avoid such a regression again...

I yanked the v7.4 release from pypi and just pushed the fix from @mattiasj-axis as v7.4.1

qxsch commented 1 year ago

@iulica i could work around this with segno. now qr code generation for bills is running stable again.

iulica commented 1 year ago

Thanks, for me it was just installing the previous version. Unfortunately I haven't checked the bills before sending, as they looked quite fine visually. Lesson learned, next time I will quickly check them before sending :). Anyway, thanks for the quick fix and the new version.

Kind regards