Ticket #196 (closed defect: fixed)
sugar-jhbuild: sugar-session: timezone check broken, causing traceback and exit
| Reported by: | sascha_silbe | Owned by: | marcopg |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | sugar | Version: | Git as of bugdate |
| Severity: | Keywords: | ||
| Cc: | Distribution/OS: | ||
| Bug Status: |
Description
AFAIUI, sugar-session tries to get a config entry for the timezone. If there's one, it will set the environment variable TZ.
To check whether there's a config entry, it compares it with the empty string. But at least on Debian lenny, gconf will return None instead, so the sugar-session tries to assign None to an environment variable, which fails.
Traceback (most recent call last):
File "/home/sascha.silbe/src/sugar/sugar-jhbuild/install/bin/sugar-session", line 170, in <module>
main()
File "/home/sascha.silbe/src/sugar/sugar-jhbuild/install/bin/sugar-session", line 137, in main
os.environTZ? = timezone
File "/usr/lib/python2.5/os.py", line 474, in setitem
putenv(key, item)
TypeError: putenv() argument 2 must be string, not None
Relevant code snippet:
client = gconf.client_get_default()
timezone = client.get_string('/desktop/sugar/date/timezone')
if timezone is not :
os.environTZ? = timezone
Replacing "if timezone is not :" with "if not timezone:" will handle both None and the empty string as expected.
