Skip to content
Snippets Groups Projects
Commit 72ea5f4a authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #9931: fix in handling multiline buffer

parent e8b85072
No related branches found
No related tags found
No related merge requests found
...@@ -51,9 +51,10 @@ class PipeReader: ...@@ -51,9 +51,10 @@ class PipeReader:
def readlines(self, timeout=None): def readlines(self, timeout=None):
self.__fill_line_buffer(timeout) self.__fill_line_buffer(timeout)
lines = self.__line_buffer.split('\n') last_line_end_idx = self.__line_buffer.rfind('\n')
if lines and not lines[-1].endswith('\n'): head = self.__line_buffer[:last_line_end_idx]
self.__line_buffer = lines[-1] self.__line_buffer = self.__line_buffer[last_line_end_idx:]
lines = lines[:-2]
lines = [l for l in head.split('\n') if l]
return lines return lines
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment