[Python-checkins] cpython (2.7): Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
serhiy.storchaka
python-checkins at python.org
Wed Dec 25 13:25:34 CET 2013
http://hg.python.org/cpython/rev/526dcd51e425
changeset: 88179:526dcd51e425
branch: 2.7
parent: 88159:ee924673d83a
user: Serhiy Storchaka <storchaka at gmail.com>
date: Wed Dec 25 14:24:17 2013 +0200
summary:
Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
files:
Lib/idlelib/PyShell.py | 3 +++
Misc/NEWS | 2 ++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1393,6 +1393,9 @@
line = self._line_buffer or self.shell.readline()
if size < 0:
size = len(line)
+ eol = line.find('\n', 0, size)
+ if eol >= 0:
+ size = eol + 1
self._line_buffer = line[size:]
return line[:size]
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -118,6 +118,8 @@
IDLE
----
+- Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
+
- Issue #19481: print() of unicode, str or bytearray subclass instance in IDLE
no more hangs.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list