Author: andar
Revision: 5327
Log:
Catch exception when trying to open config file
Diff:
Modified: trunk/deluge/config.py
===================================================================
--- trunk/deluge/config.py 2009-05-30 00:22:14 UTC (rev 5326)
+++ trunk/deluge/config.py 2009-05-30 01:32:25 UTC (rev 5327)
@@ -281,8 +281,14 @@
"""
if not filename:
filename = self.__config_file
- data = open(filename, "rb")
+
try:
+ data = open(filename, "rb")
+ except IOError, e:
+ log.warning("Unable to open config file %s: %s", filename, e)
+ return
+
+ try:
self.__format_version = int(data.readline())
except ValueError:
pass
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---