mportesdev
(Michal Porteš)
1
I noticed behavior in Python 3.11.1 that is inconsistent with earlier versions. I’d appreciate if someone tried to reproduce this.
Minimal example:
import asyncio
async def get_command_stdout(cmd, *args):
proc = await asyncio.create_subprocess_exec(
cmd, *args, stdout=asyncio.subprocess.PIPE,
)
stdout, _ = await proc.communicate()
return stdout
async def main():
return await asyncio.gather(
get_command_stdout('echo', 'foo'),
get_command_stdout('echo', 'bar'),
)
if __name__ == '__main__':
print(asyncio.run(main()))
In Python 3.10.9 and 3.11.0 the result is always as I would expect, i.e.
[b'foo\n', b'bar\n']
however in Python 3.11.1 I am constantly getting
[b'', b'bar\n']
I suspect this might be a bug/regression.
All Python versions mentioned above were built with pyenv on Ubuntu 22.04.
I can reproduce this on my machine, adding extra commands shows that only the output of the last command is correct.
Could you file an issue about this on github?
mportesdev
(Michal Porteš)
4
@ronaldoussoren Thanks for your response. Someone already opened an issue: