-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return buffered data on first EOF in tube.readline() (#2376)
* Return buffered data on first EOF in tube.readline() When there is still data available in the tube buffer when an EOFError occurs in `tube.recvline()`, return that data even though it doesn't contain a newline. The next time `tube.recvline()` is called afterwards will raise EOFError normally. This behavior is in line with the GNU readline implementation and avoids loss of data. It allows `tube.stream()` to print everything that's received before the receiving end terminates. A new warning is logged when data is returned due to an EOF informing about the lack of the trailing newline character. Fixes #2366 * Update CHANGELOG * Add context.throw_eof_on_incomplete_line Allow to control the behavior of `tube.recvline` and be able to suppress the new warning. * Cleanup docs
- Loading branch information
1 parent
7ac5a34
commit f2f55f3
Showing
3 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters