lubuntu-notifier.py crashes with a type mismatch error when packages are to be removed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lubuntu-update-notifier (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned | ||
Lunar |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
In lubuntu-
This SRU fixes the bug by fixing the coding error. Part of the UI code is supposed to pass an Iterable[str] to a particular function when a package is to be removed. Unfortunately, a plain string is being passed to this function instead, and the function does not accept plain strings. The entire fix involves adding two brackets to one line to change the string to a string array.
[ Test plan ]
Ubuntu Jammy and Ubuntu Kinetic do not (yet) have an update for Lubuntu that requires a package to be removed, so this bug is not easy to reproduce (as far as I know) on Jammy or Kinetic. However, inspecting the code should be sufficient. Additionally this bug actually happened in Lunar and this fix worked.
1. Download the lubuntu-
2. Open the lubuntu-notifier.py file.
3. Search for QTreeWidgetItem in the file, and verify that when it is used, it has string arrays being passed to it rather than plain strings.
4. Look at the debdiff and ensure that the only change made from the last version is that "QTreeWidgetIte
[ Where problems could occur ]
If QTreeWidgetItem somehow doesn't take a string array despite my testing in Lunar, then things will probably go awry when an update comes through that has to remove packages. But string arrays are already being passed to QTreeWidgetItem elsewhere in the code, and in Lunar where this bug is reproducible, this fix worked, so I find it very unlikely that this will go wrong.
---
Original bug report:
Steps to reproduce:
1. Boot a Lubuntu Lunar ISO dated 20230325.
2. Run "sudo apt update".
3. Run "/usr/libexec/
Expected result: A window should appear asking if you want to do a system upgrade. Some packages will be listed as to-be-removed.
Actual result: lubuntu-notifier.py crashes and prints out a stacktrace.
Additional info:
The stacktrace:
-----
lubuntu@lubuntu:~$ /usr/libexec/
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Traceback (most recent call last):
File "/usr/libexec/
main(sys.argv, int(options.
File "/usr/libexec/
app = App(upgrades, security_upgrades, reboot_required, upg_path, args)
File "/usr/libexec/
self.dialog = Dialog(upgrades, security_upgrades, reboot_required,
File "/usr/libexec/
self.initUI()
File "/usr/libexec/
td_child = QTreeWidgetItem
TypeError: arguments did not match any overloaded call:
QTreeWidgetIt
QTreeWidgetIt
QTreeWidgetIt
QTreeWidgetIt
QTreeWidgetIt
QTreeWidgetIt
QTreeWidgetIt
QTreeWidgetIt
QTreeWidgetIt
-----
In more readable terms, p.name is a string, while QTreeWidgetItem expects an Iterable[str]. Changing "p.name" to "[p.name]" in the line fixes this in my testing.
This bug was fixed in the package lubuntu- update- notifier - 0.5.4
--------------- update- notifier (0.5.4) lunar; urgency=medium
lubuntu-
* Disconnect the status_changed() function from the status-changed signal in install( ), as it interferes with upgrade_ progress_ download( ).
repair_
(LP: #2012702)
* Don't try to pass a string to QTreeWidgetItem when it expects an
Iterable[str]. (LP: #2012823)
-- Aaron Rainbolt <email address hidden> Sun, 26 Mar 2023 10:48:15 -0500