From 0b45f36c819bdf88eaf0e84d4d3beca3d2db9c39 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Thu, 14 Feb 2008 04:37:26 +0000 Subject: [PATCH] Could not open files in .idlerc directory if latter was hidden on Windows. Issue 1743, Issue 1862. Backport r60225, r60745 --- Lib/idlelib/NEWS.txt | 3 +++ Lib/idlelib/configHandler.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 5c08a92371e..06e4ad44411 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ What's New in IDLE 1.2.2c1? *Release date: XX-FEB-2008* +- Could not open files in .idlerc directory if latter was hidden on Windows. + Issue 1743, Issue 1862. (backport r60225, r60745) + - format_paragraph_event wasn't returning a 'break' (backport r59453) - Corrected some bugs in AutoComplete. Also, Page Up/Down in ACW implemented; diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py index 826fb5dbb81..3ddb4ed82d0 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()