[issue4994] subprocess (Popen) doesn't works properly

simonbcn report at bugs.python.org
Mon Jan 19 02:52:27 CET 2009


New submission from simonbcn <simonbcn at gmail.com>:

Python 2.5.2
Ubuntu 8.04.1 64 bits
**************************************************************
-- ATTEMPT 1 --

Python:

Popen(['mplayer','/tvixhd2/Pelis para montar/00049.m2ts','-msglevel
all=4','-vo null','-ao null','-vf cropdetect','-vid 4113','-frames 500'])

stdout & stderr:

Option vf cropdetect: unknown postfix  cropdetect
Supported postfixes are:
  vf-add
 Append the given list to the current list
  vf-pre
 Prepend the given list to the current list
  vf-del x,y,...
 Remove the given elements. Take the list element index (starting from 0).
 Negative index can be used (i.e. -1 is the last element)
  vf-clr
 Clear the current list.
Error analizando la opción en la línea de comandos: -msglevel all=4
MPlayer dev-SVN-r28340-4.2.4 (C) 2000-2009 MPlayer Team
CPU: Intel(R) Core(TM)2 Quad CPU    Q9550  @ 2.83GHz (Family: 6, Model:
23, Stepping: 10)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compilado para CPU x86 con extensiones: MMX MMX2 SSE SSE2

---------------------------------------------------------

In this first example, I get severals errors from ¿python? and then
python executes mplayer without parameters ¿?

**************************************************************
-- ATTEMPT 2 --

Python:

Popen(args=['/tvixhd2/Pelis para montar/00049.m2ts','-msglevel
all=4','-vo null','-ao null','-vf cropdetect','-vid 4113','-frames
500'], executable='mplayer')

stdout & stderr:

Option vf cropdetect: unknown postfix  cropdetect
Supported postfixes are:
  vf-add
 Append the given list to the current list
  vf-pre
 Prepend the given list to the current list
  vf-del x,y,...
 Remove the given elements. Take the list element index (starting from 0).
 Negative index can be used (i.e. -1 is the last element)
  vf-clr
 Clear the current list.
Error analizando la opción en la línea de comandos: -msglevel all=4
MPlayer dev-SVN-r28340-4.2.4 (C) 2000-2009 MPlayer Team
CPU: Intel(R) Core(TM)2 Quad CPU    Q9550  @ 2.83GHz (Family: 6, Model:
23, Stepping: 10)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compilado para CPU x86 con extensiones: MMX MMX2 SSE SSE2
---------------------------------------------------------

The same result

**************************************************************
-- ATTEMPT 3 --

Python:

Popen('mplayer /tvixhd2/Pelis para montar/00049.m2ts -msglevel all=4 -vo
null -ao null -vf cropdetect -vid 4113 -frames 500')

stdout & stderr:

Traceback (most recent call last):
  File ".../temp/eclipse-workspace/gConvM2TS/src/gConvM2TS.py", line
858, in <lambda>
    xml.signal_connect('on_btnCrop_pressed', lambda w:
calcularCrop(ficheroEntrada))
  File ".../temp/eclipse-workspace/gConvM2TS/src/gConvM2TS.py", line
810, in calcularCrop
    Popen('mplayer /tvixhd2/Pelis para montar/00049.m2ts -msglevel all=4
-vo null -ao null -vf cropdetect -vid 4113 -frames 500')
  File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
    errread, errwrite)
  File "/usr/lib/python2.5/subprocess.py", line 1147, in _execute_child
    raise child_exception
OSError: [Errno 2] No existe el fichero ó directorio
---------------------------------------------------------

The error is now: "No such file or directory", What!? I don't understand
nothing!

**************************************************************
-- ATTEMPT 4 --

Python:

Popen(args='/tvixhd2/Pelis para montar/00049.m2ts -msglevel all=4 -vo
null -ao null -vf cropdetect -vid 4113 -frames 500', executable='mplayer')

stdout & stderr:

MPlayer dev-SVN-r28340-4.2.4 (C) 2000-2009 MPlayer Team
CPU: Intel(R) Core(TM)2 Quad CPU    Q9550  @ 2.83GHz (Family: 6, Model:
23, Stepping: 10)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compilado para CPU x86 con extensiones: MMX MMX2 SSE SSE2
---------------------------------------------------------

No error, but the command mplayer is executed without parameters, ¿?

This subprocess Module really works?

---------------------------------------------------------

Python:

Popen(args='mplayer "/tvixhd2/Pelis para montar/00049.m2ts" -msglevel
all=4 -vo null -ao null -vf cropdetect -vid 4113 -frames 500', shell=True)

With "shell=True" it works but I don't want to execute it in this
manner, because thus Python creates two subprocess and it returns the
PID of the open shell but not of the real process of Mplayer.

----------
components: Library (Lib)
messages: 80141
nosy: simonbcn
severity: normal
status: open
title: subprocess (Popen) doesn't works properly
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4994>
_______________________________________


More information about the Python-bugs-list mailing list