uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

Empty output when calling Snap command

Open GlassOfWhiskey opened this issue 4 years ago • 3 comments

  • uvloop version: 0.16.0
  • Python version: 3.8.10
  • Platform: Ubuntu 20.04.3
  • Helm version: v3.7.0
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: Yes
  • Does uvloop behave differently from vanilla asyncio? How?: When calling helm version via asyncio.create_subprocess_exec, vanilla asyncio displays the correct result, while uvloop returns empty stdout.

Steps to reproduce:

Download Helm CLI

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh --version v3.7.0

Run the following Python script

import uvloop

async def _async_helm():
    proc = await asyncio.create_subprocess_exec('helm', 'version', stdout=asyncio.subprocess.PIPE)
    stdout, _ = await proc.communicate()
    print(stdout)

asyncio.run(_async_helm())
# Prints b'version.BuildInfo{Version:"v3.7.0", GitCommit:"eeac83883cb4014fe60267ec6373570374ce770b", GitTreeState:"clean", GoVersion:"go1.16.8"}\n'

uvloop.install()

asyncio.run(_async_helm())
# Prints b''

GlassOfWhiskey avatar Dec 27 '21 18:12 GlassOfWhiskey

It turns out that this is not a Helm problem, but it is related with Snap packages. Installing helm directly through the get_helm script solves the issue, while installing kubectl from Snap presents the same issue as helm installed from Snap.

GlassOfWhiskey avatar Oct 28 '22 21:10 GlassOfWhiskey