[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +1057 ___ Python tracker ___ ___

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-10-08 Thread Steve Dower
Steve Dower added the comment: I didn't see your patch, but I made basically the same fix and added a test. -- status: open -> closed ___ Python tracker

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-10-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4d4aefa52f49 by Steve Dower in branch '3.6': Issue #28162: Fixes Ctrl+Z handling in console readall() https://hg.python.org/cpython/rev/4d4aefa52f49 New changeset 947fa496ca6f by Steve Dower in branch 'default': Issue #28162: Fixes Ctrl+Z handling

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-20 Thread Eryk Sun
Eryk Sun added the comment: For breaking out of the readall while loop, you only need to check if the current read is empty: /* when the read is empty we break */ if (n == 0) break; Also, the logic is wrong here: if (len == 0 || buf[0] == '\x1a' &&

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-17 Thread Steve Dower
Steve Dower added the comment: The fix here was changing "n > 0 && buf[len] == '\x1a'" into "n == 0 || buf[len] == '\x1a'" when returning an empty bytes. Previously we were falling into the conversion code which wasn't happy with n == 0. -- resolution: -> fixed stage: needs patch ->

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset d0bab9fda568 by Steve Dower in branch '3.6': Issue #28161: Opening CON for write access fails https://hg.python.org/cpython/rev/d0bab9fda568 New changeset 187a114b9ef4 by Steve Dower in branch 'default': Issue #28161: Opening CON for write access

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-17 Thread Steve Dower
Steve Dower added the comment: Unfortunately, very hard to test this because it requires interacting with an actual console. But it's an easy fix. -- assignee: -> steve.dower stage: test needed -> needs patch ___ Python tracker

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: For a console readall(), if the first line starts with '\x1a' (i.e. Ctrl+Z), it breaks out of its read loop before incrementing len. Thus the input isn't handled properly as EOF, for which the check requires len > 0. Instead it ends up calling WideCharToMultiByte