diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a15d8f23..cbb2d74c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,9 +76,11 @@ The table below shows which release corresponds to each branch, and what date th - [#2507][2507] Add `+LINUX` and `+WINDOWS` doctest options and start proper testing on Windows - [#2522][2522] Support starting a kitty debugging window with the 'kitten' command +- [#2524][2524] Raise EOFError during `process.recv` when stdout closes on Windows [2507]: https://github.com/Gallopsled/pwntools/pull/2507 [2522]: https://github.com/Gallopsled/pwntools/pull/2522 +[2524]: https://github.com/Gallopsled/pwntools/pull/2524 ## 4.15.0 (`beta`) - [#2508][2508] Ignore a warning when compiling with asm on nix diff --git a/pwnlib/tubes/process.py b/pwnlib/tubes/process.py index a09a49a64..c53ab2e5c 100644 --- a/pwnlib/tubes/process.py +++ b/pwnlib/tubes/process.py @@ -767,9 +767,13 @@ def can_recv_raw(self, timeout): if IS_WINDOWS: with self.countdown(timeout=timeout): - while self.timeout and self._read_queue.empty(): + while self.timeout and self._read_queue.empty() and self._read_thread.is_alive(): time.sleep(0.01) - return not self._read_queue.empty() + if not self._read_queue.empty(): + return True + if not self._read_thread.is_alive(): + raise EOFError + return False try: if timeout is None: