[or-cvs] r24227: {arm} fix: Unchecked OSError when making directories could cause c (in arm/trunk/src: . interface util)
Damian Johnson
atagar1 at gmail.com
Mon Feb 14 05:08:16 UTC 2011
Author: atagar
Date: 2011-02-14 05:08:16 +0000 (Mon, 14 Feb 2011)
New Revision: 24227
Modified:
arm/trunk/src/interface/controller.py
arm/trunk/src/interface/logPanel.py
arm/trunk/src/starter.py
arm/trunk/src/util/torConfig.py
Log:
fix: Unchecked OSError when making directories could cause crashes (for instance if the was a permissions issue)
Modified: arm/trunk/src/interface/controller.py
===================================================================
--- arm/trunk/src/interface/controller.py 2011-02-14 04:54:54 UTC (rev 24226)
+++ arm/trunk/src/interface/controller.py 2011-02-14 05:08:16 UTC (rev 24227)
@@ -30,7 +30,7 @@
import graphing.connStats
import graphing.resourceStats
-INCLUDE_CONNPANEL_2 = False
+INCLUDE_CONNPANEL_2 = True
CONFIRM_QUIT = True
REFRESH_RATE = 5 # seconds between redrawing screen
Modified: arm/trunk/src/interface/logPanel.py
===================================================================
--- arm/trunk/src/interface/logPanel.py 2011-02-14 04:54:54 UTC (rev 24226)
+++ arm/trunk/src/interface/logPanel.py 2011-02-14 05:08:16 UTC (rev 24227)
@@ -621,14 +621,14 @@
if self._config["features.logFile"]:
logPath = self._config["features.logFile"]
- # make dir if the path doesn't already exist
- baseDir = os.path.dirname(logPath)
- if not os.path.exists(baseDir): os.makedirs(baseDir)
-
try:
+ # make dir if the path doesn't already exist
+ baseDir = os.path.dirname(logPath)
+ if not os.path.exists(baseDir): os.makedirs(baseDir)
+
self.logFile = open(logPath, "a")
log.log(self._config["log.logPanel.logFileOpened"], "arm %s opening log file (%s)" % (VERSION, logPath))
- except IOError, exc:
+ except (IOError, OSError), exc:
log.log(self._config["log.logPanel.logFileWriteFailed"], "Unable to write to log file: %s" % sysTools.getFileErrorMsg(exc))
self.logFile = None
Modified: arm/trunk/src/starter.py
===================================================================
--- arm/trunk/src/starter.py 2011-02-14 04:54:54 UTC (rev 24226)
+++ arm/trunk/src/starter.py 2011-02-14 05:08:16 UTC (rev 24227)
@@ -145,7 +145,7 @@
msg = DESC_SAVE_SUCCESS_MSG % (descriptorPath, time.time() - loadStartTime)
util.log.log(CONFIG["log.configDescriptions.persistance.loadSuccess"], msg)
- except IOError, exc:
+ except (IOError, OSError), exc:
msg = DESC_SAVE_FAILED_MSG % util.sysTools.getFileErrorMsg(exc)
util.log.log(CONFIG["log.configDescriptions.persistance.saveFailed"], msg)
Modified: arm/trunk/src/util/torConfig.py
===================================================================
--- arm/trunk/src/util/torConfig.py 2011-02-14 04:54:54 UTC (rev 24226)
+++ arm/trunk/src/util/torConfig.py 2011-02-14 05:08:16 UTC (rev 24227)
@@ -244,7 +244,7 @@
def saveOptionDescriptions(path):
"""
Preserves the current configuration descriptors to the given path. This
- raises an IOError if unable to do so.
+ raises an IOError or OSError if unable to do so.
Arguments:
path - location to persist configuration descriptors
More information about the tor-commits
mailing list