Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/turtleart.py
diff options
context:
space:
mode:
Diffstat (limited to 'turtleart.py')
-rwxr-xr-xturtleart.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/turtleart.py b/turtleart.py
index c2933f1..faf5b96 100755
--- a/turtleart.py
+++ b/turtleart.py
@@ -28,6 +28,7 @@ import getopt
import sys
import os
import os.path
+import cStringIO
import errno
try:
@@ -164,8 +165,14 @@ class TurtleMain():
except IOError:
# Opening the config file failed
# We'll assume it needs to be created
- mkdir_p(CONFIG_HOME)
- data_file = open(os.path.join(CONFIG_HOME, 'turtleartrc'), 'a+')
+ try:
+ mkdir_p(CONFIG_HOME)
+ data_file = open(os.path.join(CONFIG_HOME, 'turtleartrc'), 'a+')
+ except IOError:
+ # We can't write to the configuration file, use
+ # a faux file that will persist for the length of
+ # the session.
+ data_file = cStringIO.StringIO()
data_file.write(str(50) + '\n')
data_file.write(str(50) + '\n')
data_file.write(str(800) + '\n')