diff options
author | W. Trevor King <wking@drexel.edu> | 2009-06-21 07:56:05 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-06-21 07:56:05 -0400 |
commit | 8aa307584c1e35dfde114e04ace12b7862579014 (patch) | |
tree | dedce65eb6fe3dd53318a8acc9e0c7e7ca0f9ff3 /libbe | |
parent | 47901fbf10ba498a91a4701129a2f1959d00df67 (diff) | |
download | bugseverywhere-8aa307584c1e35dfde114e04ace12b7862579014.tar.gz |
Touch missing userwide config file before read if it's missing.
Another bug introduced by James Rowe's user-config patch. Obviously
it's hard to read a file if there's no file there. I'm not sure how
it passed the unit tests earlier. Maybe I forgot to install the
pre-commit version before running the test suite... Anyhow, fixed
now.
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/config.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libbe/config.py b/libbe/config.py index 9b1682a..e696eeb 100644 --- a/libbe/config.py +++ b/libbe/config.py @@ -37,6 +37,8 @@ def set_val(name, value, section="DEFAULT", encoding=None): if encoding == None: encoding = default_encoding config = ConfigParser.ConfigParser() + if os.path.exists(path()) == False: # touch file or config + open(path(), "w").close() # read chokes on missing file f = codecs.open(path(), "r", encoding) config.readfp(f, path()) f.close() |