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

QR code: "ValueError: No appropriate mode" #12

Open
leo-b opened this issue Mar 12, 2018 · 1 comment · May be fixed by #13
Open

QR code: "ValueError: No appropriate mode" #12

leo-b opened this issue Mar 12, 2018 · 1 comment · May be fixed by #13

Comments

@leo-b
Copy link

leo-b commented Mar 12, 2018

Please add the following patch, which fixes a typo in eclevel to ecval conversion:

--- elaphe/qrcode.py~   2017-05-03 18:50:22.000000000 +0200
+++ elaphe/qrcode.py    2018-03-12 12:30:58.957870018 +0100
@@ -264,7 +264,7 @@
         n_msgbits = len(mid)+cclen+n_msgbits
 
     # logging.debug('enc=%s fmt=%s eclv=%s ver=%s' % (encoding, format_, eclevel, version))
-    ecval = 'LHQM'.index(eclevel)
+    ecval = 'LMQM'.index(eclevel)
     if version:
         version = str(version)
     for frmt, vers, size, asp2, asp3, nmod, ecws_list, ecb_list in QRCODE_METRIC:

See also:
https://bitbucket.org/whosaysni/elaphe/issues/81/valueerror-no-appropriate-mode-when-using

@graingert
Copy link
Collaborator

Please open a PR for this change

@leo-b leo-b linked a pull request Mar 14, 2018 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants