aboutsummaryrefslogtreecommitdiff
path: root/gitosis/serve.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitosis/serve.py')
-rw-r--r--gitosis/serve.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/gitosis/serve.py b/gitosis/serve.py
index b0f4b9c..496f942 100644
--- a/gitosis/serve.py
+++ b/gitosis/serve.py
@@ -66,7 +66,15 @@ def main():
die("Command to run looks dangerous")
cfg = RawConfigParser()
- cfg.read(options.config)
+ try:
+ conffile = file(options.config)
+ except (IOError, OSError), e:
+ # I trust the exception has the path.
+ die("Unable to read config file: %s." % e)
+ try:
+ cfg.readfp(conffile)
+ finally:
+ conffile.close()
os.chdir(os.path.expanduser('~'))