SigrokDriver.stop() in labgrid/driver/sigrokdriver.py calls:
stdout, stderr = self._process.communicate(input="q")
The sigrok-cli process is started via _call_with_driver() / _call() with stdin=subprocess.PIPE and without text=True / universal_newlines=True, so stdin is in binary mode. For such a Popen instance, communicate(input=...) must receive bytes, not str.
On Python 3.11+ (Linux), this raises:
TypeError: memoryview: a bytes-like object is required, not 'str'
(stack trace points at subprocess.py inside _communicate, when handling input).
Steps to reproduce
- Use Labgrid’s SigrokDriver to run capture() then stop() (e.g. continuous capture with sigrok-cli).
- Run on Python ≥ 3.11 on Linux.
Expected behavior
stop() should shut down sigrok-cli without a TypeError (e.g. send quit as bytes).
Suggested fix
Use bytes for the quit character, e.g.:
stdout, stderr = self._process.communicate(input=b"q")
|
stdout, stderr = self._process.communicate(input="q") |
SigrokDriver.stop() in labgrid/driver/sigrokdriver.py calls:
stdout, stderr = self._process.communicate(input="q")The sigrok-cli process is started via _call_with_driver() / _call() with stdin=subprocess.PIPE and without text=True / universal_newlines=True, so stdin is in binary mode. For such a Popen instance, communicate(input=...) must receive bytes, not str.
On Python 3.11+ (Linux), this raises:
TypeError: memoryview: a bytes-like object is required, not 'str'(stack trace points at subprocess.py inside _communicate, when handling input).
Steps to reproduce
Expected behavior
stop() should shut down sigrok-cli without a TypeError (e.g. send quit as bytes).
Suggested fix
Use bytes for the quit character, e.g.:
stdout, stderr = self._process.communicate(input=b"q")labgrid/labgrid/driver/sigrokdriver.py
Line 178 in d8caf89