]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Revert Rev 1.6
authorKurt B. Kaiser <kbk@shore.net>
Fri, 27 Sep 2002 00:34:31 +0000 (00:34 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Fri, 27 Sep 2002 00:34:31 +0000 (00:34 +0000)
"Merge Py Idle changes:
Rev 1.7 [Python-idle] loewis
Convert characters from the locale's encoding on output.
Reject characters outside the locale's encoding on input."

Not compatible with Python 2.2.1.  Forwardport as a SF patch.

Lib/idlelib/OutputWindow.py

index 181238fea7c0ac134d2c8316f77113f05dd2ef87..7522720c29e10ee258c228aac027fe83225d0be0 100644 (file)
@@ -2,7 +2,6 @@ from Tkinter import *
 from EditorWindow import EditorWindow
 import re
 import tkMessageBox
-import IOBinding
 
 class OutputWindow(EditorWindow):
 
@@ -35,14 +34,6 @@ class OutputWindow(EditorWindow):
     # Act as output file
 
     def write(self, s, tags=(), mark="insert"):
-        # Tk assumes that byte strings are Latin-1;
-        # we assume that they are in the locale's encoding
-        if isinstance(s, str):
-            try:
-                s = unicode(s, IOBinding.encoding)
-            except UnicodeError:
-                # some other encoding; let Tcl deal with it
-                pass
         self.text.insert(mark, s, tags)
         self.text.see(mark)
         self.text.update()