Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graceful exit for large input data #273

Open
osamuaoki opened this issue Jun 11, 2022 · 0 comments
Open

Graceful exit for large input data #273

osamuaoki opened this issue Jun 11, 2022 · 0 comments

Comments

@osamuaoki
Copy link

Thanks for interesting tool.
Currently, python3-qr command exit with not-so-helpful error exit.

$ gpg  -a --export my_name | head -50 | python3-qr
Traceback (most recent call last):
  File "/usr/bin/python3-qr", line 33, in <module>
    sys.exit(load_entry_point('qrcode==7.3.1', 'console_scripts', 'qr')())
  File "/usr/lib/python3/dist-packages/qrcode/console_scripts.py", line 94, in main
    qr.print_ascii(tty=not opts.ascii)
  File "/usr/lib/python3/dist-packages/qrcode/main.py", line 249, in print_ascii
    self.make()
  File "/usr/lib/python3/dist-packages/qrcode/main.py", line 103, in make
    self.best_fit(start=self.version)
  File "/usr/lib/python3/dist-packages/qrcode/main.py", line 180, in best_fit
    raise exceptions.DataOverflowError()
qrcode.exceptions.DataOverflowError

Please consider to deal this exception gracefully with non-zero exit code and note what is the maximum allowed and reduce noise.
Something along

Error: Input data exceeded maximum size allowed XXXX bytes for YYYY case.
guusbertens added a commit to guusbertens/python-qrcode that referenced this issue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant