summaryrefslogtreecommitdiff
path: root/Lib/idlelib/configHandler.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2008-02-14 04:37:26 +0000
committerKurt B. Kaiser <kbk@shore.net>2008-02-14 04:37:26 +0000
commit0b45f36c819bdf88eaf0e84d4d3beca3d2db9c39 (patch)
tree8d344841a838baad46ad7832042f662943f4653d /Lib/idlelib/configHandler.py
parentf9259d72c8657d47cbcaa873f29783ce005ebc8e (diff)
downloadcpython-git-0b45f36c819bdf88eaf0e84d4d3beca3d2db9c39.tar.gz
Could not open files in .idlerc directory if latter was hidden on Windows.
Issue 1743, Issue 1862. Backport r60225, r60745
Diffstat (limited to 'Lib/idlelib/configHandler.py')
-rw-r--r--Lib/idlelib/configHandler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py
index 826fb5dbb8..3ddb4ed82d 100644
--- a/Lib/idlelib/configHandler.py
+++ b/Lib/idlelib/configHandler.py
@@ -142,7 +142,12 @@ class IdleUserConfParser(IdleConfParser):
"""
if not self.IsEmpty():
- cfgFile=open(self.file,'w')
+ fname = self.file
+ try:
+ cfgFile = open(fname, 'w')
+ except IOError:
+ os.unlink(fname)
+ cfgFile = open(fname, 'w')
self.write(cfgFile)
else:
self.RemoveFile()