[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #4913 [Stem]: Add stem.util.conf.Config.save()
#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs