[SRU] Caught exception: aqt.dialogs.open("Preferences", self)
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
anki (Debian) |
New
|
Unknown
|
||||
anki (Ubuntu) | Status tracked in Oracular | |||||
Jammy |
Fix Released
|
Medium
|
Unassigned | |||
Mantic |
Won't Fix
|
Medium
|
Unassigned | |||
Noble |
Fix Released
|
Medium
|
Unassigned | |||
Oracular |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[ Impact ]
Users will fail to open the preferences window to set their preferences.
The usual window will not be displayed instead the windows will have an error message:
Caught exception:
File "/usr/share/
aqt.
File "/usr/share/
instance = creator(*args)
File "/usr/share/
self.
File "/usr/share/
f.lrnCutoff
<class 'TypeError'>: setValue(self, int): argument 1 has unexpected type 'float'
[ Test Plan ]
install anki.
start anki
Click on Tools -> Preferences
If the package is not fixed the Prefenrences window will show the above error.
With the fixed package, we can open the Preferences window after anki has started.
Just to test anki still works:
1. Click on "Create Deck" and create a deck
2. Create a file in any folder with the content "what am I doing?;Testing SRU" or any content you want with text separated by semicolons.
3. Click on File -> Import and select the text file created in above step.
4. Click on the Deck name, and then click on "Study Now".
5. It should show the question "what am I doing?"
6. Click on "Show Answer", and it will show "Testing SRU".
[ Where problems could occur ]
The typecast to int of 'timeLim' might cause some change in the time limit if the user tries to change that value in the preferences. Since it is being divided by 60.0 so any value from 0 to 59 will result in the 'timeLim' being set to 0. So, users who are using this range of value may find the timelimit not working.
[ Other Info ]
The problem is because of the strict type checking in Python 3.10 and was fixed via https:/
But that change missed one line in the preferences code, which resulted in this problem.
I have added this change in that old patch instead of creating a new patch.
For Jammy:
https:/
[ Original Bug Description ]
This happens when trying to open Tools -> Preferences
Error
An error occurred. Please use Tools > Check Database to see if that fixes the problem.
If problems persist, please report the problem on our support site. Please copy and paste the information below into your report.
Anki 2.1.15 (442df9d6) Python 3.10.7 Qt 5.15.6 PyQt 5.15.7
Platform: Linux
Flags: frz=False ao=False sv=1
Caught exception:
File "/usr/share/
aqt.
File "/usr/share/
instance = creator(*args)
File "/usr/share/
self.
File "/usr/share/
f.lrnCutoff
<class 'TypeError'>: setValue(self, int): argument 1 has unexpected type 'float'
ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: anki 2.1.15+dfsg-3
ProcVersionSign
Uname: Linux 5.19.0-38-generic x86_64
NonfreeKernelMo
ApportVersion: 2.23.1-0ubuntu3
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: KDE
Date: Sun Apr 9 21:20:59 2023
InstallationDate: Installed on 2023-02-25 (43 days ago)
InstallationMedia: Kubuntu 22.10 "Kinetic Kudu" - Release amd64 (20221020)
PackageArchitec
SourcePackage: anki
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in anki (Ubuntu Jammy): | |
status: | New → In Progress |
Changed in anki (Ubuntu Mantic): | |
status: | New → In Progress |
Changed in anki (Ubuntu Noble): | |
status: | New → In Progress |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
Changed in anki (Ubuntu Mantic): | |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
Changed in anki (Ubuntu Jammy): | |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
importance: | Undecided → Medium |
Changed in anki (Ubuntu Mantic): | |
importance: | Undecided → Medium |
Changed in anki (Ubuntu Noble): | |
importance: | Undecided → Medium |
Changed in anki (Ubuntu Oracular): | |
importance: | Undecided → Medium |
Changed in anki (Ubuntu Oracular): | |
assignee: | Sudip Mukherjee (sudipmuk) → nobody |
status: | In Progress → Fix Committed |
summary: |
- Caught exception: aqt.dialogs.open("Preferences", self) + [SRU] Caught exception: aqt.dialogs.open("Preferences", self) |
description: | updated |
Changed in anki (Ubuntu Noble): | |
assignee: | Sudip Mukherjee (sudipmuk) → nobody |
Changed in anki (Ubuntu Mantic): | |
assignee: | Sudip Mukherjee (sudipmuk) → nobody |
Changed in anki (Debian): | |
status: | Unknown → New |
I have the same problem with few small version differences (for example, I am using Ubuntu 22.04-jammy). When I run anki (same version) on another box running 20.04-focal, this error does not occur.
I think the problem is due to the change in the Qt5 and/or Python versions between 20.04 and 22.04 for the same version of anki, 2.1.15 (442df9d6).
When I get the error described here, the version info is
Anki 2.1.15 (442df9d6) Python 3.10.6 Qt 5.15.3 PyQt 5.15.6
When I find the version info on my 20.04 box, I find
Anki 2.1.15 (442df9d6) Python 3.08.2 Qt 5.12.8 PyQt 5.14.1
Something changed. Are there other apps the need these new versions of Qt and/or Python?
I don't know how many ways this error occurs, but trying to open Tools->Preferences is definitely the main one. I thought I encountered it doing something else, but that doesn't seem to be the case.
I would add that I can work around the problem by using the -X option with ssh to connect from the 22.04 machine to the 20.04 machine.