This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Cornelius Diekmann, cstratak, martin.panter, vstinner, xdegaye
Date 2017-09-28.20:18:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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 in a loop until the output string contains b'\n'?

I have no strong preference.
Date User Action Args
2017-09-28 20:18:31vstinnersetrecipients: + vstinner, xdegaye, martin.panter, cstratak, Cornelius Diekmann
2017-09-28 20:18:31vstinnersetmessageid: <>
2017-09-28 20:18:31vstinnerlinkissue31158 messages
2017-09-28 20:18:31vstinnercreate