Jan Spurny added the comment:

I'm probably experiencing the same problem - and I've found a way to 
demonstrate it (almost) reliably:

    import multiprocessing
    import subprocess
    import os

    def x():
        fn = '/tmp/somevideo.avi'
        p = subprocess.Popen('mplayer -identify -frames 0 ' + fn, shell=True,
                             stderr=subprocess.PIPE, stdout=subprocess.PIPE)
        stdout, stderr = p.communicate('')

    os.system('stty -a > 1.txt')
    processes = []
    for i in xrange(2):
        p = multiprocessing.Process(target=x)
        p.start()
        processes.append(p)

    for p in processes:
        p.join()

    os.system('stty -a > 2.txt')
    os.system('diff 1.txt 2.txt')

The result is:

    < isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop 
-echoprt
    ---
    > isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop 
-echoprt


when I replace the Popen call with:    

    p = subprocess.Popen(['mplayer', '-identify', '-frames', '0', fn], 
shell=False,

the problem is no longer there (diff prints nothing).

It's clear that the problem is caused by mplayer, which usualy runs
interactively and captures user's input.. but I'm pretty sure it's still a bug.

I'm using Debian 8.2, amd64, python2.7.9

----------
nosy: +JanSpurny
Added file: http://bugs.python.org/file41447/a.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22662>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to