Opened 15 years ago

Closed 15 years ago

#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.

Change History (2)

comment:1 Changed 15 years ago by sascha_silbe

It should read "if timezone:", of course, not "if not timezone:".

comment:2 Changed 15 years ago by tomeu

  • Resolution set to fixed
  • Status changed from new to closed

Pushed, thanks!

Note: See TracTickets for help on using tickets.