AnKing-VIP / The-KING-of-Button-Add-ons

Customize answer buttons in Anki
https://www.ankingmed.com
GNU General Public License v3.0
7 stars 7 forks source link

Type error #16

Closed GrimPixel closed 1 year ago

GrimPixel commented 2 years ago

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site. Debug info: Anki 2.1.50 (81cc5a09) Python 3.10.1 Qt 5.15.2 PyQt 5.15.6 Platform: Linux Flags: frz=False ao=True sv=2 Add-ons, last update check: 2022-01-21 23:41:20 Add-ons possibly involved: ⁨The KING of Button Add-ons, Numeric Keypad Remapping ease bugs fixed, Replay buttons on card, Open linked pdf docx epub audiovideo etc in external Program⁩

Caught exception: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/aqt/webview.py", line 41, in cmd return json.dumps(self.onCmd(str)) File "/usr/lib/python3.10/site-packages/aqt/webview.py", line 148, in _onCmd return self._onBridgeCmd(str) File "/usr/lib/python3.10/site-packages/aqt/webview.py", line 602, in _onBridgeCmd return self.onBridgeCmd(cmd) File "/usr/lib/python3.10/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), kw) File "/usr/lib/python3.10/site-packages/anki/hooks.py", line 89, in decorator_wrapper return repl(*args, *kwargs) File "/usr/lib/python3.10/site-packages/anki/hooks.py", line 86, in repl return new(_old=old, args, kwargs) File "/home/grim/.local/share/Anki2/addons21/879473266/reviewer.py", line 14, in myLinkHandler return _old(self, url) File "/usr/lib/python3.10/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), kw) File "/usr/lib/python3.10/site-packages/anki/hooks.py", line 89, in decorator_wrapper return repl(*args, *kwargs) File "/usr/lib/python3.10/site-packages/anki/hooks.py", line 86, in repl return new(_old=old, args, kwargs) File "/home/grim/.local/share/Anki2/addons21/879473266/linked__view.py", line 24, in myLinkHandler return _old(self, url) File "/home/grim/.local/share/Anki2/addons21/498789867/init.py", line 103, in review_link_handler_wrapper original_review_link_handler(reviewer, url) File "/usr/lib/python3.10/site-packages/aqt/reviewer.py", line 511, in _linkHandler self._answerCard(val) File "/home/grim/.local/share/Anki2/addons21/653807651/init.py", line 54, in newAnswerCard _oldAnswerCard(self, ease) File "/usr/lib/python3.10/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), kw) File "/usr/lib/python3.10/site-packages/anki/hooks.py", line 89, in decorator_wrapper return repl(*args, *kwargs) File "/usr/lib/python3.10/site-packages/anki/hooks.py", line 83, in repl new(args, kwargs) File "/home/grim/.local/share/Anki2/addons21/374005964/confirmation.py", line 69, in answerCard_before x2 = aw.mapToGlobal(QPoint(x2+int(round(aw.width()/2, 0)), 0)).x() TypeError: arguments did not match any overloaded call: QPoint(): too many arguments QPoint(int, int): argument 1 has unexpected type 'float' QPoint(QPoint): argument 1 has unexpected type 'float'

Ban3 commented 2 years ago

This is related to Python 3.10 no longer doing implicit conversion to int (https://bugs.python.org/issue37999). Explicitly converting the x coordinates to int before creating QPoint works.