summaryrefslogtreecommitdiffstats
path: root/nixos/lib/test-driver
diff options
context:
space:
mode:
authorKonrad Borowski <konrad@borowski.pw>2020-10-24 11:23:43 +0200
committerKonrad Borowski <konrad@borowski.pw>2020-10-25 16:22:07 +0100
commit254d30d4c95f35d6d0f54c2b1c2a76339ae76de9 (patch)
treecba57cfa6bb063112d5c44792818f5e9f8acfa8e /nixos/lib/test-driver
parentce383a198503a003b309679a6f066ba4a3dfb2be (diff)
test-driver.py: remove bufsize=1 from Popen calls
According to Python documentation [0], `bufsize=1` is only meaningful in text mode. As we don't pass in an argument called `universal_newlines`, `encoding`, `errors` or `text` the file objects aren't opened in text mode, which means the argument is ignored with a warning in Python 3.8. line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used This commit removes this warning that appared when using interactive test driver built with `-A driver`. This is done by removing `bufsize=1` from Popen calls. The default parameter when unspecified for `bufsize` is `-1` which according to the documentation will be interpreted as `io.DEFAULT_BUFFER_SIZE`. As mentioned by a warning, Python already uses default buffer size when providing `buffering=1` parameter for file objects not opened in text mode. [0]: https://docs.python.org/3/library/subprocess.html#subprocess.Popen
Diffstat (limited to 'nixos/lib/test-driver')
-rw-r--r--nixos/lib/test-driver/test-driver.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py
index 156392ad1e32..68bd35dd98e9 100644
--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -110,7 +110,6 @@ def create_vlan(vlan_nr: str) -> Tuple[str, str, "subprocess.Popen[bytes]", Any]
pty_master, pty_slave = pty.openpty()
vde_process = subprocess.Popen(
["vde_switch", "-s", vde_socket, "--dirmode", "0700"],
- bufsize=1,
stdin=pty_slave,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
@@ -748,7 +747,6 @@ class Machine:
self.process = subprocess.Popen(
self.script,
- bufsize=1,
stdin=subprocess.DEVNULL,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,