Bug 51282 - Fix python3 compatibility in python-notifier
Fix python3 compatibility in python-notifier
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Philipp Hahn
:
Depends on: 50461
Blocks: 49060 53249
  Show dependency treegraph
 
Reported: 2020-05-13 10:25 CEST by Florian Best
Modified: 2021-05-25 16:03 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-05-13 10:25:43 CEST
When running the UMC-Server in Python 3 with python-notifier I receive a crash:

Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-server", line 244, in <module>
    umc_daemon.do_action()
  File "/usr/lib/python3/dist-packages/daemon/runner.py", line 267, in do_action
    func(self)
  File "/usr/lib/python3/dist-packages/daemon/runner.py", line 186, in _start
    self.app.run()
  File "/usr/sbin/univention-management-console-server", line 211, in run 
    notifier.loop()
  File "/usr/lib/python3/dist-packages/notifier/nf_generic.py", line 296, in loop
    step()
  File "/usr/lib/python3/dist-packages/notifier/nf_generic.py", line 239, in step
    for i, timer in __timers.items():
RuntimeError: dictionary changed size during iteration

Patch: notifier/nf_generic.py +239
-»  »   for i, timer in __timers.items():
+»  »   for i, timer in list(__timers.items()):

+++ This bug was initially created as a clone of Bug #50461 +++

python-notifier needs to be migrated to Python 3.
Comment 1 Florian Best univentionstaff 2020-07-06 13:34:10 CEST
Fixed in:

python-notifier (0.9.7-8)
| Bug #51282: fix python3 compatibility for timers:
Comment 2 Florian Best univentionstaff 2020-07-13 10:12:59 CEST
Another issue:
notifier.Callback defined __cmp__ and __nonzero__ which was not converted. This leads to memory leaks (Bug #50583) in Python 3.

Fixed in:
9927189962ab | Bug #51282: fix notifier.Callback comparability
Comment 3 Philipp Hahn univentionstaff 2021-03-09 15:38:39 CET
OK: be11167292fcf9b7fe697b4d3db21568c51a2fae
OK: 9927189962ab
OK: tox

(In reply to Florian Best from comment #1)
> Fixed in:
> 
> python-notifier (0.9.7-8)
> | Bug #51282: fix python3 compatibility for timers:

Wrong reference, should be
be11167292fcf9b7fe697b4d3db21568c51a2fae Fix iteration in python3

OK: No changelog required as this is a fixup of https://errata.software-univention.de/#/?erratum=4.4x400
Comment 4 Florian Best univentionstaff 2021-05-25 16:03:21 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".