This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: subprocess (Popen) doesn't works properly
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: LambertDW, pitrou, simonbcn
Priority: normal Keywords:

Created on 2009-01-19 01:52 by simonbcn, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg80141 - (view) Author: simonbcn (simonbcn) Date: 2009-01-19 01:52
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.
msg80144 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-01-19 02:21
Please investigate a bit more before posting.
Try the following:

Popen(['mplayer','/tvixhd2/Pelis para montar/00049.m2ts','-msglevel', 
'all=4','-vo', 'null','-ao', 'null','-vf', 'cropdetect','-vid',
'4113','-frames', '500'])
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49244
2009-01-19 02:41:25LambertDWsetnosy: + LambertDW
2009-01-19 02:21:19pitrousetstatus: open -> closed
resolution: not a bug
messages: + msg80144
nosy: + pitrou
2009-01-19 01:52:26simonbcncreate