STINNER Victor <victor.stin...@gmail.com> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31158> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com