I have this subprocess.Popen() context manager:
with Popen(
args=command, shell=False, stdout=PIPE, bufsize=1, universal_newlines=True
) as process:
Windows Subsystem for Linux is a bit rubbish. It's got many, many bugs and it's significantly slower than it needs to be. This is just another bug manifesting itself. Here are some possible bottlenecks:
wsl.exe to launch the program (thanks RoadRunner!)systemd(?)There's nothing wrong with your Python code that would make this slow.