-
Notifications
You must be signed in to change notification settings - Fork 711
Open
Description
If I feed a moderately large (9599 byte) text file into qr, it raises a ValueError exception:
(venv) jeffs@frmwrk16:~/software/python$ qr < /home/jeffs/Downloads/Python-3.10.0/Lib/idlelib/README.txt > idlelib_README.png
Traceback (most recent call last):
File "/home/jeffs/software/python/venv/bin/qr", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/jeffs/software/python/venv/lib/python3.12/site-packages/qrcode/console_scripts.py", line 138, in main
img = qr.make_image(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jeffs/software/python/venv/lib/python3.12/site-packages/qrcode/main.py", line 353, in make_image
self.make()
File "/home/jeffs/software/python/venv/lib/python3.12/site-packages/qrcode/main.py", line 156, in make
self.best_fit(start=self.version)
^^^^^^^^^^^^
File "/home/jeffs/software/python/venv/lib/python3.12/site-packages/qrcode/main.py", line 104, in version
self.best_fit()
File "/home/jeffs/software/python/venv/lib/python3.12/site-packages/qrcode/main.py", line 226, in best_fit
self.version = bisect_left(
^^^^^^^^^^^^
File "/home/jeffs/software/python/venv/lib/python3.12/site-packages/qrcode/main.py", line 111, in version
util.check_version(value)
File "/home/jeffs/software/python/venv/lib/python3.12/site-packages/qrcode/util.py", line 184, in check_version
raise ValueError(f"Invalid version (was {version}, expected 1 to 40)")
ValueError: Invalid version (was 41, expected 1 to 40)
(venv) jeffs@frmwrk16:~/software/python$
I changed 40 to 41 in util.py line 183 and that change got past the check but then another exception was raised:
File "/home/jeffs/software/python/venv/lib/python3.12/site-packages/qrcode/main.py", line 230, in best_fit
raise exceptions.DataOverflowError()
qrcode.exceptions.DataOverflowError
At that point, I realized that the problem is non-trivial, so I defer to the maintainers.
Thank you
Metadata
Metadata
Assignees
Labels
No labels