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 <1506629911.41.0.466225441844.issue31158@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-09-28 20:18:31vstinnersetrecipients: + vstinner, xdegaye, martin.panter, cstratak, Cornelius Diekmann
2017-09-28 20:18:31vstinnersetmessageid: <1506629911.41.0.466225441844.issue31158@psf.upfronthosting.co.za>
2017-09-28 20:18:31vstinnerlinkissue31158 messages
2017-09-28 20:18:31vstinnercreate