Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly handle py3 RawIOBase read()
Python3's RawIOBase guarantees only one syscall per read() requiring a loop to accumulate the desired number of bytes or actually reach EOF. TextIOBase.read does issue multiple syscalls (it must to correctly decode partial unicode characters), but subunit unwraps that to get a binary stream, and at least some of the time the layering is io.TextIOBase(_io.FileIO), where _io.FileIO is a RawIOBase subclass rather than BufferedIOBase. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Partial-bug: #1813147
- Loading branch information
1 parent
8fb3e0c
commit 26d31fa
Showing
1 changed file
with
26 additions
and
17 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