Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1010900: anki: can't open preferences with python3.10

273 views
Skip to first unread message

Kacper Gutowski

unread,
May 12, 2022, 11:50:04 AM5/12/22
to
Package: anki
Version: 2.1.15+dfsg-3
Severity: normal

When I try to open Preferences, either with Ctrl+P or from menu,
I get the following error:

Anki 2.1.15 (442df9d6) Python 3.10.4 Qt 5.15.2 PyQt 5.15.6
Platform: Linux
Flags: frz=False ao=False sv=2

Caught exception:
File "/usr/share/anki/aqt/main.py", line 882, in onPrefs
aqt.dialogs.open("Preferences", self)
File "/usr/share/anki/aqt/__init__.py", line 82, in open
instance = creator(*args)
File "/usr/share/anki/aqt/preferences.py", line 25, in __init__
self.setupCollection()
File "/usr/share/anki/aqt/preferences.py", line 80, in setupCollection
f.lrnCutoff.setValue(qc['collapseTime']/60.0)
<class 'TypeError'>: setValue(self, int): argument 1 has unexpected type 'float'


Anki uses #!/usr/bin/python3 which is python3.10 on testing. Running
it with python3.9 instead fixes the problem. I suppose closing #958853
(i.e. packaging a new upstream version) would make this irrelevant,
but maybe it could be somehow mitigated in the meantime.

-k


-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (900, 'testing'), (700, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.15.0-3-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages anki depends on:
ii libjs-jquery 3.6.0+dfsg+~3.5.13-1
ii libjs-jquery-flot 4.2.1+dfsg-5
ii libjs-jquery-ui 1.13.1+dfsg-1
ii libjs-mathjax 2.7.9+dfsg-1
ii libqt5core5a 5.15.2+dfsg-16+b1
ii python3 3.10.4-1+b1
ii python3-bs4 4.11.1-1
ii python3-decorator 4.4.2-2
ii python3-distro 1.7.0-1
ii python3-distutils 3.9.12-1
ii python3-jsonschema 3.2.0-5
ii python3-markdown 3.3.7-1
ii python3-pyaudio 0.2.11-1.4
ii python3-pyqt5 5.15.6+dfsg-1+b2
ii python3-pyqt5.qtwebchannel 5.15.6+dfsg-1+b2
ii python3-pyqt5.qtwebengine 5.15.5-1+b1
ii python3-requests 2.27.1+dfsg-1
ii python3-send2trash 1.8.1~b0-1

Versions of packages anki recommends:
pn python3-matplotlib <none>

Versions of packages anki suggests:
ii dvipng 1.15-1.1+b1
ii lame 3.100-3
ii mpv 0.34.1-1+b2

-- no debconf information

Julian Gilbey

unread,
May 13, 2022, 4:10:03 AM5/13/22
to
On Thu, May 12, 2022 at 05:43:14PM +0200, Kacper Gutowski wrote:
> Package: anki
> Version: 2.1.15+dfsg-3
> Severity: normal
>
> When I try to open Preferences, either with Ctrl+P or from menu, I get the
> following error:
> [...]

Dear Kacper,

Oh dear, thanks for letting me know. That should be relatively
straightforward to fix, but I think the long-term solution is to
either package a newer upstream version (which is still not possible
because bazel has not yet been fully packaged for Debian) or to drop
anki from Debian.

Best wishes,

Julian

Andrii Borovyi

unread,
Aug 22, 2022, 6:50:04 AM8/22/22
to
Dear all,

The fix is quite straight-forward. It looks like python 3.10 became
more stricter to checking types, so setValue function can be tweaked a
bit with forcing type to int e.g.:

f.lrnCutoff.setValue(qc['collapseTime']/60.0)

can be updated to

f.lrnCutoff.setValue(int(qc['collapseTime']/60.0))

There are two files I had to update by myself to fix thye issue with
preferences:
- /usr/share/anki/aqt/preferences.py
- /usr/share/anki/aqt/deckconf.py


Andrii

P.S. I'm aware there are issues with the packaging new version for
anki. So please use this suggested fix at your own risk.
0 new messages