[PyPy-issue] [issue609] different behavior for subprocess?

Martijn Faassen pypy-dev-issue at codespeak.net
Sun Dec 12 18:52:38 CET 2010


New submission from Martijn Faassen <faassen at startifact.com>:

I'm trying to make zc.buildout work with the PyPy trunk (1.4 release won't work
due to missing support for the -E) option. I actually made an older version,
buildout 1.4.3, work, but the most recent release, buildout 1.5.2, fails on PyPy
due to a problem with this code:

def _has_broken_dash_S(executable):
    """Detect https://bugs.launchpad.net/virtualenv/+bug/572545 ."""
    # The first attempt here was to simply have the executable attempt to import
    # ConfigParser and return the return code. That worked except for tests on
    # Windows, where the return code was wrong for the fake Python executable
    # generated by the virtualenv.txt test, apparently because setuptools' .exe
    # file does not pass the -script.py's returncode back properly, at least in
    # some circumstances. Therefore...print statements.
    stdout, stderr = subprocess.Popen(
        [executable, '-Sc',
         'try:\n'
         '    import ConfigParser\n'
         'except ImportError:\n'
         '    print 1\n'
         'else:\n'
         '    print 0\n'],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    return bool(int(stdout.strip()))

This fails because stdout.strip() actually gives an empty string instead of the
value expected. 

It's of course possible that this an issue in zc.buildout (missing
stdout.flush()?), but I'm reporting it here just in case it's a pypy issue.

----------
effort: ???
messages: 1994
nosy: faassen, pypy-issue
priority: bug
release: ???
status: unread
title: different behavior for subprocess?

_______________________________________________________
PyPy development tracker <pypy-dev-issue at codespeak.net>
<https://codespeak.net/issue/pypy-dev/issue609>
_______________________________________________________



More information about the Pypy-issue mailing list