[Bugs] #196 MAJO: sugar-jhbuild: sugar-session: timezone check broken, causing traceback and exit

SugarLabs Bugs bugtracker-noreply at sugarlabs.org
Tue Jan 13 17:47:35 EST 2009


#196: sugar-jhbuild: sugar-session: timezone check broken, causing traceback and
exit
--------------------------+-------------------------------------------------
 Reporter:  sascha_silbe  |       Owner:  marcopg          
     Type:  defect        |      Status:  new              
 Priority:  major         |   Milestone:                   
Component:  sugar         |     Version:  Git as of bugdate
 Keywords:                |  
--------------------------+-------------------------------------------------
 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.environ['TZ'] = 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.environ['TZ'] = timezone


 Replacing "if timezone is not '':" with "if not timezone:" will handle
 both None and the empty string as expected.

-- 
Ticket URL: <http://dev.sugarlabs.org/ticket/196>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list