[tor-bugs] #4913 [Stem]: Add stem.util.conf.Config.save()

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Mon Jan 16 11:44:04 UTC 2012


#4913: Add stem.util.conf.Config.save()
-------------------------+--------------------------------------------------
 Reporter:  gsathya      |          Owner:  atagar        
     Type:  enhancement  |         Status:  needs_revision
 Priority:  normal       |      Milestone:                
Component:  Stem         |        Version:                
 Keywords:               |         Parent:                
   Points:               |   Actualpoints:                
-------------------------+--------------------------------------------------

Comment(by gsathya):

 ACK! I just saw that you passed Multiple=True to Config.get_value(), in
 your latest commit.  Now with the above example, when we call
 Config.save() we'd be storing
 {{{
 login.password foo bar
 }}}
 Right?

 Now, if we were to read that file again
 {{{
       user_config = stem.util.conf.get_config("relogin")
       user_config.load("/home/foo/myConfig")

       user_config.get("login.password")
       #The password becomes "foobar" which is wrong!
       #This is because we strip out all the whitespaces
       #after the first whitespace and store them as the
       #value.
       #key, value = line.split(" ", 1)
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4913#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list