Univention Bugzilla – Bug 52641
Migrate ucs-school-umc-helpdesk to Python 3
Last modified: 2021-11-29 17:19:38 CET
The package ucs-school-umc-helpdesk needs to be migrated to Python 3. See: https://hutten.knut.univention.de/mediawiki/index.php/Python_3_Migration
Opening the current UCS@school helpdesk module raises: Interner Server-Fehler in "helpdesk/categories". Request: helpdesk/categories Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 344, in __error_handling six.reraise(etype, exc, etraceback) File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise raise value File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 247, in execute function.__func__(self, request, *args, **kwargs) File "/usr/lib/python3/dist-packages/ucsschool/lib/school_umc_ldap_connection.py", line 153, in wrapper_func return func(*args, **kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/helpdesk/__init__.py", line 160, in categories self.finished(request.id, map(lambda x: {"id": x, "label": x}, categories)) File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 465, in finished self.result(res) File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 469, in result self.signal_emit('success', response) File "/usr/lib/python3/dist-packages/notifier/signals.py", line 87, in signal_emit self.__signals[signal].emit(*args) File "/usr/lib/python3/dist-packages/notifier/signals.py", line 50, in emit if cb(*args): File "/usr/lib/python3/dist-packages/notifier/__init__.py", line 105, in __call__ return self._function(*tmp, **self._kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 141, in _reply self.response(msg) File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 376, in response self.__queue += bytes(msg) File "/usr/lib/python3/dist-packages/univention/management/console/protocol/message.py", line 346, in __bytes__ return Message._formattedMessage(self._id, self._type, self.mimetype, self.command, body, self.arguments) File "/usr/lib/python3/dist-packages/univention/management/console/protocol/message.py", line 123, in _formattedMessage data = json.dumps(body) File "/usr/lib/python3.7/json/__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "/usr/lib/python3.7/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python3.7/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/usr/lib/python3.7/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type map is not JSON serializable Please also migrate map() to list comprehensions.
Interner Server-Fehler in "helpdesk/send". Request: helpdesk/send File "/usr/lib/python3/dist-packages/notifier/threads.py", line 80, in _run result = self._function() File "/usr/lib/python3/dist-packages/notifier/__init__.py", line 105, in __call__ return self._function(*tmp, **self._kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/helpdesk/__init__.py", line 84, in _send_thread msg += u"Subject: =?UTF-8?Q?%s?=\r\n" % (sanitize_header(subject).encode("quopri"),) LookupError: 'quopri' is not a text encoding; use codecs.encode() to handle arbitrary codecs
ucs-school-umc-helpdesk (16.0.2) aff812f7701c | Bug #52641: Migrate ucs-school-umc-helpdesk to Python3 The package ucs-school-umc-helpdesk now runs under Python3
OK: all functionality works with Python 3
UCS@school 5.0 v1 has been released. https://docs.software-univention.de/release-notes-ucsschool-5.0v1-de.html If this error occurs again, please clone this bug.