Bug 52641 - Migrate ucs-school-umc-helpdesk to Python 3
Migrate ucs-school-umc-helpdesk to Python 3
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 5.0
Other Linux
: P5 normal (vote)
: UCS@school 5.0 v1
Assigned To: Håkan Källberg
Florian Best
: interim-1
Depends on:
Blocks: 52578
  Show dependency treegraph
 
Reported: 2021-01-12 15:25 CET by Florian Best
Modified: 2021-11-29 17:19 CET (History)
0 users

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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-01-12 15:25:17 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
Comment 2 Florian Best univentionstaff 2021-06-07 18:01:41 CEST
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.
Comment 3 Florian Best univentionstaff 2021-06-14 14:48:48 CEST
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
Comment 4 Håkan Källberg univentionstaff 2021-06-17 15:10:26 CEST
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
Comment 5 Florian Best univentionstaff 2021-06-22 16:12:07 CEST
OK: all functionality works with Python 3
Comment 6 Jürn Brodersen univentionstaff 2021-11-29 17:19:38 CET
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.