> The new API is more consistent and is the recommended approach to invoking subprocesses in Python code [...] https://docs.python.org/3/whatsnew/3.5.html#whatsnew-subprocess
@@ -65,4 +65,6 @@ def uuid_bytes_to_str(uuid_bytes: bytes) -> str:
def generate_uuid4_bytes() -> bytes:
- return subprocess.check_output(["uuid", "-v", "4", "-F", "BIN"]).strip()
+ return subprocess.run(
+ ["uuid", "-v", "4", "-F", "BIN"], stdout=subprocess.PIPE, check=True
+ ).stdout.strip()