Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7cec252

Browse files
committed
1. Don't encode input strings to bytes.
2. Re-enable stderr redirection.
1 parent 639a8ff commit 7cec252

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

Lib/idlelib/PyShell.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ def __init__(self, flist=None):
827827
self.console = PseudoFile(self, "console", IOBinding.encoding)
828828
if not use_subprocess:
829829
sys.stdout = self.stdout
830-
### sys.stderr = self.stderr # Don't redirect exceptions, pyshell NG
830+
sys.stderr = self.stderr
831831
sys.stdin = self
832832
#
833833
self.history = self.History(self.text)
@@ -991,12 +991,6 @@ def readline(self):
991991
line = self.text.get("iomark", "end-1c")
992992
if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C
993993
line = "\n"
994-
if isinstance(line, str):
995-
from idlelib import IOBinding
996-
try:
997-
line = line.encode(IOBinding.encoding)
998-
except UnicodeError:
999-
pass
1000994
self.resetoutput()
1001995
if self.canceled:
1002996
self.canceled = 0

0 commit comments

Comments
 (0)