]> granicus.if.org Git - python/commitdiff
1. Don't encode input strings to bytes.
authorKurt B. Kaiser <kbk@shore.net>
Fri, 31 Aug 2007 04:15:13 +0000 (04:15 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Fri, 31 Aug 2007 04:15:13 +0000 (04:15 +0000)
2. Re-enable stderr redirection.

Lib/idlelib/PyShell.py

index 6ec625178de03bb1b216fbb5b228593fded9aa2e..3f9f567362763e60730777234c3604422fb8371b 100644 (file)
@@ -827,7 +827,7 @@ class PyShell(OutputWindow):
         self.console = PseudoFile(self, "console", IOBinding.encoding)
         if not use_subprocess:
             sys.stdout = self.stdout
-###            sys.stderr = self.stderr # Don't redirect exceptions, pyshell NG
+            sys.stderr = self.stderr
             sys.stdin = self
         #
         self.history = self.History(self.text)
@@ -991,12 +991,6 @@ class PyShell(OutputWindow):
         line = self.text.get("iomark", "end-1c")
         if len(line) == 0:  # may be EOF if we quit our mainloop with Ctrl-C
             line = "\n"
-        if isinstance(line, str):
-            from idlelib import IOBinding
-            try:
-                line = line.encode(IOBinding.encoding)
-            except UnicodeError:
-                pass
         self.resetoutput()
         if self.canceled:
             self.canceled = 0