mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
1. Don't encode input strings to bytes.
2. Re-enable stderr redirection.
This commit is contained in:
parent
639a8ffcb7
commit
7cec252b9d
1 changed files with 1 additions and 7 deletions
|
|
@ -827,7 +827,7 @@ def __init__(self, flist=None):
|
||||||
self.console = PseudoFile(self, "console", IOBinding.encoding)
|
self.console = PseudoFile(self, "console", IOBinding.encoding)
|
||||||
if not use_subprocess:
|
if not use_subprocess:
|
||||||
sys.stdout = self.stdout
|
sys.stdout = self.stdout
|
||||||
### sys.stderr = self.stderr # Don't redirect exceptions, pyshell NG
|
sys.stderr = self.stderr
|
||||||
sys.stdin = self
|
sys.stdin = self
|
||||||
#
|
#
|
||||||
self.history = self.History(self.text)
|
self.history = self.History(self.text)
|
||||||
|
|
@ -991,12 +991,6 @@ def readline(self):
|
||||||
line = self.text.get("iomark", "end-1c")
|
line = self.text.get("iomark", "end-1c")
|
||||||
if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C
|
if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C
|
||||||
line = "\n"
|
line = "\n"
|
||||||
if isinstance(line, str):
|
|
||||||
from idlelib import IOBinding
|
|
||||||
try:
|
|
||||||
line = line.encode(IOBinding.encoding)
|
|
||||||
except UnicodeError:
|
|
||||||
pass
|
|
||||||
self.resetoutput()
|
self.resetoutput()
|
||||||
if self.canceled:
|
if self.canceled:
|
||||||
self.canceled = 0
|
self.canceled = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue