From 41314e595aa062129c2b8b84d747583f34d6b71f Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 16 May 2010 13:11:18 +1000 Subject: [PATCH] Fix deluged crashing on windows when logfile's directory doesn't exist --- deluge/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deluge/main.py b/deluge/main.py index e4da139c1..4b32e79e1 100644 --- a/deluge/main.py +++ b/deluge/main.py @@ -197,6 +197,11 @@ this should be an IP address", metavar="IFACE", write_pidfile() # Setup the logger + try: + # Try to make the logfile's directory if it doesn't exist + os.makedirs(os.path.abspath(os.path.dirname(options.logfile))) + except: + pass deluge.log.setupLogger(level=options.loglevel, filename=options.logfile) from deluge.log import LOG as log