Message303275
Cornelius:Here is a PoC: I checked out your code and stressed my system with it. (...) AssertionError: ..."
Did you get this failure with my PR 3802?
Cornelius: "We have b'For my pet fish, Eric.\r\n' in the pty buffer. We read b'For my pet fish, Eric.\r' from the buffer into s2. Now len(s2) == len(expected) but a b'\n' is still unread in the buffer. This would make the test fail. I admit, this is a corner case, but also an argument that a clean test case may want to have a readline function."
Right. I can just modify my condition from "len(s2) < len(expected)" to "b'\n' not in s2".
Cornelius: "I also added a pull request which I cannot get to fail on my system. What do you think, haypo?"
Your code calls read(1) in a loop until it gets the newline character b'\n'.
Is it better to os.read(1024) in a loop until the output string contains b'\n'?
I have no strong preference. |
|
Date |
User |
Action |
Args |
2017-09-28 20:18:31 | vstinner | set | recipients:
+ vstinner, xdegaye, martin.panter, cstratak, Cornelius Diekmann |
2017-09-28 20:18:31 | vstinner | set | messageid: <1506629911.41.0.466225441844.issue31158@psf.upfronthosting.co.za> |
2017-09-28 20:18:31 | vstinner | link | issue31158 messages |
2017-09-28 20:18:31 | vstinner | create | |
|