Package: python
Version: 2.4.4-2

I'm witnessing inexplicable effect when trying to deliver SIGKILL from
a python script to running mplayer process.

The script:

#!/usr/bin/python

import subprocess
import os
import signal
import time

PATH_MPLAYER='/usr/bin/mplayer'
cmdList = [PATH_MPLAYER, '/home/woodmood/tmp/delme.wav']
# proc = subprocess.Popen (cmdList)
pid = os.spawnv (os.P_NOWAIT, PATH_MPLAYER, cmdList)
time.sleep (5)
# os.kill (proc.pid, signal.SIGTERM)
os.kill (pid, signal.SIGKILL)
os.wait()

What happens when run from Konsole is that mplayer dies, *without*
writing anything to the terminal and the script terminates and command
prompt reappers.

However, if I press any keys, nothing appears on the screen
(confiriming by enter executes a command though). This is most
probably an error in python because when I try running mplayer
manually and then sending it signal using:

$ kill -SIGKILL mplayer's_pid

mplayer dies stating 'Killed' and terminal stays alive as it should.

best regards,
Ales Kozumplik

Reply via email to