Skip to content

Commit 169b525

Browse files
driver/externalconsoledriver: use bufsize=0 for opening external process
The ExternalConsoleDriver works on top of a command executed on the local computer. Until now the system default of io.DEFAULT_BUFFER_SIZE (typically 8192 bytes) was used for bufsize. This does not work well for this use case, we want unbuffered reads and writes. So set the bufsize to 0, see https://docs.python.org/3/library/subprocess.html#popen-constructor . Signed-off-by: Bastian Krause <bst@pengutronix.de>
1 parent ccf7a3f commit 169b525

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

labgrid/driver/externalconsoledriver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def open(self):
3333
return
3434
cmd = shlex.split(self.cmd)
3535
self._child = subprocess.Popen(
36-
cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None
36+
cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, bufsize=0
3737
)
3838

3939
# make stdout non-blocking

0 commit comments

Comments
 (0)