2023-03-26 15:56:46 |
Aaron Rainbolt |
bug |
|
|
added bug |
2023-03-26 17:22:07 |
Aaron Rainbolt |
nominated for series |
|
Ubuntu Jammy |
|
2023-03-26 17:22:07 |
Aaron Rainbolt |
bug task added |
|
lubuntu-update-notifier (Ubuntu Jammy) |
|
2023-03-26 17:22:16 |
Aaron Rainbolt |
nominated for series |
|
Ubuntu Lunar |
|
2023-03-26 17:22:16 |
Aaron Rainbolt |
bug task added |
|
lubuntu-update-notifier (Ubuntu Lunar) |
|
2023-03-26 18:16:44 |
Aaron Rainbolt |
description |
Steps to reproduce:
1. Boot a Lubuntu Lunar ISO dated 20230325.
2. Run "sudo apt update".
3. Run "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0".
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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Traceback (most recent call last):
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 266, in <module>
main(sys.argv, int(options.upgrades), int(options.security_upgrades),
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 231, in main
app = App(upgrades, security_upgrades, reboot_required, upg_path, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 223, in __init__
self.dialog = Dialog(upgrades, security_upgrades, reboot_required,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 59, in __init__
self.initUI()
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 132, in initUI
td_child = QTreeWidgetItem(p.name)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
QTreeWidgetItem(type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(other: QTreeWidgetItem): argument 1 has unexpected type 'str'
-----
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. |
[ Impact ]
In lubuntu-update-notifier, the lubuntu-notifier.py script displays a pop-up that allows the user to install system updates if they are available. This pop-up works just fine as long as the only changes to be made are packages being installed or updated, but thanks to a coding error, it fails to pop up if any packages are to be removed. This means that, if an update is going to remove packages, it won't be displayed to the user. This will make it so that the user is no longer notified to update their system until the package that needs removed is removed, requiring manual user intervention. In the worst case, a user who doesn't know how to use the terminal and doesn't realize that the lack of update prompts is a bad thing may end up with their system not updating (except for updates that unattended-upgrades installs in the background).
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 does 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. However, inspecting the code should be sufficient.
1. Download the lubuntu-update-notifier source package from jammy-proposed.
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 "QTreeWidgetItem(p.name)" has been changed to "QTreeWidgetItem([p.name])".
[ 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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0".
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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Traceback (most recent call last):
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 266, in <module>
main(sys.argv, int(options.upgrades), int(options.security_upgrades),
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 231, in main
app = App(upgrades, security_upgrades, reboot_required, upg_path, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 223, in __init__
self.dialog = Dialog(upgrades, security_upgrades, reboot_required,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 59, in __init__
self.initUI()
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 132, in initUI
td_child = QTreeWidgetItem(p.name)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
QTreeWidgetItem(type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(other: QTreeWidgetItem): argument 1 has unexpected type 'str'
-----
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. |
|
2023-03-26 21:45:55 |
Aaron Rainbolt |
nominated for series |
|
Ubuntu Kinetic |
|
2023-03-26 21:45:55 |
Aaron Rainbolt |
bug task added |
|
lubuntu-update-notifier (Ubuntu Kinetic) |
|
2023-03-26 21:48:30 |
Aaron Rainbolt |
description |
[ Impact ]
In lubuntu-update-notifier, the lubuntu-notifier.py script displays a pop-up that allows the user to install system updates if they are available. This pop-up works just fine as long as the only changes to be made are packages being installed or updated, but thanks to a coding error, it fails to pop up if any packages are to be removed. This means that, if an update is going to remove packages, it won't be displayed to the user. This will make it so that the user is no longer notified to update their system until the package that needs removed is removed, requiring manual user intervention. In the worst case, a user who doesn't know how to use the terminal and doesn't realize that the lack of update prompts is a bad thing may end up with their system not updating (except for updates that unattended-upgrades installs in the background).
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 does 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. However, inspecting the code should be sufficient.
1. Download the lubuntu-update-notifier source package from jammy-proposed.
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 "QTreeWidgetItem(p.name)" has been changed to "QTreeWidgetItem([p.name])".
[ 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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0".
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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Traceback (most recent call last):
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 266, in <module>
main(sys.argv, int(options.upgrades), int(options.security_upgrades),
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 231, in main
app = App(upgrades, security_upgrades, reboot_required, upg_path, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 223, in __init__
self.dialog = Dialog(upgrades, security_upgrades, reboot_required,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 59, in __init__
self.initUI()
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 132, in initUI
td_child = QTreeWidgetItem(p.name)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
QTreeWidgetItem(type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(other: QTreeWidgetItem): argument 1 has unexpected type 'str'
-----
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. |
[ Impact ]
In lubuntu-update-notifier, the lubuntu-notifier.py script displays a pop-up that allows the user to install system updates if they are available. This pop-up works just fine as long as the only changes to be made are packages being installed or updated, but thanks to a coding error, it fails to pop up if any packages are to be removed. This means that, if an update is going to remove packages, it won't be displayed to the user. This will make it so that the user is no longer notified to update their system until the package that needs removed is removed, requiring manual user intervention. In the worst case, a user who doesn't know how to use the terminal and doesn't realize that the lack of update prompts is a bad thing may end up with their system not updating (except for updates that unattended-upgrades installs in the background).
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.
1. Download the lubuntu-update-notifier source package from jammy-proposed or kinetic-proposed.
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 "QTreeWidgetItem(p.name)" has been changed to "QTreeWidgetItem([p.name])".
[ 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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0".
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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Traceback (most recent call last):
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 266, in <module>
main(sys.argv, int(options.upgrades), int(options.security_upgrades),
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 231, in main
app = App(upgrades, security_upgrades, reboot_required, upg_path, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 223, in __init__
self.dialog = Dialog(upgrades, security_upgrades, reboot_required,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 59, in __init__
self.initUI()
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 132, in initUI
td_child = QTreeWidgetItem(p.name)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
QTreeWidgetItem(type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(other: QTreeWidgetItem): argument 1 has unexpected type 'str'
-----
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. |
|
2023-03-26 21:48:42 |
Aaron Rainbolt |
bug |
|
|
added subscriber Ubuntu Stable Release Updates Team |
2023-03-26 21:51:01 |
Aaron Rainbolt |
description |
[ Impact ]
In lubuntu-update-notifier, the lubuntu-notifier.py script displays a pop-up that allows the user to install system updates if they are available. This pop-up works just fine as long as the only changes to be made are packages being installed or updated, but thanks to a coding error, it fails to pop up if any packages are to be removed. This means that, if an update is going to remove packages, it won't be displayed to the user. This will make it so that the user is no longer notified to update their system until the package that needs removed is removed, requiring manual user intervention. In the worst case, a user who doesn't know how to use the terminal and doesn't realize that the lack of update prompts is a bad thing may end up with their system not updating (except for updates that unattended-upgrades installs in the background).
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.
1. Download the lubuntu-update-notifier source package from jammy-proposed or kinetic-proposed.
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 "QTreeWidgetItem(p.name)" has been changed to "QTreeWidgetItem([p.name])".
[ 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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0".
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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Traceback (most recent call last):
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 266, in <module>
main(sys.argv, int(options.upgrades), int(options.security_upgrades),
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 231, in main
app = App(upgrades, security_upgrades, reboot_required, upg_path, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 223, in __init__
self.dialog = Dialog(upgrades, security_upgrades, reboot_required,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 59, in __init__
self.initUI()
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 132, in initUI
td_child = QTreeWidgetItem(p.name)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
QTreeWidgetItem(type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(other: QTreeWidgetItem): argument 1 has unexpected type 'str'
-----
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. |
[ Impact ]
In lubuntu-update-notifier, the lubuntu-notifier.py script displays a pop-up that allows the user to install system updates if they are available. This pop-up works just fine as long as the only changes to be made are packages being installed or updated, but thanks to a coding error, it fails to pop up if any packages are to be removed. This means that, if an update is going to remove packages, it won't be displayed to the user. This will make it so that the user is no longer notified to update their system until the package that needs removed is removed, requiring manual user intervention. In the worst case, a user who doesn't know how to use the terminal and doesn't realize that the lack of update prompts is a bad thing may end up with their system not updating (except for updates that unattended-upgrades installs in the background).
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-update-notifier source package from jammy-proposed or kinetic-proposed.
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 "QTreeWidgetItem(p.name)" has been changed to "QTreeWidgetItem([p.name])".
[ 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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0".
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/lubuntu-update-notifier/lubuntu-notifier.py -p /usr/bin/lubuntu-upgrader -u 1 -s 0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Traceback (most recent call last):
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 266, in <module>
main(sys.argv, int(options.upgrades), int(options.security_upgrades),
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 231, in main
app = App(upgrades, security_upgrades, reboot_required, upg_path, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 223, in __init__
self.dialog = Dialog(upgrades, security_upgrades, reboot_required,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 59, in __init__
self.initUI()
File "/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py", line 132, in initUI
td_child = QTreeWidgetItem(p.name)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
QTreeWidgetItem(type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidget, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, strings: Iterable[str], type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(parent: QTreeWidgetItem, preceding: QTreeWidgetItem, type: int = QTreeWidgetItem.Type): argument 1 has unexpected type 'str'
QTreeWidgetItem(other: QTreeWidgetItem): argument 1 has unexpected type 'str'
-----
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. |
|
2023-03-28 22:38:07 |
Launchpad Janitor |
lubuntu-update-notifier (Ubuntu Lunar): status |
New |
Fix Released |
|
2023-03-31 14:47:25 |
Timo Aaltonen |
lubuntu-update-notifier (Ubuntu Kinetic): status |
New |
Fix Committed |
|
2023-03-31 14:47:28 |
Timo Aaltonen |
bug |
|
|
added subscriber SRU Verification |
2023-03-31 14:47:31 |
Timo Aaltonen |
tags |
|
verification-needed verification-needed-kinetic |
|
2023-03-31 14:55:41 |
Timo Aaltonen |
lubuntu-update-notifier (Ubuntu Jammy): status |
New |
Fix Committed |
|
2023-03-31 14:55:45 |
Timo Aaltonen |
tags |
verification-needed verification-needed-kinetic |
verification-needed verification-needed-jammy verification-needed-kinetic |
|
2023-04-14 22:29:25 |
Aaron Rainbolt |
tags |
verification-needed verification-needed-jammy verification-needed-kinetic |
verification-done verification-done-jammy verification-done-kinetic |
|
2023-04-19 05:01:19 |
Launchpad Janitor |
lubuntu-update-notifier (Ubuntu Jammy): status |
Fix Committed |
Fix Released |
|
2023-04-19 05:01:24 |
Chris Halse Rogers |
removed subscriber Ubuntu Stable Release Updates Team |
|
|
|
2023-04-19 05:01:35 |
Launchpad Janitor |
lubuntu-update-notifier (Ubuntu Kinetic): status |
Fix Committed |
Fix Released |
|