changeset: 88181:2a4c083f8f6b parent: 88178:8a334a509dc2 parent: 88180:8f75d8ddc95b user: Serhiy Storchaka date: Wed Dec 25 14:27:16 2013 +0200 files: Lib/idlelib/PyShell.py Misc/NEWS description: Issue #20058: sys.stdin.readline() in IDLE now always returns only one line. diff -r 8a334a509dc2 -r 2a4c083f8f6b Lib/idlelib/PyShell.py --- a/Lib/idlelib/PyShell.py Tue Dec 24 22:28:04 2013 -0500 +++ b/Lib/idlelib/PyShell.py Wed Dec 25 14:27:16 2013 +0200 @@ -1384,6 +1384,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 -r 8a334a509dc2 -r 2a4c083f8f6b Misc/NEWS --- a/Misc/NEWS Tue Dec 24 22:28:04 2013 -0500 +++ b/Misc/NEWS Wed Dec 25 14:27:16 2013 +0200 @@ -240,6 +240,8 @@ IDLE ---- +- Issue #20058: sys.stdin.readline() in IDLE now always returns only one line. + - Issue #19481: print() of string subclass instance in IDLE no longer hangs. - Issue #18270: Prevent possible IDLE AttributeError on OS X when no initial