subprocess.Popen only accepts sequences

Create issue
Issue #3050 resolved
Markus Unterwaditzer created an issue

This works in CPython (it prints something) but does not work in PyPy:

from subprocess import check_output

print(check_output(iter("echo hello world".split())))

The Python docs say that subprocess requires args to be a sequence, so this program is buggy already. However, since pypy mostly attempts to be bug-compatible to CPython (or at least sometimes does), I figured it’d be worth reporting here.

Tested with CPython2/3 and pypy2/3:

  • [PyPy 6.0.0 with GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]
  • CPython 2.7 and 3.7

Comments (6)

  1. Armin Rigo

    It does work for me using PyPy3, more precisely:

    Python 3.6.1 (784b254d669919c872a505b807db8462b6140973, May 09 2019, 13:17:30)
    [PyPy 7.1.1-beta0 with GCC 8.3.0] on linux

    It fails with PyPy2, which I've fixed now in 6e42888fc78a (thanks!).

    I'm going to check the current trunk of PyPy3 now.

  2. Markus Unterwaditzer reporter

    Oh sorry, you are right, it actually works. I think I mixed up my test setup.

    The only case failing is pypy2.

  3. Log in to comment