[Python-checkins] r62448 - in python/trunk/Lib/idlelib: NEWS.txt configHandler.py
amaury.forgeotdarc
python-checkins at python.org
Tue Apr 22 00:35:41 CEST 2008
Author: amaury.forgeotdarc
Date: Tue Apr 22 00:35:30 2008
New Revision: 62448
Log:
Issue 2665: On Windows, sys.stderr does not contain a valid file when running without a console.
It seems to work, but will fail at the first flush.
This causes IDLE to crash when too many warnings are printed.
Will backport.
Modified:
python/trunk/Lib/idlelib/NEWS.txt
python/trunk/Lib/idlelib/configHandler.py
Modified: python/trunk/Lib/idlelib/NEWS.txt
==============================================================================
--- python/trunk/Lib/idlelib/NEWS.txt (original)
+++ python/trunk/Lib/idlelib/NEWS.txt Tue Apr 22 00:35:30 2008
@@ -1,3 +1,11 @@
+What's New in IDLE 2.6a3?
+=========================
+
+*Release date: XX-XXX-2008*
+
+- Issue #2665: On Windows, an IDLE installation upgraded from an old version
+ would not start if a custom theme was defined.
+
What's New in IDLE 2.6a1?
=========================
Modified: python/trunk/Lib/idlelib/configHandler.py
==============================================================================
--- python/trunk/Lib/idlelib/configHandler.py (original)
+++ python/trunk/Lib/idlelib/configHandler.py Tue Apr 22 00:35:30 2008
@@ -204,7 +204,10 @@
if not os.path.exists(userDir):
warn = ('\n Warning: os.path.expanduser("~") points to\n '+
userDir+',\n but the path does not exist.\n')
- sys.stderr.write(warn)
+ try:
+ sys.stderr.write(warn)
+ except IOError:
+ pass
userDir = '~'
if userDir == "~": # still no path to home!
# traditionally IDLE has defaulted to os.getcwd(), is this adequate?
@@ -247,7 +250,10 @@
' from section %r.\n'
' returning default value: %r\n' %
(option, section, default))
- sys.stderr.write(warning)
+ try:
+ sys.stderr.write(warning)
+ except IOError:
+ pass
return default
def SetOption(self, configType, section, option, value):
@@ -356,7 +362,10 @@
'\n from theme %r.\n'
' returning default value: %r\n' %
(element, themeName, theme[element]))
- sys.stderr.write(warning)
+ try:
+ sys.stderr.write(warning)
+ except IOError:
+ pass
colour=cfgParser.Get(themeName,element,default=theme[element])
theme[element]=colour
return theme
@@ -610,7 +619,10 @@
'\n from key set %r.\n'
' returning default value: %r\n' %
(event, keySetName, keyBindings[event]))
- sys.stderr.write(warning)
+ try:
+ sys.stderr.write(warning)
+ except IOError:
+ pass
return keyBindings
def GetExtraHelpSourceList(self,configSet):
More information about the Python-checkins
mailing list