FAQ
Hello,

in a test suite in my project (called rvirtualenv [1]) I discovered a
strange behaviour when calling from python a batch file which calles
another python and this calles a shell command.

[1] http://github.com/kvbik/rvirtualenv

I know it sounds pretty strange, but I do this only because I am
testing such specific tool (that has similar functionality like
original virtualenv and there are things like activate.bat commands).

I've uploaded some code snippet here:

https://gist.github.com/709004/6ccc44d6aed5fe694bb2adbef2400bbea92998a1

If anyone could explain me this behaviour I would be more than happy,
because right now it is the only failing test in my project ;).

Thanks in advance, Jakub..

Search Discussions

  • Kvbik at Nov 22, 2010 at 11:24 am
    To be more specific, I have something like this in rvirtualenv itself
    (that's the pokus.py file):

    import os
    os.system("echo 128")

    I generate a batch file like this (that's the pokus.bat file):

    @echo off
    pokus.py

    And after that, I run the pokus.bat file from a test (that's the
    run.py file):

    from subprocess import Popen, PIPE
    p = Popen('pokus.bat', stdout=PIPE, stderr=PIPE, shell=True)
    stdout, stderr = p.communicate()
    print stdout.strip()

    And the problem is, that I don't receive the output of the os.system
    to the PIPE. Probable there is something different on windows stdout
    redirection, because similar stuff works on linux..

    Thanks, Jakub.

    On Nov 21, 8:39?pm, kvbik wrote:
    Hello,

    in a test suite in my project (called rvirtualenv [1]) I discovered a
    strange behaviour when calling from python a batch file which calles
    another python and this calles a shell command.

    [1]http://github.com/kvbik/rvirtualenv

    I know it sounds pretty strange, but I do this only because I am
    testing such specific tool (that has similar functionality like
    original virtualenv and there are things like activate.bat commands).

    I've uploaded some code snippet here:

    https://gist.github.com/709004/6ccc44d6aed5fe694bb2adbef2400bbea92998a1

    If anyone could explain me this behaviour I would be more than happy,
    because right now it is the only failing test in my project ;).

    Thanks in advance, Jakub..

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedNov 21, '10 at 7:39p
activeNov 22, '10 at 11:24a
posts2
users1
websitepython.org

1 user in discussion

Kvbik: 2 posts

People

Translate

site design / logo © 2022 Grokbase