Bug 52018 - Execute UCR with Python 3
Execute UCR with Python 3
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Sebastian Lobinger
:
Depends on: 53299 51316 51588 51598 54233
Blocks:
  Show dependency treegraph
 
Reported: 2020-09-15 16:46 CEST by Florian Best
Modified: 2021-12-10 08:10 CET (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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-09-15 16:46:03 CEST
The UCR scripts should run with Python 3.
Comment 2 Florian Best univentionstaff 2020-09-30 11:23:30 CEST
This depends on the appcenter and the updater being compatble to Python 3 (at least in the parts which are used in the UCR templates).
Comment 3 Florian Best univentionstaff 2020-10-17 10:14:04 CEST
https://jenkins.knut.univention.de:8181/job/UCS-5.0/job/UCS-5.0-0/job/Tests%20-%20AD%20Connector%20(ec2)/Version=w2k8r2-german/2/console
12:08:40   File "/usr/lib/python3/dist-packages/six.py", line 692, in reraise
12:08:40     raise value.with_traceback(tb)
12:08:40   File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 307, in handle
12:08:40     self.__handler.init()
12:08:40   File "/usr/lib/python3/dist-packages/univention/management/console/modules/adconnector/__init__.py", line 155, in init
12:08:40     self.__update_status()
12:08:40   File "/usr/lib/python3/dist-packages/univention/management/console/modules/adconnector/__init__.py", line 360, in __update_status
12:08:40     ucr.load()
12:08:40   File "/usr/lib/python3/dist-packages/univention/config_registry/backend.py", line 143, in load
12:08:40     reg.load()
12:08:40   File "/usr/lib/python3/dist-packages/univention/config_registry/backend.py", line 536, in load
12:08:40     for line in reg_file:
12:08:40   File "/usr/lib/python3.7/encodings/ascii.py", line 26, in decode
12:08:40     return codecs.ascii_decode(input, self.errors)[0]
12:08:40 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4977: ordinal not in range(128)
Comment 4 Florian Best univentionstaff 2020-11-24 19:59:19 CET
(In reply to Florian Best from comment #3)
This was caused by a process without a set locale, e.g. because environment variables are cleared.
Fixed in:
univention-config-registry (15.0.4-1)
40081d083f25 | fixup! Bug #52018: open files with UTF-8 encoding
4925a79a2009 | Bug #52018: open files with UTF-8 encoding

All scripts are migrated in:
univention-config-registry (15.0.4-1)
88af724e8066 | Bug #52018 UCR: Use contextmanager for open()
66bba75ce065 | Bug #52018 UCR: Fix DeprecationWarning: collections.MutableMapping
5b10065557ce | Bug #52018 UCR: python3 compatibility fixes

changelog-5.0-0.xml
b7fb9c2c78d7 | Changelog Bug #52157 Bug #52018
Comment 5 Florian Best univentionstaff 2020-11-25 15:15:20 CET
The last thing which had to be done was that run_filter() returny binary output - aka. what the python subprocesses print. This might be binary output in case of e.g. '/etc/univention/templates/files/usr/share/univention-management-console/i18n/de/apps.mo'.

univention-config-registry (15.0.4-1)
28cc2e6896da | Bug #52018: allow UCR templates to print binary output in run_filter()
Comment 6 Sebastian Lobinger univentionstaff 2020-12-04 09:24:06 CET
I have reviewd the code and also test build and update of ucr packages and tested that ucr still works as before.
Comment 7 Florian Best univentionstaff 2021-05-25 16:02:19 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".