Univention Bugzilla – Bug 39146
syntax.py replaces locale settings on import
Last modified: 2016-04-26 11:31:26 CEST
Hmm? 3045 class Country(select): 3046 » empty_value = True 3047 3048 » try: 3049 » » locale.setlocale(locale.LC_ALL, "") 3050 » except locale.Error: 3051 » » # unsupported locale setting: a locale was not installed (probably de_DE.UTF-8) 3052 » » pass → LC_ALL of the whole process is reset when including/reloading syntaxes. +++ This bug was initially created as a clone of Bug #39131 +++ Appliance mode: When choosing German as language on the first screen and an english location (tested with boston and new york city), several tracebacks occur and can be found in setup.log. This prevents the configuration and installation of any univention-server-* package. The symptom is that system setup finishes within seconds, and clicking on finish does not complete system setup. Traceback (most recent call last): File "/usr/lib/univention-system-setup/scripts/05_role/10role", line 37, in <module> from univention.management.console.modules.setup.setup_script import AptScript, main, _ File "/usr/lib/pymodules/python2.7/univention/management/console/modules/__init__.py", line 34, in <module> import univention.management.console.protocol File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/__init__.py", line 187, in <module> from session import * File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 69, in <module> from ..acl import LDAP_ACLs File "/usr/lib/pymodules/python2.7/univention/management/console/acl.py", line 72, in <module> import univention.admin.modules File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 44, in <module> import univention.admin.syntax File "/usr/lib/pymodules/python2.7/univention/admin/syntax.py", line 3043, in <module> class Country(select): File "/usr/lib/pymodules/python2.7/univention/admin/syntax.py", line 3164, in Country locale.setlocale(locale.LC_ALL, "") File "/usr/lib/python2.7/locale.py", line 547, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting
Created attachment 7271 [details] set locale for translation of country names without setting the locale for the whole process
*** Bug 39867 has been marked as a duplicate of this bug. ***
Created attachment 7281 [details] patch
Attached a patch which updates the syntax choices dynamically to also allow runtime change of language.
2015-11-17-univention-directory-manager-modules.yaml: r65683 | YMAL Bug #39675 Bug #39146 univention-directory-manager-modules (11.0.2-6): r65682 | Bug #39146: Fix removing of locale by Country syntax class
OK: code OK: YAML (small wording fix r65684)
PS: Manual tests of the translations in the web interface were done during QA, too.
<http://errata.software-univention.de/ucs/4.1/16.html>