settings: Make settings code more robust
commit871ffdfdcd59279249b6875e72741fcb67c68257
authorDavid Aguilar <davvid@gmail.com>
Wed, 28 Mar 2012 07:02:54 +0000 (28 00:02 -0700)
committerDavid Aguilar <davvid@gmail.com>
Wed, 28 Mar 2012 07:02:54 +0000 (28 00:02 -0700)
treef0fcfaef2b0d90eecbd40885c2ff713d73213b81
parenta6056caf0eb51f462ee81383aa8eb7fc8cb0d12e
settings: Make settings code more robust

Guard against bad data beyond simple JSON parsing errors.
We now ignore valid JSON with garbage data as well.

Although this never happens in practice, users with a malicious
$EDITOR could break the settings file and thus break cola in a
not-obvious-to-fix way, so make this code extra robust.

Signed-off-by: David Aguilar <davvid@gmail.com>
cola/settings.py