Installed samsung tools on ubuntu 12.10, utf8 turkish laptop.
I had crashes both with system service and session service when the system locale was turkish, and when I change my system locale to english utf8, everything was ok.
I could trace the problem to reading of config files, the library that python provides changes keynames to lowercase. When reading config items, it fails to convert "BACKLIGHT_HOTKEY" text to lowercase resulting in "backlIght_hotkey" instead of "backlight_hotkey", and this causes problems. (In turkish, lowercase of I is a special unicode character, and uppercase of i is a special unicode character. In the code the strings used for keys are not unicode but ascii, so python lowercase method doesn't know how to represent those characters in ascii strings, and leaves them intact).
You can test the faulty behavior by setting system locale to utf8 turkish:
Code: Select all
# cat /etc/default/locale
LANG="tr_TR.UTF-8"
I fixed the problem by making both the session service and system service run in POSIX locale. Actually, the session/system services themselves do not set or use locale, and while it is not set, python lets them run in POSIX. Then, when the DBUS libraries are included, it sets the process locale according to environment variables, and this changes behavior of string.lower(), and this causes the mentioned problems.
/usr/lib/samsung-tools/session-service.py:
Code: Select all
if __name__ == '__main__':
# UPDATED
if os.getenv('LC_ALL') != 'POSIX':
os.putenv('LC_ALL', 'POSIX')
os.execvp(sys.argv[0], sys.argv)
# UPDATED
dbus.mainloop.glib.DBusGMainLoop(set_as_default = True)
Code: Select all
if __name__ == '__main__':
# UPDATED
if os.getenv('LC_ALL') != 'POSIX':
os.putenv('LC_ALL', 'POSIX')
os.execvp(sys.argv[0], sys.argv)
# UPDATED
dbus.mainloop.glib.DBusGMainLoop(set_as_default = True)