Univention Bugzilla – Bug 52640
Migrate ucs-school-lib to Python 3
Last modified: 2021-11-29 17:20:02 CET
The package ucs-school-lib needs to be migrated to Python 3. See: https://hutten.knut.univention.de/mediawiki/index.php/Python_3_Migration
Especially this library is the basis for every module. We need to make sure Python 3 compatibility is not lost.
migration already through ucs5.0 rebasing completed
https://git.knut.univention.de/univention/ucsschool/-/merge_requests/10
Traceback (most recent call last): File "01_password_reset", line 26, in test_umc username, userdn = schoolenv.create_user(schoolname) File "/usr/lib/python3/dist-packages/univention/testing/ucsschool/ucs_test_school.py", line 932, in create_user result = cls(**kwargs).create(self.lo) File "/usr/lib/python3/dist-packages/ucsschool/lib/models/base.py", line 608, in create self.call_hooks("pre", "create", lo) File "/usr/lib/python3/dist-packages/ucsschool/lib/models/base.py", line 562, in call_hooks self._call_pyhooks(hook_time, func_name, lo) File "/usr/lib/python3/dist-packages/ucsschool/lib/models/base.py", line 517, in _call_pyhooks all_hooks = _pyhook_loader.get_hook_objects(lo) File "/usr/lib/python3/dist-packages/ucsschool/lib/pyhooks/pyhooks_loader.py", line 209, in get_hook_objects for meth_name, meths in iteritems(self._pyhook_obj_cache) File "/usr/lib/python3/dist-packages/ucsschool/lib/pyhooks/pyhooks_loader.py", line 209, in <listcomp> for meth_name, meths in iteritems(self._pyhook_obj_cache) File "/usr/lib/python3/dist-packages/ucsschool/lib/pyhooks/pyhooks_loader.py", line 207, in <listcomp> ["{}.{}".format(m.im_class.__name__, m.im_func.func_name) for m in meths], AttributeError: 'function' object has no attribute 'im_class'
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/ucsschool/lib/school_umc_base.py", line 127, in schools schools = School.from_binddn(ldap_user_read) File "/usr/lib/python3/dist-packages/ucsschool/lib/models/school.py", line 689, in from_binddn cls.logger.debug("All local schools: Showing all OUs which DN %s can read.", lo.binddn) File "/usr/lib/python3.7/logging/__init__.py", line 1371, in debug self._log(DEBUG, msg, args, **kwargs) File "/usr/lib/python3.7/logging/__init__.py", line 1519, in _log self.handle(record) File "/usr/lib/python3.7/logging/__init__.py", line 1529, in handle self.callHandlers(record) File "/usr/lib/python3.7/logging/__init__.py", line 1591, in callHandlers hdlr.handle(record) File "/usr/lib/python3.7/logging/__init__.py", line 905, in handle self.emit(record) File "/usr/lib/python3.7/logging/handlers.py", line 1234, in emit self.flush() File "/usr/lib/python3.7/logging/handlers.py", line 1310, in flush self.target.handle(record) File "/usr/lib/python3.7/logging/__init__.py", line 905, in handle self.emit(record) File "/usr/lib/python3/dist-packages/ucsschool/lib/models/utils.py", line 272, in emit ud.debug(self._udebug_facility, udebug_level, msg) File "/usr/lib/python3/dist-packages/univention/debug.py", line 63, in debug _debug.debug(category, level, message) TypeError: argument 3 must be str, not bytes
The detection of School-Lib models does not work: MODULE ( WARN ) : UDM object 'cn=…,cn=computers,ou=DEMOSCHOOL,dc=base' does not correspond to a Python class in the UCS school lib.
I will overtake this bug.
All files of the ucs-school-lib have been migrated to Python 3. ucs-school-lib (13.0.3) c3e9e4d154ca | Bug #52640: [ucs-school-lib] migrate to Python 3 changelog-ucsschool-5.0-de.xml 59f0a99b85c9 | Changlog entry
OK - everything is python3 OK - installation no functional tests here, should be covered by jenkins test and product tests
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.