[Python-3000-checkins] r56945 - python/branches/py3k/Lib/idlelib/OutputWindow.py python/branches/py3k/Lib/idlelib/PyShell.py

kurt.kaiser python-3000-checkins at python.org
Sun Aug 12 03:52:36 CEST 2007


Author: kurt.kaiser
Date: Sun Aug 12 03:52:35 2007
New Revision: 56945

Modified:
   python/branches/py3k/Lib/idlelib/OutputWindow.py
   python/branches/py3k/Lib/idlelib/PyShell.py
Log:
1. Catch TypeError exception when writing to OutputWindow
2. PyShell: shell isn't working due to encoding issues.  Temporarily direct
   exceptions to the terminal.  Also, trap exceptions occurring during write()
   instead of passing.

Checking (2)  in temporarily to aid finding the encoding problem in
IOBinding.py


Modified: python/branches/py3k/Lib/idlelib/OutputWindow.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/OutputWindow.py	(original)
+++ python/branches/py3k/Lib/idlelib/OutputWindow.py	Sun Aug 12 03:52:35 2007
@@ -40,6 +40,8 @@
         if isinstance(s, str):
             try:
                 s = str(s, IOBinding.encoding)
+            except TypeError:
+                raise
             except UnicodeError:
                 # some other encoding; let Tcl deal with it
                 pass

Modified: python/branches/py3k/Lib/idlelib/PyShell.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/PyShell.py	(original)
+++ python/branches/py3k/Lib/idlelib/PyShell.py	Sun Aug 12 03:52:35 2007
@@ -825,7 +825,7 @@
         self.console = PseudoFile(self, "console", IOBinding.encoding)
         if not use_subprocess:
             sys.stdout = self.stdout
-            sys.stderr = self.stderr
+###            sys.stderr = self.stderr # Don't redirect exceptions, pyshell NG
             sys.stdin = self
         #
         self.history = self.History(self.text)
@@ -1214,7 +1214,8 @@
             OutputWindow.write(self, s, tags, "iomark")
             self.text.mark_gravity("iomark", "left")
         except:
-            pass
+            raise ###pass  # ### 11Aug07 KBK if we are expecting exceptions
+                           # let's find out what they are and be specific.
         if self.canceled:
             self.canceled = 0
             if not use_subprocess:


More information about the Python-3000-checkins mailing list